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

    r3 r148  
    1 ; File name     :   AH23h_HFeatures.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   28.12.2009
    4 ; Last update   :   12.4.2010
    5 ; Author        :   Tomi Tilli
     1; Project name  :   XTIDE Universal BIOS
    62; Description   :   Int 13h function AH=23h,
    73;                   Set Controller Features Register.
     
    1511; AH23h_HandlerForSetControllerFeatures
    1612;   Parameters:
    17 ;       AH:     Bios function 23h
     13;       AL, CX: Same as in INTPACK
     14;       DL:     Translated Drive number
     15;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     16;       SS:BP:  Ptr to INTPACK
     17;   Parameters on INTPACK in SS:BP:
    1818;       AL:     Feature Number (parameter to Features Register = subcommand)
    19 ;       DL:     Drive number (8xh)
    20 ;   Parameters loaded by Int13h_Jump:
    21 ;       DS:     RAMVARS segment
    22 ;   Parameter registers are undocumented, specific for this BIOS:
     19;   (Parameter registers are undocumented, there are specific for this BIOS):
    2320;       BH:     Parameter to Sector Count Register (subcommand specific)
    2421;       BL:     Parameter to Sector Number Register (subcommand specific)
    2522;       CL:     Parameter to Low Cylinder Register (subcommand specific)
    2623;       CH:     Parameter to High Cylinder Register (subcommand specific)
     24;   Returns with INTPACK in SS:BP:
     25;       AH:     Int 13h return status
     26;       CF:     0 if succesfull, 1 if error
     27;--------------------------------------------------------------------
     28ALIGN JUMP_ALIGN
     29AH23h_HandlerForSetControllerFeatures:
     30%ifndef USE_186
     31    call    AH23h_SetControllerFeatures
     32    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     33%else
     34    push    Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
     35    ; Fall through to AH23h_SetControllerFeatures
     36%endif
     37
     38
     39;--------------------------------------------------------------------
     40; AH23h_SetControllerFeatures
     41;   Parameters:
     42;       AL:     Feature Number (parameter to Features Register = subcommand)
     43;       BH:     Parameter to Sector Count Register (subcommand specific)
     44;       BL:     Parameter to Sector Number Register (subcommand specific)
     45;       CL:     Parameter to Low Cylinder Register (subcommand specific)
     46;       CH:     Parameter to High Cylinder Register (subcommand specific)
     47;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    2748;   Returns:
    2849;       AH:     Int 13h return status
    2950;       CF:     0 if succesfull, 1 if error
    30 ;       IF:     1
    3151;   Corrupts registers:
    32 ;       Flags
     52;       AX, BX, CX, DX, SI
    3353;--------------------------------------------------------------------
    3454ALIGN JUMP_ALIGN
    35 AH23h_HandlerForSetControllerFeatures:
    36     push    dx
    37     push    cx
    38     push    bx
    39     push    ax
    40     push    si
    41 
     55AH23h_SetControllerFeatures:
    4256    ; Backup AL and BH to SI
    4357    mov     ah, bh
     
    4559
    4660    ; Select Master or Slave and wait until ready
    47     call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    4861    call    HDrvSel_SelectDriveAndDisableIRQ
    49     jc      SHORT .Return               ; Return if error
     62    jc      SHORT .ReturnWithErrorCodeInAH
    5063
    5164    ; Output Feature Number
     
    6679    call    HCommand_OutputSectorCountAndCommand
    6780
    68     call    HStatus_WaitBsyDefTime      ; Wait until drive ready
    69 .Return:
    70     pop     si
    71     jmp     Int13h_PopXRegsAndReturn
     81    jmp     HStatus_WaitBsyDefTime      ; Wait until drive ready
     82.ReturnWithErrorCodeInAH:
     83    ret
Note: See TracChangeset for help on using the changeset viewer.