home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / section5 / int26h.asm < prev    next >
Encoding:
Assembly Source File  |  1988-08-11  |  1.5 KB  |  32 lines

  1. ;****************************************************************;
  2. ;                                                                ;
  3. ;       Interrupt 26H: Absolute Disk Write                       ;
  4. ;                                                                ;
  5. ;       Write the contents of the memory area named buff         ;
  6. ;       into logical sector 3 of drive C.                        ;
  7. ;                                                                ;
  8. ;       WARNING: Verbatim use of this code could damage          ;
  9. ;       the file structure of the fixed disk. It is meant        ;
  10. ;       only as a general guide. There is, unfortunately,        ;
  11. ;       no way to give a really safe example of this interrupt.  ;
  12. ;                                                                ;
  13. ;****************************************************************;
  14.  
  15.         mov     al,2            ; Drive C.
  16.         mov     cx,1            ; Number of sectors.
  17.         mov     dx,3            ; Beginning sector number.
  18.         mov     bx,seg buff     ; Address of buffer.
  19.         mov     ds,bx
  20.         mov     bx,offset buff
  21.         int     26h             ; Request disk write.
  22.         jc      error           ; Jump if write failed.
  23.         add     sp,2            ; Clear stack.
  24.         .
  25.         .
  26.         .
  27. error:                          ; Error routine goes here.
  28.         .
  29.         .
  30.         .
  31. buff    db      512 dup (?)     ; Data to be written to disk.
  32.