As a project, I wrote a 16bit-real mode boot sector using NASM, and then I showed it to my teacher. He asked me for adding "Showing time" feature.
What I used is :
Code: Select all
mov ah,0
int 0x1a
Code: Select all
mov ah,0
int 0x1a
Code: Select all
hour_1s_digit = hour_bcd & 0x0F // hour_1s_digit holds the 1's digit (i.e. 12 -> 2)
hour_10s_digit = hour_bcd >> 4 // hour_10s_digit holds the 10's digit (i.e. 11 -> 1)
Code: Select all
hour_1s_char = hours_1s_digit + 0x30 // hour_1s_char holds the 1's digit character (i.e. 2 -> '2')
hour_10s_char = hours_10s_digit + 0x30 // hour_10s_char holds the 10's digit character (i.e. 1 -> '1')