Page 1 of 1

How to read/write a byte?

Posted: Mon Aug 17, 2009 10:18 am
by Joe
Hi,

I am trying to implement a way to save settings so they can be used for future boots. I plan to do this by writing a byte to the floppy to indicate what a setting is so at boot-up the setting can be read and set. But I have a problem, I don't know how to read/write a byte, I have looked everywhere but can't find the answer. Any help would be greatly appreciated.

Specs:
I am using NASM and 16 bit x86 assembly.

Joe

Re: How to read/write a byte?

Posted: Mon Aug 17, 2009 10:28 am
by f2
Joe wrote:I plan to do this by writing a byte to the floppy
You must write a floppy driver. Read the wiki for more info.

Re: How to read/write a byte?

Posted: Mon Aug 17, 2009 10:49 am
by manonthemoon
You can use BIOS to access the floppy drive. The commands for reading and writing a disk are a part of interrupt 0x13. Keep in mind that you cannot directly access a single byte. You must read an entire sector, change part of it, then write the entire sector back.