Changeset 148 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
- Timestamp:
- Mar 19, 2011, 8:09:41 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
r35 r148 1 ; File name : AH2h_HRead.asm 2 ; Project name : IDE BIOS 3 ; Created date : 27.9.2007 4 ; Last update : 24.8.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Int 13h function AH=2h, Read Disk Sectors. 7 3 … … 14 10 ; AH2h_HandlerForReadDiskSectors 15 11 ; Parameters: 16 ; AH: Bios function 2h 12 ; AL, CX, DH, ES: Same as in INTPACK 13 ; DL: Translated Drive number 14 ; DS:DI: Ptr to DPT (in RAMVARS segment) 15 ; SS:BP: Ptr to INTPACK 16 ; Parameters on INTPACK in SS:BP: 17 17 ; AL: Number of sectors to read (1...255) 18 18 ; CH: Cylinder number, bits 7...0 … … 20 20 ; Bits 5...0: Starting sector number (1...63) 21 21 ; DH: Starting head number (0...255) 22 ; DL: Drive number (8xh)23 22 ; ES:BX: Pointer to buffer recieving data 24 ; Parameters loaded by Int13h_Jump: 25 ; DS: RAMVARS segment 26 ; Returns: 23 ; Returns with INTPACK in SS:BP: 27 24 ; AH: Int 13h/40h floppy return status 28 ; AL: Burst error length if AH =11h, undefined otherwise25 ; AL: Burst error length if AH returns 11h, undefined otherwise 29 26 ; CF: 0 if successfull, 1 if error 30 ; IF: 131 ; Corrupts registers:32 ; Flags33 27 ;-------------------------------------------------------------------- 34 28 ALIGN JUMP_ALIGN … … 37 31 jz SHORT AH2h_ZeroCntErr ; If so, return with error 38 32 39 ; Save registers40 push dx41 push cx42 push bx43 push ax44 45 33 ; Select sector or block mode command 46 call FindDPT_ForDriveNumber ; DS:DI now points to DPT47 34 mov ah, HCMD_READ_SECT ; Load sector mode command 48 35 cmp BYTE [di+DPT.bSetBlock], 1 ; Block mode enabled? 49 jbe SHORT .XferData ; If not, jump to transfer 50 mov ah, HCMD_READ_MUL ; Load block mode command 36 eCMOVA ah, HCMD_READ_MUL ; Load block mode command 51 37 52 38 ; Transfer data 53 ALIGN JUMP_ALIGN54 .XferData:55 39 call HCommand_OutputCountAndLCHSandCommand 56 jc SHORT .Return ; Return if error 40 jc SHORT .ReturnWithErrorCodeInAH 41 mov bx, [bp+INTPACK.bx] 57 42 call HPIO_ReadBlock ; Read data from IDE-controller 58 .Return :59 jmp Int13h_ PopXRegsAndReturn43 .ReturnWithErrorCodeInAH: 44 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 60 45 61 46 ; Invalid sector count (also for AH=3h and AH=4h) 62 47 AH2h_ZeroCntErr: 63 48 mov ah, RET_HD_INVALID ; Invalid value passed 64 stc ; Set CF since error 65 jmp Int13h_PopDiDsAndReturn 49 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Note:
See TracChangeset
for help on using the changeset viewer.