How to read/write a byte?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Joe
Posts: 3
Joined: Tue May 26, 2009 9:44 am

How to read/write a byte?

Post 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
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: How to read/write a byte?

Post 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.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
manonthemoon
Member
Member
Posts: 65
Joined: Sat Jul 04, 2009 9:39 pm

Re: How to read/write a byte?

Post 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.
Post Reply