int 13h problem
Posted: Mon Oct 20, 2008 10:27 am
hello, i can't read more than 4 sectors using int 13h... here is my code... if i try to read 5 or more it loads zeroes.... the procedure is load_sector or load_root (both can have a problem), i'm running this code in windows (fasm).... thanks
Code: Select all
org 100h
;/******************************************************************************
;*Main *
;******************************************************************************/
call print_root
mov ah, 10h
int 16h
ret
;/******************************************************************************
;*Load sector *
;******************************************************************************/
load_sector: mov ah, 2h
mov dl, 0
int 13h
ret
;/******************************************************************************
;*Load root directory *
;******************************************************************************/
load_root: mov al, 4 ;;;;;; HEREEEEEEEEEEEEEEEEEEEEEEEEEEE
mov bx, root_dir
mov ch, 0
mov cl, 2
mov dh, 1
call load_sector
ret
;/******************************************************************************
;*Print name *
;******************************************************************************/
print_name: mov ah, 0eh
mov cx, 11
.again: lodsb
int 10h
loop .again
ret
;/******************************************************************************
;*Print new line *
;******************************************************************************/
print_new_line: mov ah, 0eh
mov al, 10
int 10h
mov al, 13
int 10h
ret
;/******************************************************************************
;*Print root *
;******************************************************************************/
print_root: call load_root
mov si, root_dir
mov cx, 224
.again: cmp byte [si], 0xe5
je .skip
cmp byte [si], 0
je .end
push si
call print_name
pop si
call print_new_line
.skip: add si, 32
loop .again
.end: ret
;/******************************************************************************
;*Root directory *
;******************************************************************************/
root_dir: times 7168 db 0