Changeset 191 in xtideuniversalbios


Ignore:
Timestamp:
Nov 16, 2011, 8:47:56 AM (11 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Space optimization in Address.asm, includes bug fix for BootMenuPrintCfg.asm (was using a word index instead of a byte index).

Location:
trunk/XTIDE_Universal_BIOS/Src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm

    r186 r191  
    5151;       Nothing (jumps to next push below)
    5252;   Corrupts registers:
    53 ;       AX
     53;       AX, BX
    5454;--------------------------------------------------------------------
    5555PushAddressingMode:
    56     call    AccessDPT_GetAddressingModeForWordLookToBX
    57     mov     al,g_szAddressingModes_Displacement
     56    call    AccessDPT_GetAddressingModeToAXZF
     57    mov     bl,g_szAddressingModes_Displacement
    5858    mul     bl
    5959    add     ax,g_szAddressingModes
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm

    r173 r191  
    44; Section containing code
    55SECTION .text
    6 
    7 ; Jump table for conversion functions
    8 ALIGN WORD_ALIGN
    9 g_rgfnAddressTranslation:
    10     dw      DoNotConvertLCHS                    ; 0, ADDR_DPT_LCHS
    11     dw      ConvertLCHStoPCHS                   ; 1, ADDR_DPT_PCHS
    12     dw      ConvertLCHStoLBARegisterValues      ; 2, ADDR_DPT_LBA28
    13     dw      ConvertLCHStoLBARegisterValues      ; 3, ADDR_DPT_LBA48
    14 
    15 
    16 ;--------------------------------------------------------------------
    17 ; Address_OldInt13hAddressToIdeAddress
    18 ;   Parameters:
    19 ;       CH:     Cylinder number, bits 7...0
    20 ;       CL:     Bits 7...6: Cylinder number bits 9 and 8
    21 ;               Bits 5...0: Starting sector number (1...63)
    22 ;       DH:     Starting head number (0...255)
    23 ;       DS:DI:  Ptr to DPT
    24 ;   Returns:
    25 ;       BL:     LBA Low Register / Sector Number Register (LBA 7...0)
    26 ;       CL:     LBA Mid Register / Low Cylinder Register (LBA 15...8)
    27 ;       CH:     LBA High Register / High Cylinder Register (LBA 23...16)
    28 ;       BH:     Drive and Head Register (LBA 27...24)
    29 ;   Corrupts registers:
    30 ;       AX, DX
    31 ;--------------------------------------------------------------------
    32 ALIGN JUMP_ALIGN
    33 Address_OldInt13hAddressToIdeAddress:
    34     call    AccessDPT_GetAddressingModeForWordLookToBX
    35     push    WORD [cs:bx+g_rgfnAddressTranslation]       ; Push return address
    36     ; Fall to Address_ExtractLCHSparametersFromOldInt13hAddress
    376
    387;---------------------------------------------------------------------
     
    5019;       Nothing
    5120;--------------------------------------------------------------------
     21ALIGN JUMP_ALIGN
    5222Address_ExtractLCHSparametersFromOldInt13hAddress:
    5323    mov     bl, cl              ; Copy sector number...
     
    9767    ret
    9868
    99 
     69;--------------------------------------------------------------------
     70; Address_OldInt13hAddressToIdeAddress
     71;   Parameters:
     72;       CH:     Cylinder number, bits 7...0
     73;       CL:     Bits 7...6: Cylinder number bits 9 and 8
     74;               Bits 5...0: Starting sector number (1...63)
     75;       DH:     Starting head number (0...255)
     76;       DS:DI:  Ptr to DPT
     77;   Returns:
     78;       BL:     LBA Low Register / Sector Number Register (LBA 7...0)
     79;       CL:     LBA Mid Register / Low Cylinder Register (LBA 15...8)
     80;       CH:     LBA High Register / High Cylinder Register (LBA 23...16)
     81;       BH:     Drive and Head Register (LBA 27...24)
     82;   Corrupts registers:
     83;       AX, DX
     84;--------------------------------------------------------------------
     85ALIGN JUMP_ALIGN
     86Address_OldInt13hAddressToIdeAddress:
     87    call    Address_ExtractLCHSparametersFromOldInt13hAddress
     88    call    AccessDPT_GetAddressingModeToAXZF
     89    jz      DoNotConvertLCHS    ; 0, ADDR_DPT_LCHS
     90    dec     ax
     91    jz      ConvertLCHStoPCHS   ; 1, ADDR_DPT_PCHS
     92;; Fall-through                 ; 2, ADDR_DPT_LBA28 and 3, ADDR_DPT_LBA48
     93       
    10094;---------------------------------------------------------------------
    10195; Converts LCHS parameters to 28-bit LBA address.
  • trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm

    r181 r191  
    4242
    4343;--------------------------------------------------------------------
    44 ; AccessDPT_GetAddressingModeForWordLookToBX
     44; AccessDPT_GetAddressingModeToAXZF
    4545;   Parameters:
    4646;       DS:DI:  Ptr to Disk Parameter Table
    4747;   Returns:
    48 ;       BX:     Addressing Mode (L-CHS, P-CHS, LBA28, LBA48) shifted for WORD lookup
     48;       AX:     Addressing Mode (L-CHS, P-CHS, LBA28, LBA48)
     49;       ZF:     Set if AX=0
    4950;   Corrupts registers:
    5051;       Nothing
    5152;--------------------------------------------------------------------
    5253ALIGN JUMP_ALIGN
    53 AccessDPT_GetAddressingModeForWordLookToBX:
    54     mov     bl, [di+DPT.bFlagsLow]
    55     and     bx, BYTE MASKL_DPT_ADDRESSING_MODE
    56     eSHR_IM bx, ADDRESSING_MODE_FIELD_POSITION-1
     54AccessDPT_GetAddressingModeToAXZF:
     55    mov     al, [di+DPT.bFlagsLow]
     56    and     ax, BYTE MASKL_DPT_ADDRESSING_MODE
     57    eSHR_IM ax, ADDRESSING_MODE_FIELD_POSITION
    5758    ret
    5859
Note: See TracChangeset for help on using the changeset viewer.