Problem with reading floppy sectors
Posted: Tue Aug 09, 2005 11:00 pm
hey everyone,
the following code i'm using to read a sector from a floppy drive in ASM to load a table of contents for a simple file system. for some reason i just can't get it work right. this is one of the least complex things i've been doing lately, i must just be missing something really stupid.
thanks in advance for any help getting my code to operate properly
what it does:
reads the second sector from the floppy drive
stores it in memory
reads those values out from memory to the screen one by one
thanks!
the following code i'm using to read a sector from a floppy drive in ASM to load a table of contents for a simple file system. for some reason i just can't get it work right. this is one of the least complex things i've been doing lately, i must just be missing something really stupid.
thanks in advance for any help getting my code to operate properly
what it does:
reads the second sector from the floppy drive
stores it in memory
reads those values out from memory to the screen one by one
thanks!
Code: Select all
mov si, readingTOC ;just display a message
call DisplayMessage
mov ah, 02h ;read the sector i want off the floppy disk
mov al, 1
mov ch, 0
mov cl, 2
mov dh, 0
mov dl, 0
mov bx, 0A00h
mov es, bx
mov bx, 0
int 13h
mov dx, bx
startdisplay:
cmp dx, '?' ;try to display the contents of that sector which was loaded into memory
jz donedisplaying
push bx
mov ah, 0x0E
mov bh, 0x00
mov bl, 0x07
int 10h
pop bx
inc dx
jmp startdisplay
donedisplaying:
jmp _cmd_done ;wrap it up