Changeset 158 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h


Ignore:
Timestamp:
May 2, 2011, 9:41:51 AM (14 years ago)
Author:
Tomi Tilli
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • Optimized few bytes.
Location:
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm

    r150 r158  
    2222ALIGN JUMP_ALIGN
    2323AH24h_HandlerForSetMultipleBlocks:
    24     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     24    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    2525    jnz     SHORT .TryToSetBlockMode
    2626    stc
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm

    r155 r158  
    2828ALIGN JUMP_ALIGN
    2929AH2h_HandlerForReadDiskSectors:
    30     call    AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     30    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
     31    je      SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
     32
    3133    mov     ah, COMMAND_READ_SECTORS    ; Load sector mode command
    32     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     34    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    3335    eCMOVNZ ah, COMMAND_READ_MULTIPLE   ; Load block mode command
    3436    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
     
    4446
    4547;--------------------------------------------------------------------
    46 ; AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     48; AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
    4749;   Parameters:
    48 ;       SS:BP:  Ptr to IDEPACK
    49 ;   Parameters on INTPACK:
    50 ;       AL:     Number of sectors to transfer (1...255)
     50;       Nothing
    5151;   Returns:
    52 ;       Nothing (does not return if error)
    53 ;   Corrupts registers:
    54 ;       Nothing
     52;       Jumps to Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
    5553;--------------------------------------------------------------------
    56 ALIGN JUMP_ALIGN
    57 AH2h_ExitInt13hIfSectorCountInIntpackIsZero:
    58     cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
    59     je      SHORT .InvalidSectorCount
    60     ret
    61 .InvalidSectorCount:
     54AH2h_ExitInt13hSinceSectorCountInIntpackIsZero:
    6255    mov     ah, RET_HD_INVALID
    6356    jmp     Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH3h_HWrite.asm

    r155 r158  
    2727ALIGN JUMP_ALIGN
    2828AH3h_HandlerForWriteDiskSectors:
    29     call    AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     29    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
     30    je      SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
     31
    3032    mov     ah, COMMAND_WRITE_SECTORS   ; Load sector mode command
    31     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED
     33    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
    3234    eCMOVNZ ah, COMMAND_WRITE_MULTIPLE  ; Load block mode command
    3335    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRQ)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH4h_HVerify.asm

    r155 r158  
    2626ALIGN JUMP_ALIGN
    2727AH4h_HandlerForVerifyDiskSectors:
    28     call    AH2h_ExitInt13hIfSectorCountInIntpackIsZero
     28    cmp     BYTE [bp+IDEPACK.intpack+INTPACK.al], 0
     29    je      SHORT AH2h_ExitInt13hSinceSectorCountInIntpackIsZero
     30
    2931    mov     ah, COMMAND_VERIFY_SECTORS
    3032    mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRQ, FLG_STATUS_DRDY)
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm

    r157 r158  
    4646
    4747    ; Try to select drive and wait until ready
    48     or      WORD [di+DPT.wFlags], MASK_DPT_RESET        ; Everything uninitialized
     48    or      BYTE [di+DPT.bFlagsHigh], MASKH_DPT_RESET       ; Everything uninitialized
    4949    call    AccessDPT_GetDriveSelectByteToAL
    5050    mov     [bp+IDEPACK.bDrvAndHead], al
    5151    call    Device_SelectDrive
    5252    jc      SHORT .ReturnNotSuccessfull
    53     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nDRDY  ; Clear since success
     53    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nDRDY ; Clear since success
    5454
    5555    ; Initialize CHS parameters if LBA is not used
    5656    call    InitializeDeviceParameters
    5757    jc      SHORT .RecalibrateDrive
    58     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nINITPRMS
     58    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nINITPRMS
    5959
    6060    ; Recalibrate drive by seeking to cylinder 0
     
    6262    call    AH11h_RecalibrateDrive
    6363    jc      SHORT .InitializeBlockMode
    64     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nRECALIBRATE
     64    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nRECALIBRATE
    6565
    6666    ; Initialize block mode transfers
     
    6868    call    InitializeBlockMode
    6969    jc      SHORT .ReturnNotSuccessfull
    70     and     WORD [di+DPT.wFlags], ~FLG_DPT_RESET_nSETBLOCK  ; Keeps CF clear
     70    and     BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_RESET_nSETBLOCK ; Keeps CF clear
    7171
    7272.ReturnNotSuccessfull:
     
    9090InitializeDeviceParameters:
    9191    ; No need to initialize CHS parameters if LBA mode enabled
    92     test    BYTE [di+DPT.wFlags], FLG_DRVNHEAD_LBA  ; Clear CF
     92    test    BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA   ; Clear CF
    9393    jnz     SHORT ReturnSuccessSinceInitializationNotNeeded
    9494
     
    115115ALIGN JUMP_ALIGN
    116116InitializeBlockMode:
    117     test    WORD [di+DPT.wFlags], FLG_DPT_BLOCK_MODE_SUPPORTED  ; Clear CF
     117    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED ; Clear CF
    118118    jz      SHORT ReturnSuccessSinceInitializationNotNeeded
    119119
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Address.asm

    r155 r158  
    8989    ; (LCylinder << n) + (LHead / PHeadCount)
    9090    mov     dx, cx                  ; Copy L-CHS Cylinder number to DX
    91     mov     cl, [di+DPT.wFlags]     ; Load shift count
    92     and     cl, MASK_DPT_CHS_SHIFT_COUNT
     91    mov     cl, [di+DPT.bFlagsLow]  ; Load shift count
     92    and     cl, MASKL_DPT_CHS_SHIFT_COUNT
    9393    shl     dx, cl                  ; DX = LCylinder << n
    9494    add     ax, dx                  ; AX = P-CHS Cylinder number
Note: See TracChangeset for help on using the changeset viewer.