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

    r84 r148  
    1 ; File name     :   AH4h_HVerify.asm
    2 ; Project name  :   IDE BIOS
    3 ; Created date  :   13.10.2007
    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=4h, Verify Disk Sectors.
    83
     
    1510; AH4h_HandlerForVerifyDiskSectors
    1611;   Parameters:
    17 ;       AH:     Bios function 4h
     12;       AL, 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:
    1817;       AL:     Number of sectors to verify
    1918;       CH:     Cylinder number, bits 7...0
     
    2120;               Bits 5...0: Starting sector number (1...63)
    2221;       DH:     Starting head number (0...255)
    23 ;       DL:     Drive number
    24 ;       ES:BX:  Pointer to source data (not used)
    25 ;   Parameters loaded by Int13h_Jump:
    26 ;       DS:     RAMVARS segment
    27 ;   Returns:
     22;   Returns with INTPACK in SS:BP:
    2823;       AH:     Int 13h/40h floppy return status
    2924;       CF:     0 if successfull, 1 if error
    30 ;       IF:     1
    31 ;   Corrupts registers:
    32 ;       Flags
    3325;--------------------------------------------------------------------
    3426ALIGN JUMP_ALIGN
     
    3628    test    al, al                      ; Invalid sector count?
    3729    jz      SHORT AH2h_ZeroCntErr       ;  If so, return with error
    38     push    dx
    39     push    cx
    40     push    bx
    41     push    ax
    42 %ifndef USE_186
    43     call    AH4h_VerifySectors
    44     jmp     Int13h_PopXRegsAndReturn
    45 %else
    46     push    Int13h_PopXRegsAndReturn
    47     ; Fall through to AH4h_VerifySectors
    48 %endif
    4930
    50 
    51 ;--------------------------------------------------------------------
    52 ; Verifies hard disk sectors.
    53 ;
    54 ; AH4h_VerifySectors
    55 ;   Parameters:
    56 ;       AL:     Number of sectors to verify
    57 ;       CH:     Cylinder number, bits 7...0
    58 ;       CL:     Bits 7...6: Cylinder number bits 9 and 8
    59 ;               Bits 5...0: Starting sector number (1...63)
    60 ;       DH:     Starting head number (0...255)
    61 ;       DL:     Drive number
    62 ;       DS:     RAMVARS segment
    63 ;   Returns:
    64 ;       DS:DI:  Ptr to DPT
    65 ;       AH:     Int 13h/40h floppy return status
    66 ;       CF:     0 if successfull, 1 if error
    67 ;   Corrupts registers:
    68 ;       AL, BX, CX, DX
    69 ;--------------------------------------------------------------------
    70 ALIGN JUMP_ALIGN
    71 AH4h_VerifySectors:
    72     call    FindDPT_ForDriveNumber      ; DS:DI now points to DPT
    7331    mov     ah, HCMD_VERIFY_SECT        ; Load command to AH
    7432    call    HCommand_OutputCountAndLCHSandCommand
    75     jc      SHORT .Return               ; Return if error
     33    jc      SHORT .ReturnWithErrorCodeInAH
    7634    mov     bx, di                      ; DS:BX now points to DPT
    77     jmp     HStatus_WaitIrqOrRdy        ; Wait for IRQ or RDY
    78 .Return:
    79     ret
     35    call    HStatus_WaitIrqOrRdy        ; Wait for IRQ or RDY
     36.ReturnWithErrorCodeInAH:
     37    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
Note: See TracChangeset for help on using the changeset viewer.