Here is the code where I call int 13h and no more code is executed.
Code: Select all
LoadFile:
call lbaToChs
mov dl,0
mov al,1
mov ah,2
int 13h
jc errorLoad
add bx,510
mov cx,[es:bx]
mov ax,cx
sub ax,0xFFFF
jz return
add cx,1
jmp LoadFile
Here is the successful code where I called int 13h and the code afterwards was executed.
Code: Select all
loadRootDirectory:
mov cx,1 ; get the sector number etc. for the root dir
call lbaToChs
mov ax,0 ;we will load files to 0x07c00
mov es,ax
mov bx,0x07c00
mov ah,2
mov al,1
int 13h ; hopefully it will load first time
jnc loadedRoot
jmp errorLoad
Edit *Fixed*:
It turns out that lbaToChs was creating some duff values. It turns out that i was using the quotient when I should have been using the remainder and vice versa in some calculations.