Changeset 150 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
- Timestamp:
- Apr 29, 2011, 7:04:13 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm
r148 r150 13 13 ; DL: Translated Drive number 14 14 ; DS:DI: Ptr to DPT (in RAMVARS segment) 15 ; SS:BP: Ptr to I NTPACK16 ; Parameters on INTPACK in SS:BP:15 ; SS:BP: Ptr to IDEREGS_AND_INTPACK 16 ; Parameters on INTPACK: 17 17 ; AL: Number of sectors to write 18 18 ; CH: Cylinder number, bits 7...0 … … 21 21 ; DH: Starting head number (0...255) 22 22 ; ES:BX: Pointer to source data 23 ; Returns with INTPACK in SS:BP:23 ; Returns with INTPACK: 24 24 ; AH: Int 13h/40h floppy return status 25 25 ; CF: 0 if successfull, 1 if error … … 27 27 ALIGN JUMP_ALIGN 28 28 AH3h_HandlerForWriteDiskSectors: 29 test al, al ; Invalid sector count? 30 jz SHORT AH2h_ZeroCntErr ; If so, return with error 31 32 ; Select sector or block mode command 33 mov ah, HCMD_WRITE_SECT ; Load sector mode command 34 cmp BYTE [di+DPT.bSetBlock], 1 ; Block mode enabled? 35 eCMOVA ah, HCMD_WRITE_MUL ; Load block mode command 36 37 ; Transfer data 38 call HCommand_OutputCountAndLCHSandCommand 39 jc SHORT .ReturnWithErrorCodeInAH 40 mov bx, [bp+INTPACK.bx] 41 call HPIO_WriteBlock ; Write data to IDE-controller 42 .ReturnWithErrorCodeInAH: 29 ; Prepare parameters 30 mov ah, COMMAND_WRITE_SECTORS ; Load sector mode command 31 test WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED 32 eCMOVNZ ah, COMMAND_WRITE_MULTIPLE ; Load block mode command 33 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ) 34 mov si, [bp+IDEPACK.intpack+INTPACK.bx] 35 %ifdef USE_186 36 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 37 jmp Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH 38 %else 39 call Idepack_TranslateOldInt13hAddressAndIssueCommandFromAH 43 40 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 41 %endif
Note:
See TracChangeset
for help on using the changeset viewer.