home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / nor_asm / disk_i16.asm < prev    next >
Assembly Source File  |  1989-05-16  |  809b  |  35 lines

  1. DOSSEG
  2. .MODEL    SMALL
  3.  
  4. .STACK
  5.  
  6. .DATA
  7.  
  8.     EXTRN    SECTOR:BYTE
  9.  
  10. .CODE
  11.  
  12.     EXTRN    INIT_SEC_DISP:PROC
  13. ;-----------------------------------------------------------------------;
  14. ; This procedure reads the first sector on disk A and dumps the first    ;
  15. ; half of this sector.                            ;
  16. ;-----------------------------------------------------------------------;
  17. READ_SECTOR    PROC
  18.     MOV    AX,DGROUP        ;Put data segment into AX
  19.     MOV    DS,AX            ;Set DS to point to data
  20.  
  21.     MOV    AL,0            ;Disk drive A (number 0)
  22.     MOV    CX,1            ;Read only 1 sector
  23.     MOV    DX,0            ;Read sector number 0
  24.     LEA    BX,SECTOR        ;Where to store this sector
  25.     INT    25h            ;Read the sector
  26.     POPF                ;Discard flags put on stack by DOS
  27.     CALL    INIT_SEC_DISP        ;Dump the first half
  28.  
  29.     MOV    AH,4Ch            ;Return to DOS
  30.     INT    21h
  31. READ_SECTOR    ENDP
  32.  
  33.  
  34.     END    READ_SECTOR
  35.