fate: inc cx
mov ah,10h
mov dl,00h
int 13h floppy in PC (C=0=ok or C=1=error) (int this code is C=1 why? floppy is in PC why?)
mov ah,00h
mov dl,00h
int 13h loading "floppy"

jnc fatd
cmp cx,08h
je fata is not ok
jmp fate is ok
is actually this:fate: inc cx
mov ah,10h
mov dl,00h
int 13h floppy in PC (C=0=ok or C=1=error) (int this code is C=1 why? floppy is in PC why?)
Int 13/AH=10h - HARD DISK - CHECK IF DRIVE READY
You're trying to read the floppy with the reset command, look at this.mov ah,00h
mov dl,00h
int 13h loading "floppy"![]()
Code: Select all
discfail db 0
fatfile times 9216 db 0
rootfile times 7168 db 0
errorfl db "Error: disc is not ready", 0x00
_fat: xor cx,cx
clc
jmp fate
fate: inc cx
mov ah,0eh
mov al,41h
int 10h
mov ah,00h
mov dl,00h
int 13h
jnc fatd
cmp cx,08h
je fata
jmp fate
fatd:
xor ax,ax
xor bx,bx
xor cx,cx
xor dx,dx
mov ah,02h
mov al,11h
mov ch,00h
mov cl,01h
;don't have to reset dx, dx = 0
;
push cs
pop es
mov bx,fatfile
int 13h
jc fata ;<-- this moment, read error=exit of prcedure
;I think this is weird.. cylinder 1 ? should be head 1, I think
mov ah,02h
mov al,01h
mov ch,00h ;was mov ch,01h
mov cl,00h
mov dl,00h
mov dh,01h ;was mov dh,00h
push cs
pop es
mov bx,fatfile
add bx,2200h
int 13h
mov ah,02h
mov al,0eh
mov ch,01h
mov cl,01h
mov dl,00h
mov dh,00h
push cs
pop es
mov bx,rootfile
int 13h
;here your process code
halt:
jmp halt
fata: push cs
pop ds
mov ax,errorfl
mov si,ax
call fatb
jmp fatd
fatb: lodsb
cmp al,00h
je fatc
mov ah,0eh
int 10h
jmp fatb
fatc:
ret