Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  In DOS version 4, the Absolute Disk Read and Write services--interrupts
  25H and 26H (decimal 37 and 38)--have been augmented to process 32-bit
  logical sector numbers. You must use these services to access individual
  sectors in disk partitions that contain more than 65,536 sectors.

  As in previous DOS versions, these interrupt services require you to use
  the CPU registers to pass a disk drive ID, a buffer address, a starting
  sector number, and a number of sectors. However, the registers are used
  differently in DOS version 4 (Figure D-5). To use a 32-bit sector number,
  you must execute interrupt 25H or 26H with CX = -1 and DS:BX containing
  the address of a control packet, a 10-byte data structure that contains
  the starting sector number, the number of sectors to read or write, and
  the buffer address (Figure D-6). If CX does not contain -1, DOS version 4
  assumes that the other registers are used as in previous DOS versions to
  describe the read or write operation. (See Chapter 15 for details.)

  Call with                            Returns
  --------------------------------------------------------------------------
  AL = drive ID                        Previous contents of Flags
  CX = -1                              register on top of stack
  DS:BX -> control packet              If error:
                                       CF set
                                       AH = error code
                                       AL = error code
                                       If no error:
                                       CF clear
  --------------------------------------------------------------------------

  Figure D-5.  Registers used with interrupt 25H and 26H services in DOS
  Version 4.

  Offset         Size (bytes)   Contents
  --------------------------------------------------------------------------
  00H            4              Logical sector number
  04H            2              Number of sectors to read or write
  06H            4              Segment:offset address of data buffer
  --------------------------------------------------------------------------

  Figure D-6.  The control packet used in DOS 4.0 interrupt 25H and 26H
  services.

  The augmented DOS version 4 versions of these services use the same codes
  to report errors as previous versions. If you do not use a 32-bit logical
  sector number when you access a disk partition that contains more than
  65,536 sectors, these services return with AH = 02H (bad address mark) and
  AL = 07H (unknown media). This error occurs even if you try to access one
  of the first 65,536 logical sectors in the partition.

  Before it can process an interrupt 25H or interrupt 26H request, DOS
  version 4 must know how the disk is formatted. For a fixed disk this isn't
  a problem, but for diskettes you can ensure that DOS knows the current
  diskette format by executing interrupt 21H, function 47H (Get Current
  Directory) before you call interrupt 25H or 26H.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson