Miscellaneous > 16 bit DOS Programming

Printing a BCD value

(1/1)

haghiri75:
I wrote a code with interrupt 1ah, and I did this :

--- Code: ---mov al, ch
and al, 0fh
mov dl, al
--- End code ---

Now, for example time is "18:36", it shall print hours, and only prints 8. Because I wanted program to do this. But, what can I do to show "1"?

P.S : I tested masking lower nibble, but it wasn't my answer.

FORTRANS:
Hi,

   Try the following to print the high packed BCD digit in a byte.
It is similar to your posted code that printed the low digit.


--- Code: ---        MOV     AL,CH
        SHR     AL,4
        MOV     DL,AL
--- End code ---

HTH,

Steve

Navigation

[0] Message Index

Go to full version