Hello im trying to display the actual time hours/minutes/seconds this is my code sample:
MOV AH, 2Ch
INT 21h
MOV AH, 0Eh
MOV AL, CH
INT 10h
MOV AL, 3Ah
IN
You need a print routine to print bytes as numbers, instead of writing them directly to the screen as characters. Luckily since you only have to deal with values between 0 and 59, and since you want leading zeroes, the problem is pretty simple. Assuming value to be printed in AX:
print2Digits:
;; input in AX (0-99)
;; clobbers AX and DX, save them if needed
MOV DL, 0Ah ; divide by: 10
DIV DL ; first digit in AL (quotient), second digit in AH (remainder)
MOV DX, AX ; save the digits
ADD AL, 30h ; ASCII '0'
MOV AH, 0Eh ; set up print
INT 10h ; print first digit.
MOV AL, DH ; retrieve second digit
ADD AL, 30h
INT 10h ; print it
RET