Ignore:
Timestamp:
Mar 19, 2011, 8:09:41 PM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • INT 13h optimizations to save almost 100 bytes.
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
    62; Description   :   Int 13h function AH=3h, Write Disk Sectors.
    73
     
    1410; AH3h_HandlerForWriteDiskSectors
    1511;   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:
    1717;       AL:     Number of sectors to write
    1818;       CH:     Cylinder number, bits 7...0
     
    2020;               Bits 5...0: Starting sector number (1...63)
    2121;       DH:     Starting head number (0...255)
    22 ;       DL:     Drive number (8xh)
    2322;       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:
    2724;       AH:     Int 13h/40h floppy return status
    2825;       CF:     0 if successfull, 1 if error
    29 ;       IF:     1
    30 ;   Corrupts registers:
    31 ;       Flags
    3226;--------------------------------------------------------------------
    3327ALIGN JUMP_ALIGN
     
    3630    jz      SHORT AH2h_ZeroCntErr       ;  If so, return with error
    3731
    38     ; Save registers
    39     push    dx
    40     push    cx
    41     push    bx
    42     push    ax
    43 
    4432    ; Select sector or block mode command
    45     call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    4633    mov     ah, HCMD_WRITE_SECT         ; Load sector mode command
    4734    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
    5036
    5137    ; Transfer data
    52 ALIGN JUMP_ALIGN
    53 .XferData:
    5438    call    HCommand_OutputCountAndLCHSandCommand
    55     jc      SHORT .Return               ; Return if error
     39    jc      SHORT .ReturnWithErrorCodeInAH
     40    mov     bx, [bp+INTPACK.bx]
    5641    call    HPIO_WriteBlock             ; Write data to IDE-controller
    57 .Return:
    58     jmp     Int13h_PopXRegsAndReturn
     42.ReturnWithErrorCodeInAH:
     43    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Note: See TracChangeset for help on using the changeset viewer.