Im pretty new to assembler and having a problem with creating a modulus function. The full problem is that I want to display a clock on the screen that takes the time from the system clock. This is my current thinking:
cycle: mov ah,06 ;check for Esc pressed?
cmp al,27 ; if pressed then exit program
mov dh,5 ;set cursor position
mov ah,2ch ;get time from system clock
int 21h ;ch will contain hours, cl will contain
;dh will contain secs, dl will contain
mov dl,secs1 ;display secs1
The problem is that the values for mins (for example) are displayed as ascii chars. So I want to divide mins by 10 using IDIV, which should give me the quotient and the reminder then I can correct their values and display the time. However I cannot move secs1 (mins value) into ax (ax is divided by al when using idiv function), I get an operands types do not match error. Is there a way around this problem, maybe using different registers etc?
Thanks for any help..