working counter
This commit is contained in:
parent
e9d279fcf3
commit
9e883b837d
27
boot.s
27
boot.s
|
@ -152,18 +152,31 @@ not_eol:
|
|||
cmp $512, %si
|
||||
jl render_loop
|
||||
|
||||
# xor %dx, %dx # no need to move the cursor - it's already in a good enough place
|
||||
# mov $0x2, %ah
|
||||
# int $0x10
|
||||
|
||||
# print sector number
|
||||
mov $'0', %al
|
||||
mov $231, %bl
|
||||
# print sector number
|
||||
int $0x10 # wild assumption - %ah == 0xe
|
||||
int $0x10 # printing some garbage to make this line up
|
||||
int $0x10
|
||||
mov %cs:_sector_num+1, %cx
|
||||
mov $4, %dl # loop counter
|
||||
|
||||
mov $231, %bl # TODO can be removed if i change the loop condition higher up
|
||||
digit_loop:
|
||||
mov %cx, %ax
|
||||
mov $10, %dh # base 10
|
||||
div %dh # %al = quotient ; %ah = remainder
|
||||
ror $8, %ax # swap those around
|
||||
add $'0', %al
|
||||
mov %ah, %cl # save remainder
|
||||
xor %ch, %ch
|
||||
mov $0xe, %ah
|
||||
int $0x10
|
||||
|
||||
mov $'\b', %al # backspace two times
|
||||
int $0x10
|
||||
int $0x10
|
||||
int $0x10 # TODO real number
|
||||
dec %dl
|
||||
jnz digit_loop
|
||||
|
||||
|
||||
mov $0, %ah # read character
|
||||
|
|
Loading…
Reference in New Issue