Ignore:
Timestamp:
Nov 14, 2011, 11:09:06 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

General code size optimizations, preparing for string compression, consolidating all strings into strings.asm. Note that some changes resulted in slightly larger size now uncompressed, but will be net win when compressed.

File:
1 edited

Legend:

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

    r181 r182  
    5555PushAddressingMode:
    5656    call    AccessDPT_GetAddressingModeForWordLookToBX
    57     push    WORD [cs:bx+rgszAddressingModeString]
    58 
     57    mov     al,g_szAddressingModes_Displacement
     58    mul     bl
     59    add     ax,g_szAddressingModes
     60    push    ax
     61;
     62; Ensure that addressing modes are correctly spaced in memory
     63;
     64%if g_szLCHS <> g_szAddressingModes
     65%error "g_szAddressingModes Displacement Incorrect 1"
     66%endif
     67%if g_szPCHS <> g_szLCHS + g_szAddressingModes_Displacement
     68%error "g_szAddressingModes Displacement Incorrect 2"
     69%endif
     70%if g_szLBA28 <> g_szPCHS + g_szAddressingModes_Displacement       
     71%error "g_szAddressingModes Displacement Incorrect 3"
     72%endif
     73%if g_szLBA48 <> g_szLBA28 + g_szAddressingModes_Displacement       
     74%error "g_szAddressingModes Displacement Incorrect 4"
     75%endif             
     76       
    5977;--------------------------------------------------------------------
    6078; PushBlockMode
     
    86104;--------------------------------------------------------------------
    87105;PushBusType:
    88     cwd                 ; Clear DX using sign extension
    89     xchg    ax, bx      ; Store BX to AX
    90     eMOVZX  bx, BYTE [cs:si+IDEVARS.bDevice]
    91     mov     bx, [cs:bx+rgwBusTypeValues]    ; Char to BL, Int to BH
    92     mov     dl, bh
    93     push    bx          ; Push character
    94     push    dx          ; Push 1, 8, 16 or 32
    95     xchg    bx, ax      ; Restore BX
     106    mov     al,g_szBusTypeValues_Displacement
     107    mul     BYTE [cs:si+IDEVARS.bDevice]
     108    shr     ax,1
     109    add     ax,g_szBusTypeValues
     110    push    ax 
    96111
     112;
     113; Ensure that bus type strings are correctly spaced in memory
     114;
     115%if g_szBusTypeValues_8Dual <> g_szBusTypeValues
     116%error "g_szBusTypeValues Displacement Incorrect 1"
     117%endif
     118%if g_szBusTypeValues_8Reversed <> g_szBusTypeValues + g_szBusTypeValues_Displacement
     119%error "g_szBusTypeValues Displacement Incorrect 2"     
     120%endif
     121%if g_szBusTypeValues_8Single <> g_szBusTypeValues_8Reversed + g_szBusTypeValues_Displacement
     122%error "g_szBusTypeValues Displacement Incorrect 3"             
     123%endif
     124%if g_szBusTypeValues_16 <> g_szBusTypeValues_8Single + g_szBusTypeValues_Displacement     
     125%error "g_szBusTypeValues Displacement Incorrect 4"             
     126%endif
     127%if g_szBusTypeValues_32 <> g_szBusTypeValues_16 + g_szBusTypeValues_Displacement
     128%error "g_szBusTypeValues Displacement Incorrect 5"             
     129%endif
     130%if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
     131%error "g_szBusTypeValues Displacement Incorrect 6"             
     132%endif             
     133               
    97134;--------------------------------------------------------------------
    98135; PushIRQ
     
    155192    jmp     BootMenuPrint_FormatCSSIfromParamsInSSBP
    156193
    157 
    158 ALIGN WORD_ALIGN
    159 rgszAddressingModeString:
    160     dw      g_szLCHS
    161     dw      g_szPCHS
    162     dw      g_szLBA28
    163     dw      g_szLBA48
    164 
    165 rgwBusTypeValues:
    166     db      'D', 8      ; DEVICE_8BIT_DUAL_PORT_XTIDE
    167     db      'X', 8      ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
    168     db      'S', 8      ; DEVICE_8BIT_SINGLE_PORT
    169     db      ' ', 16     ; DEVICE_16BIT_ATA
    170     db      ' ', 32     ; DEVICE_32BIT_ATA
    171     db      ' ', 1      ; DEVICE_SERIAL_PORT
Note: See TracChangeset for help on using the changeset viewer.