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/AHCh_HSeek.asm

    r116 r148  
    1010; AHCh_HandlerForSeek
    1111;   Parameters:
    12 ;       AH:     Bios function Ch
     12;       CX, DH: 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:
    1317;       CH:     Cylinder number, bits 7...0
    1418;       CL:     Bits 7...6: Cylinder number bits 9 and 8
    1519;               Bits 5...0: Starting sector number (1...63)
    1620;       DH:     Starting head number (0...255)
    17 ;       DL:     Drive number
    18 ;   Parameters loaded by Int13h_Jump:
    19 ;       DS:     RAMVARS segment
    20 ;   Returns:
     21;   Returns with INTPACK in SS:BP:
    2122;       AH:     BIOS Error code
    2223;       CF:     0 if succesfull, 1 if error
    23 ;       IF:     1
    24 ;   Corrupts registers:
    25 ;       Flags
    2624;--------------------------------------------------------------------
    2725ALIGN JUMP_ALIGN
    2826AHCh_HandlerForSeek:
    29     push    dx
    30     push    cx
    31     push    bx
    32     push    ax
    3327%ifndef USE_186
    3428    call    AHCh_SeekToCylinder
    35     jmp     Int13h_PopXRegsAndReturn
     29    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3630%else
    37     push    Int13h_PopXRegsAndReturn
     31    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3832    ; Fall through to AHCh_SeekToCylinder
    3933%endif
     
    4135
    4236;--------------------------------------------------------------------
    43 ; Seeks to a cylinder.
    44 ;
    4537; AHCh_SeekToCylinder
    4638;   Parameters:
     
    4941;               Bits 5...0: Starting sector number (1...63)
    5042;       DH:     Starting head number (0...255)
    51 ;       DL:     Drive Number
    52 ;       DS:     RAMVARS segment
     43;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    5344;   Returns:
    54 ;       DS:DI:  Ptr to DPT
    5545;       AH:     BIOS Error code
    5646;       CF:     0 if succesfull, 1 if error
     
    5848;       AL, BX, CX, DX
    5949;--------------------------------------------------------------------
    60 ALIGN JUMP_ALIGN
    6150AHCh_SeekToCylinder:
    62     call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    6351    mov     ax, HCMD_SEEK<<8            ; Load cmd to AH, AL=zero sector cnt
    6452    call    HCommand_OutputCountAndLCHSandCommand
    65     jc      SHORT .Return               ; Return if error
     53    jc      SHORT .ReturnWithErrorCodeInAH
    6654    mov     bx, di                      ; DS:BX now points to DPT
    6755    jmp     HStatus_WaitIrqOrRdy        ; Wait for IRQ or RDY
    68 .Return:
     56.ReturnWithErrorCodeInAH:
    6957    ret
Note: See TracChangeset for help on using the changeset viewer.