Final changes and tweaks before submission
This commit is contained in:
@ -38,52 +38,6 @@ cons_writeline:
|
||||
call cons_write_crlf
|
||||
ret
|
||||
|
||||
# Added Write Hex and Int functions to help with debugging
|
||||
HexChars: .ascii "0123456789ABCDEF"
|
||||
|
||||
cons_write_hex:
|
||||
movw $4, %cx
|
||||
movb $0x0E, %ah
|
||||
|
||||
hexloop:
|
||||
rol $4, %bx
|
||||
movw %bx, %si
|
||||
and $0x000F, %si
|
||||
movb HexChars(%si), %al
|
||||
int $0x10
|
||||
loop hexloop
|
||||
ret
|
||||
|
||||
cons_write_int:
|
||||
movw $IntBuffer + 4, %si
|
||||
movw %bx, %ax
|
||||
|
||||
cmpw $0, %ax
|
||||
jge getdigit
|
||||
|
||||
xor %ax, %ax # Added to handle signed numbers, it adds the minus and then neg's the number
|
||||
movb $0x0E, %ah
|
||||
movb $0x2D, %al
|
||||
int $0x10
|
||||
|
||||
movw %bx, %ax
|
||||
negw %ax
|
||||
|
||||
getdigit:
|
||||
xor %dx, %dx
|
||||
movw $10, %cx
|
||||
idiv %cx
|
||||
addb $48, %dl
|
||||
movb %dl, (%si)
|
||||
dec %si
|
||||
cmp $0, %ax
|
||||
jne getdigit
|
||||
inc %si
|
||||
call cons_write
|
||||
ret
|
||||
|
||||
IntBuffer: .string " "
|
||||
|
||||
# Draw Line function
|
||||
cons_draw_line:
|
||||
movw $0, err # Make sure that err starts at 0
|
||||
@ -249,7 +203,7 @@ endless_loop: # Loop forever more
|
||||
boot_message:
|
||||
.string "Boot Loader Stage 2 loaded"
|
||||
|
||||
x0: .word 0
|
||||
x0: .word 0 # Setup the static memory to hold our variables
|
||||
y0: .word 0
|
||||
x1: .word 0
|
||||
y1: .word 0
|
||||
|
Reference in New Issue
Block a user