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

    r35 r148  
    1 ; File name     :   AH2h_HRead.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   27.9.2007
    4 ; Last update   :   24.8.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Int 13h function AH=2h, Read Disk Sectors.
    73
     
    1410; AH2h_HandlerForReadDiskSectors
    1511;   Parameters:
    16 ;       AH:     Bios function 2h
     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 read (1...255)
    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 buffer recieving 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
    28 ;       AL:     Burst error length if AH=11h, undefined otherwise
     25;       AL:     Burst error length if AH returns 11h, undefined otherwise
    2926;       CF:     0 if successfull, 1 if error
    30 ;       IF:     1
    31 ;   Corrupts registers:
    32 ;       Flags
    3327;--------------------------------------------------------------------
    3428ALIGN JUMP_ALIGN
     
    3731    jz      SHORT AH2h_ZeroCntErr       ;  If so, return with error
    3832
    39     ; Save registers
    40     push    dx
    41     push    cx
    42     push    bx
    43     push    ax
    44 
    4533    ; Select sector or block mode command
    46     call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    4734    mov     ah, HCMD_READ_SECT          ; Load sector mode command
    4835    cmp     BYTE [di+DPT.bSetBlock], 1  ; Block mode enabled?
    49     jbe     SHORT .XferData             ;  If not, jump to transfer
    50     mov     ah, HCMD_READ_MUL           ; Load block mode command
     36    eCMOVA  ah, HCMD_READ_MUL           ; Load block mode command
    5137
    5238    ; Transfer data
    53 ALIGN JUMP_ALIGN
    54 .XferData:
    5539    call    HCommand_OutputCountAndLCHSandCommand
    56     jc      SHORT .Return               ; Return if error
     40    jc      SHORT .ReturnWithErrorCodeInAH
     41    mov     bx, [bp+INTPACK.bx]
    5742    call    HPIO_ReadBlock              ; Read data from IDE-controller
    58 .Return:
    59     jmp     Int13h_PopXRegsAndReturn
     43.ReturnWithErrorCodeInAH:
     44    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    6045
    6146; Invalid sector count (also for AH=3h and AH=4h)
    6247AH2h_ZeroCntErr:
    6348    mov     ah, RET_HD_INVALID          ; Invalid value passed
    64     stc                                 ; Set CF since error
    65     jmp     Int13h_PopDiDsAndReturn
     49    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Note: See TracChangeset for help on using the changeset viewer.