Luchezar Georgiev wrote:


MOV DX,0 ; Read sector number 0


Eric is right - sector numbers are 1-based, not 0-based.


Well, after some testing I finally found a workaround for my problem. It is actually very weird. I also noticed a difference between the Interrupt List and what I really have to use in the program.


1) Ralph's Interrupt List indeed says that DX = 0 means reading the highest sector number. My book says that DX = 0 means reading the first sector on the drive. I checked both sources, just to be sure.

Now, the word 'MSDOS' is present almost at the beginning of a 'bootsector' of a floppy disk. Correct? Well, when I use DX = 0 the program reads the first sector, not the last one and I can check it thanks to the word 'MSDOS'. I even tried with the Debug commands: 'L 100 0 0 1' and 'D 100'. It lists the 'bootsector' of a floppy disk. This sector is not shown when I use DX equal to 1. So, who is right and who is wrong? Anyway, the practice tells me that my book is right.

Why the Interrupt List says something else, I have no idea but there might be a good reason for this. Could it have something to do with the used BIOS version? Very unlikely but I'm eager to know.

2) Now, some other weird thing is why I'm finally able to read disk sectors. Before I start reading sectors after a bootup sequence of the computer, I first need to execute the DOS command: 'DIR A:\'. Then every read attempt even after switching floppy disks, works as expected. Debug however, doesn't have this behavior. Reading a sector from disk with Debug after a reboot just works without any trickery.

What might be causing this? Are there some other interrupts that need to be executed first before the read interrupt can be issued in my program?

And, thanks for helping me so far.

Regards,
Andy.


------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click _______________________________________________ Freedos-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to