Page 1 of 1

int 13/AH=02

Posted: Wed Nov 06, 2002 12:00 am
by MWM
This question concerns loading sectors from disk via int 13/AH=02.  My problem is that the register cl, which holds the value of the sector to be load into memory only allows  values in the range 0-63.  If I would like to load sector 100 from the disk into memory how would i go about doing this?  My guess is that I would use CHS translation to load the desired  sector.  If this is correct could someone please explain to me with an example how  i would use this method to obtain the correct sector.   If not please let me know how this could me done.

thank you
MWM

RE:int 13/AH=02

Posted: Wed Nov 06, 2002 12:00 am
by Tom Fritz
what about using different heads?

RE:int 13/AH=02

Posted: Thu Nov 07, 2002 12:00 am
by carbonBased
cylinder = LBA / (heads_per_cylinder * sectors_per_track)
    temp = LBA % (heads_per_cylinder * sectors_per_track)
    head = temp / sectors_per_track
  sector = temp % sectors_per_track + 1

LBA = logical/large block access, ie. your 32-bit sector number

You'll have to get the drive parameters from the IDE controller, or a BIOS call (unless you know them before hand, perhaps; like a 1.44mb floppy)

PS: That's the _FIRST_ link that pops up on a search for CHS translation (your own words!) on Google.  Did you even try to find this info yourself?

Jeff