Compact bootloader code

This commit is contained in:
Nero 2020-03-30 19:43:07 +00:00
parent 0b2a7e7b64
commit bc096f41d3
1 changed files with 15 additions and 20 deletions

View File

@ -203,36 +203,31 @@ loop: add si, 0x20
jne loop
ret
main: mov ax, 2
loadr: mov ax, 2
xor dx, dx
call load
jmp load
; search for an system directory
loadf: call search
jne end
mov ax, [si+0x1A]
mov dx, [si+0x14]
jmp load
main: ; load root directory
call loadr
; search for first system directory
mov ah, 0x14
call search
jne end
mov ax, [si+0x1A]
mov dx, [si+0x14]
call load
call loadf
; search for first system file
mov ah, 0x04
call search
jne end
mov ax, [si+0x1A]
mov dx, [si+0x14]
call load
call loadf
; jump
jmp 0:0x7C00
end: call msg
db "DIR", 0
jmp err
; segment register for data
dest: dw 0x07c0
; Padding and signature
times (0x1FE - ($-$$)) db 0
dw 0xAA55