Changeset 148 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.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/AH3h_HWrite.asm
r3 r148 1 ; File name : AH3h_HWrite.asm 2 ; Project name : IDE BIOS 3 ; Created date : 13.10.2007 4 ; Last update : 12.4.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Int 13h function AH=3h, Write Disk Sectors. 7 3 … … 14 10 ; AH3h_HandlerForWriteDiskSectors 15 11 ; Parameters: 16 ; AH: Bios function 3h 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 write 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 source 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 25 ; CF: 0 if successfull, 1 if error 29 ; IF: 130 ; Corrupts registers:31 ; Flags32 26 ;-------------------------------------------------------------------- 33 27 ALIGN JUMP_ALIGN … … 36 30 jz SHORT AH2h_ZeroCntErr ; If so, return with error 37 31 38 ; Save registers39 push dx40 push cx41 push bx42 push ax43 44 32 ; Select sector or block mode command 45 call FindDPT_ForDriveNumber ; DS:DI now points to DPT46 33 mov ah, HCMD_WRITE_SECT ; Load sector mode command 47 34 cmp BYTE [di+DPT.bSetBlock], 1 ; Block mode enabled? 48 jbe SHORT .XferData ; If not, jump to transfer 49 mov ah, HCMD_WRITE_MUL ; Load block mode command 35 eCMOVA ah, HCMD_WRITE_MUL ; Load block mode command 50 36 51 37 ; Transfer data 52 ALIGN JUMP_ALIGN53 .XferData:54 38 call HCommand_OutputCountAndLCHSandCommand 55 jc SHORT .Return ; Return if error 39 jc SHORT .ReturnWithErrorCodeInAH 40 mov bx, [bp+INTPACK.bx] 56 41 call HPIO_WriteBlock ; Write data to IDE-controller 57 .Return :58 jmp Int13h_ PopXRegsAndReturn42 .ReturnWithErrorCodeInAH: 43 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Note:
See TracChangeset
for help on using the changeset viewer.