Converting Problem
Posted: Fri Jan 04, 2008 7:09 am
Hi,
I've a little problem by converting a number to an ascii value. First of all I read the current date and time and save it:
so far....The documentation says that all is stored in BCD format (ie. 23 decimal is stored 23h) and I can verify this. Now I try to convert the values (day, month, year and so on) to ascii values:
and then I print it on the screen and I should get this one:

THX
I've a little problem by converting a number to an ascii value. First of all I read the current date and time and save it:
Code: Select all
get_dtime:
mov ah, 0x02
int 0x1A
mov byte [hour], ch
mov byte [minute], cl
mov byte [second], dh
mov ah, 0x04
int 0x1A
mov byte [century], ch
mov byte [year], cl
mov byte [month], dh
mov byte [day], dl
ret
Code: Select all
convert_dtime:
mov ax, [day]
mov bl, 0x10
div bl
add al, 0x30
add ah, 0x30
mov byte [day_1], al
mov byte [day_2], ah
mov ax, [month]
mov bl, 0x10
div bl
add ah, 0x30
add al, 0x30
mov byte [month_1], al
mov byte [month_2], ah
ret
but instead of this I'm getting04.01
What I'm doing wrong? Where is my mistake? I'm not able to find it04.p1
THX