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

    r120 r148  
    1010; AH25h_HandlerForGetDriveInformation
    1111;   Parameters:
    12 ;       AH:     Bios function 25h
    13 ;       DL:     Drive number
     12;       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:
    1417;       ES:BX:  Ptr to buffer to receive 512-byte drive information
    15 ;   Parameters loaded by Int13h_Jump:
    16 ;       DS:     RAMVARS segment
    17 ;   Returns:
    18 ;       ES:BX:  Ptr to 512-byte buffer to receive drive Information
     18;   Returns with INTPACK in SS:BP:
    1919;       AH:     Int 13h return status
    2020;       CF:     0 if succesfull, 1 if error
    21 ;       IF:     1
    22 ;   Corrupts registers:
    23 ;       Flags
    2421;--------------------------------------------------------------------
    2522ALIGN JUMP_ALIGN
    2623AH25h_HandlerForGetDriveInformation:
    27     push    dx
    28     push    cx
    29     push    bx
    30     push    ax
    31     push    es
    32 
    3324    ; Wait until previously selected drive is ready
    34     call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    3525    call    HDrvSel_SelectDriveAndDisableIRQ
    36     jc      SHORT .Return               ; Return if error
     26    jc      SHORT .ReturnWithErrorCodeInAH      ; Return if error
    3727
    3828    ; Get drive information
     29    mov     bx, [bp+INTPACK.bx]
    3930    call    HPIO_NormalizeDataPointer
    4031    push    bx
     
    4536    pop     di                          ; Pop buffer offset to DI
    4637    call    AH25h_GetDriveInfo          ; Get drive information
    47 .Return:
    48     pop     es
    49     jmp     Int13h_PopXRegsAndReturn
     38.ReturnWithErrorCodeInAH:
     39    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    5040
    5141
     
    8777    eCMOVE  cl, B_TIMEOUT_RESET         ;  If so, load long timeout
    8878    call    HStatus_WaitRdy             ; Wait until ready to accept commands
    89     jc      SHORT .Return               ; Return if error
     79    jc      SHORT .ReturnWithErrorCodeInAH
    9080
    9181    ; Output command
     
    9383    out     dx, al                      ; Output command
    9484    call    HStatus_WaitDrqDefTime      ; Wait until ready to transfer (no IRQ!)
    95     jc      SHORT .Return               ; Return if error
     85    jc      SHORT .ReturnWithErrorCodeInAH
    9686
    9787    ; Transfer data
     
    10292    call    HStatus_WaitRdyDefTime      ; Wait until drive ready
    10393
    104 .Return:
     94.ReturnWithErrorCodeInAH:
    10595    pop     bx
    10696    pop     dx
Note: See TracChangeset for help on using the changeset viewer.