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

    r84 r148  
    1 ; File name     :   AH24h_HSetBlocks.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   28.12.2009
    4 ; Last update   :   14.1.2011
    5 ; Author        :   Tomi Tilli,
    6 ;               :   Krister Nordvall (optimizations)
     1; Project name  :   XTIDE Universal BIOS
    72; Description   :   Int 13h function AH=24h, Set Multiple Blocks.
    83
     
    1510; AH24h_HandlerForSetMultipleBlocks
    1611;   Parameters:
    17 ;       AH:     Bios function 24h
     12;       AL:     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:
    1817;       AL:     Number of Sectors per Block (1, 2, 4, 8, 16, 32, 64 or 128)
    19 ;       DL:     Drive number
    20 ;   Parameters loaded by Int13h_Jump:
    21 ;       DS:     RAMVARS segment
    22 ;   Returns:
     18;   Returns with INTPACK in SS:BP:
    2319;       AH:     Int 13h return status
    2420;       CF:     0 if succesfull, 1 if error
    25 ;       IF:     1
    26 ;   Corrupts registers:
    27 ;       Flags
    2821;--------------------------------------------------------------------
    2922ALIGN JUMP_ALIGN
    3023AH24h_HandlerForSetMultipleBlocks:
    31     push    dx
    32     push    cx
    33     push    bx
    34     push    ax
    3524%ifndef USE_186
    3625    call    AH24h_SetBlockSize
    37     jmp     Int13h_PopXRegsAndReturn
     26    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    3827%else
    39     push    Int13h_PopXRegsAndReturn
     28    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    4029    ; Fall through to AH24h_SetBlockSize
    4130%endif
     
    4837;   Parameters:
    4938;       AL:     Number of Sectors per Block (1, 2, 4, 8, 16, 32, 64 or 128)
    50 ;       DL:     Drive number
    51 ;       DS:     RAMVARS segment
     39;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    5240;   Returns:
    53 ;       DS:DI:  Ptr to DPT
    5441;       AH:     Int 13h return status
    5542;       CF:     0 if succesfull, 1 if error
    5643;   Corrupts registers:
    57 ;       AL, BX, CX, DX, DI
     44;       AL, BX, CX, DX
    5845;--------------------------------------------------------------------
    5946ALIGN JUMP_ALIGN
     
    6148    ; Select Master or Slave and wait until ready
    6249    mov     bl, al                              ; Backup block size
    63     call    FindDPT_ForDriveNumber              ; DS:DI now points to DPT
    6450    call    HDrvSel_SelectDriveAndDisableIRQ    ; Select drive and wait until ready
    65     jc      SHORT .Return                       ; Return if error
     51    jc      SHORT .ReturnWithErrorCodeInAH      ; Return if error
    6652
    6753    ; Output block size and command
     
    8066.DisableBlockMode:
    8167    mov     BYTE [di+DPT.bSetBlock], 1          ; Disable block mode
    82 .Return:
     68.ReturnWithErrorCodeInAH:
    8369    ret
Note: See TracChangeset for help on using the changeset viewer.