Compact bootloader code
This commit is contained in:
parent
0b2a7e7b64
commit
bc096f41d3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user