Changeset 194 in xtideuniversalbios for trunk


Ignore:
Timestamp:
Nov 17, 2011, 11:07:58 AM (13 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

ifdef'd out more unused code. Also added a tool for looking through the listing and the output of the precompiler to aid in finding dead code. Some changes in the files are to add annotations for the tool to avoid false positives.

Location:
trunk
Files:
2 added
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Display/DisplayContext.asm

    r181 r194  
    100100    pop     ax                      ; Pop return address
    101101
     102%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    102103    %assign i 0
    103104    %rep DISPLAY_CONTEXT_size / 2
     
    105106    %assign i i+2
    106107    %endrep
    107 
     108%endif
     109       
    108110    mov     ds, di                  ; Restore DS
    109111    jmp     ax
     
    124126    pop     ax                      ; Pop return address
    125127
     128%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS       
    126129    %assign i DISPLAY_CONTEXT_size-2
    127130    %rep DISPLAY_CONTEXT_size / 2
     
    129132    %assign i i-2
    130133    %endrep
    131 
     134%endif
     135       
    132136    push    ax                      ; Push return address
    133137    push    dx
     
    226230    mov     [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fnCharOut], ax
    227231    ret
    228 
     232       
    229233
    230234;--------------------------------------------------------------------
     
    259263    ret
    260264
     265       
    261266;--------------------------------------------------------------------
    262267; DisplayContext_GetCharacterOutputParameterToDX
     
    286291;       Nothing
    287292;--------------------------------------------------------------------
     293%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    288294ALIGN JUMP_ALIGN
    289295DisplayContext_GetCharacterOffsetToAXfromByteOffsetInAX:
     
    292298    sar     ax, 1       ; BYTE count to WORD count
    293299    ret
    294 
     300%endif
     301
     302       
    295303;--------------------------------------------------------------------
    296304; DisplayContext_GetByteOffsetToAXfromCharacterOffsetInAX
     
    303311;       Nothing
    304312;--------------------------------------------------------------------
     313%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS       
    305314ALIGN JUMP_ALIGN
    306315DisplayContext_GetByteOffsetToAXfromCharacterOffsetInAX:
     
    311320ReturnOffsetInAX:
    312321    ret
     322%endif
  • trunk/Assembly_Library/Src/Display/DisplayFormatCompressed.asm

    r186 r194  
    7070%define DisplayFormatCompressed_Format_s DisplayFormat_ParseCharacters_FromAX
    7171
    72 DisplayFormatCompressed_Format_A:   
     72DisplayFormatCompressed_Format_A:
    7373    mov     [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.bAttribute], al
    7474DisplayFormatCompressed_ret:            ; jump target for other routines who need a "ret"
     
    8686    test    ax,ax                       ; if parameter equals zero, emit dash string instead
    8787    jz      DisplayFormat_ParseCharacters
    88 ;;; fall through
     88    ; fall through
    8989       
    9090DisplayFormatCompressed_Format_2_u:
    9191    mov     bh,2                        ; only two characters (instead of the default 5)
    92 ;;; fall through
     92    ; fall through
    9393       
    9494DisplayFormatCompressed_Format_u:
     
    150150;--------------------------------------------------------------------       
    151151
    152 DisplayFormatCompressed_BaseFormatOffset:   
    153        
    154 DisplayFormat_ParseCharacters_FromAX:   
     152DisplayFormatCompressed_BaseFormatOffset:
     153       
     154DisplayFormat_ParseCharacters_FromAX:
    155155    mov     si,ax
    156 ;;; Fall-through
     156    ; fall through to DisplayFormat_ParseCharacters
    157157
    158158ALIGN JUMP_ALIGN       
  • trunk/Assembly_Library/Src/Display/DisplayPage.asm

    r101 r194  
    1515;       AX, DX
    1616;--------------------------------------------------------------------
     17%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    1718ALIGN JUMP_ALIGN
    1819DisplayPage_SetFromAL:
     
    2122    mov     [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition], ax
    2223    ret
     24%endif
    2325
    2426
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r186 r194  
    151151;       AX, DX
    152152;--------------------------------------------------------------------
     153%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
     154       
    153155ALIGN JUMP_ALIGN
    154156DisplayPrint_CharacterBufferFromBXSIwithLengthInCX:
     
    170172.NothingToPrintSinceZeroLength:
    171173    ret
     174%endif
    172175
    173176
     
    328331    inc     bp                  ; we didn't need a parameter after all, readjust BP
    329332    inc     bp
    330 ;;; fall-through
     333    ; fall through to DisplayPrint_Newline
    331334%endif
    332335
  • trunk/Assembly_Library/Src/Menu/MenuBorders.asm

    r182 r194  
    6060;       AX, BX, CX, DX, SI, DI
    6161;--------------------------------------------------------------------
     62%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    6263ALIGN JUMP_ALIGN
    6364MenuBorders_RefreshItemBorders:
     
    6869    call    MenuBorders_GetNumberOfMiddleCharactersToDX
    6970    jmp     SHORT RefreshItemBorders
    70 
    71 
     71%endif
     72
     73       
    7274;--------------------------------------------------------------------
    7375; MenuBorders_AdjustDisplayContextForDrawingBorders
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r133 r194  
    1515;       AX, BX, CX, DX, SI, DI
    1616;--------------------------------------------------------------------
     17%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    1718ALIGN JUMP_ALIGN
    1819MenuText_ClearTitleArea:
     
    2021    call    PrepareToDrawTitleArea
    2122    mov     cl, [bp+MENUINIT.bTitleLines]
    22     jmp     SHORT ClearCLlinesOfText
    23 
     23    jmp     SHORT MenuText_ClearInformationArea.ClearCLlinesOfText
     24%endif
     25       
    2426ALIGN JUMP_ALIGN
    2527MenuText_ClearInformationArea:
     
    2729    call    MenuText_PrepareToDrawInformationArea
    2830    mov     cl, [bp+MENUINIT.bInfoLines]
    29 ClearCLlinesOfText:
     31.ClearCLlinesOfText:
    3032    mov     al, [bp+MENUINIT.bWidth]
    3133    sub     al, MENU_HORIZONTAL_BORDER_LINES+(MENU_TEXT_COLUMN_OFFSET/2)
  • trunk/Assembly_Library/Src/String/Char.asm

    r181 r194  
    8888;       Nothing
    8989;--------------------------------------------------------------------
     90%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    9091ALIGN JUMP_ALIGN
    9192Char_IsDecimalDigitInAL:
    9293    IS_BETWEEN_IMMEDIATES al, '0', '9'
    9394    ret
    94 
     95%endif
    9596
    9697;--------------------------------------------------------------------
  • trunk/Assembly_Library/Src/Util/Memory.asm

    r131 r194  
    116116;       AX
    117117;--------------------------------------------------------------------
     118%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    118119ALIGN JUMP_ALIGN
    119120Memory_ReserveCXbytesFromStackToDSSI:
     
    124125    mov     si, sp
    125126    jmp     ax
     127%endif
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuEvent.asm

    r190 r194  
    182182    shl     bl,1                ;  drive letter high order bit to CF, Item/Information bit to SF
    183183    jc      SHORT BootMenuPrint_HardDiskMenuitem
     184    ; fall through to BootMenuEvent_FallThroughToFloppyMenuitem
    184185       
    185186;;;
     
    189190ALIGN JUMP_ALIGN
    190191BootMenuEvent_FallThroughToFloppyMenuitem: 
    191 
     192    ; fall through to BootMenuPrint_FloppyMenuitem
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrint.asm

    r192 r194  
    3232    jmp     short BootMenuPrint_FormatCSSIfromParamsInSSBP
    3333
     34%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    3435%if BootMenuPrint_FloppyMenuitem <> BootMenuEvent_FallThroughToFloppyMenuitem
    3536%error "BootMenuPrint.asm must follow BootMenuEvent.asm, and BootMenuPrint_FloppyMenuitem must be the first routine in BootMenuPrint.asm"
    3637%endif
    37 
     38%endif
    3839       
    3940;--------------------------------------------------------------------
     
    174175    db      2880  / FloppyTypes.rgbCapacityMultiplier    ;  type 6
    175176
     177%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    176178%if g_szFddFiveQuarter <> g_szFddThreeHalf+g_szFddThreeFive_Displacement
    177179%error "FddThreeFive_Displacement incorrect"
     180%endif
    178181%endif
    179182       
     
    225228    cmp     bl, FLOPPY_TYPE_525_HD
    226229    ja      .ThreeHalf
     230%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    227231%if g_szFddThreeFive_Displacement = 2       
    228232    inc     ax                      ; compressed string case
     
    230234%else
    231235    add     ax, g_szFddThreeFive_Displacement
     236%endif
    232237%endif
    233238.ThreeHalf:     
  • trunk/XTIDE_Universal_BIOS/Src/Boot/BootMenuPrintCfg.asm

    r193 r194  
    2626    eMOVZX  ax, BYTE [di+DPT.bIdevarsOffset]
    2727    xchg    si, ax                      ; CS:SI now points to IDEVARS
    28     ; Fall to PushAndFormatCfgString
     28    ; Fall to .PushAndFormatCfgString
    2929
    3030;--------------------------------------------------------------------
     
    3838;       AX, DX, SI, DI
    3939;--------------------------------------------------------------------
    40 PushAndFormatCfgString:
     40.PushAndFormatCfgString:
    4141    push    bp
    4242    mov     bp, sp
     
    5353;       AX, BX
    5454;--------------------------------------------------------------------
    55 PushAddressingMode:
     55.PushAddressingMode:
    5656    CustomDPT_GetUnshiftedAddressModeToALZF
    5757    ;;
     
    7676;       AX
    7777;--------------------------------------------------------------------
    78 PushBlockMode:
     78.PushBlockMode:
    7979    mov     ax, 1
    8080    test    BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED
     
    9494;       AX, DX
    9595;--------------------------------------------------------------------
    96 ;PushBusType:
     96.PushBusType:
    9797    mov     al,g_szBusTypeValues_Displacement
    9898    mul     BYTE [cs:si+IDEVARS.bDevice]
     
    113113;       AX, DX
    114114;--------------------------------------------------------------------
    115 PushIRQ:
     115.PushIRQ:
    116116    eMOVZX  ax, BYTE [cs:si+IDEVARS.bIRQ]
    117117    push    ax
     
    127127;       AX
    128128;--------------------------------------------------------------------
    129 PushResetStatus:
     129.PushResetStatus:
    130130    mov     al, [di+DPT.bFlagsHigh]
    131131    and     ax, MASKH_DPT_RESET
     
    141141;       AX, SI, DI
    142142;--------------------------------------------------------------------
    143 PrintValuesFromStack:
     143.PrintValuesFromStack:
    144144    mov     si, g_szCfgFormat
    145145    jmp     BootPrint_BootMenuPrint_FormatCSSIfromParamsInSSBP_Relay
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Address.asm

    r193 r194  
    8585ALIGN JUMP_ALIGN
    8686Address_OldInt13hAddressToIdeAddress:
    87     call    Address_ExtractLCHSparametersFromOldInt13hAddress
     87        call    Address_ExtractLCHSparametersFromOldInt13hAddress
     88           
     89        CustomDPT_GetUnshiftedAddressModeToALZF
    8890       
    89     CustomDPT_GetUnshiftedAddressModeToALZF
    90     jz      DoNotConvertLCHS    ; 0, ADDR_DPT_LCHS
     91;;; 0: ADDR_DPT_LCHS       
     92        jz      DoNotConvertLCHS   
    9193       
    92     ;;
    93     ;; Since we are only checking for zero, we can do our math in the high order bits,
    94     ;; in this case effectively subtracting 1 from the address mode.
    95     ;;
    96     sub     al,(1<<ADDRESSING_MODE_FIELD_POSITION)
    97     jz      ConvertLCHStoPCHS   ; 1, ADDR_DPT_PCHS
    98        
    99 ;; Fall-through                 ; 2, ADDR_DPT_LBA28 and 3, ADDR_DPT_LBA48
     94;;; 1: ADDR_DPT_PCHS
     95        ;
     96        ; Since we are only checking for zero, we can do our math in the high order bits,
     97        ; in this case effectively subtracting 1 from the address mode.
     98        ;
     99        sub     al,(1<<ADDRESSING_MODE_FIELD_POSITION)
     100        jz      ConvertLCHStoPCHS   
     101
     102;;; 2: ADDR_DPT_LBA28 and 3: ADDR_DPT_LBA48             
     103        ; Fall through to ConvertLCHStoLBARegisterValues 
    100104       
    101105;---------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r158 r194  
    1717;       Nothing
    1818;--------------------------------------------------------------------
    19 Initialize_FromMainBiosRomSearch:
     19Initialize_FromMainBiosRomSearch:             ; unused entrypoint ok
    2020    pushf
    2121    push    es
  • trunk/XTIDE_Universal_BIOS/Src/Strings.asm

    r189 r194  
    5151; Ensure that addressing modes are correctly spaced in memory
    5252;
     53%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS       
    5354%if g_szLCHS <> g_szAddressingModes
    5455%error "g_szAddressingModes Displacement Incorrect 1"
     
    6263%if g_szLBA48 <> g_szLBA28 + g_szAddressingModes_Displacement       
    6364%error "g_szAddressingModes Displacement Incorrect 4"
    64 %endif             
     65%endif
     66%endif     
    6567       
    6668g_szFddUnknown: db  "%sUnknown",NULL
     
    8385; Ensure that bus type strings are correctly spaced in memory
    8486;
     87%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS               
    8588%if g_szBusTypeValues_8Dual <> g_szBusTypeValues
    8689%error "g_szBusTypeValues Displacement Incorrect 1"
     
    100103%if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
    101104%error "g_szBusTypeValues Displacement Incorrect 6"             
    102 %endif             
     105%endif
     106%endif
    103107       
    104108g_szSelectionTimeout:   db      DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2-u s",NULL
  • trunk/XTIDE_Universal_BIOS/Src/StringsCompress.pl

    r189 r194  
    203203# Ensure that branch targets are within reach
    204204#
     205print "%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS\n";
    205206for( $t = $format_begin; $format_index[$t]; $t++ )
    206207{
     
    209210    print "%endif\n";
    210211}
     212print "%endif\n";
    211213
    212214#--------------------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm

    r189 r194  
    137137; Ensure that addressing modes are correctly spaced in memory
    138138;
     139%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS       
    139140%if g_szLCHS <> g_szAddressingModes
    140141%error "g_szAddressingModes Displacement Incorrect 1"
     
    148149%if g_szLBA48 <> g_szLBA28 + g_szAddressingModes_Displacement       
    149150%error "g_szAddressingModes Displacement Incorrect 4"
    150 %endif             
     151%endif
     152%endif     
    151153
    152154g_szFddUnknown: ; db    "%sUnknown",NULL
     
    202204; Ensure that bus type strings are correctly spaced in memory
    203205;
     206%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS               
    204207%if g_szBusTypeValues_8Dual <> g_szBusTypeValues
    205208%error "g_szBusTypeValues Displacement Incorrect 1"
     
    219222%if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
    220223%error "g_szBusTypeValues Displacement Incorrect 6"             
    221 %endif             
     224%endif
     225%endif
    222226
    223227g_szSelectionTimeout:   ; db        DOUBLE_BOTTOM_LEFT_CORNER,DOUBLE_LEFT_HORIZONTAL_TO_SINGLE_VERTICAL,"%ASelection in %2-u s",NULL
     
    268272        db     (DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_A)    ; 29
    269273
     274%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
    270275%if DisplayFormatCompressed_BaseFormatOffset < DisplayFormatCompressed_Format_s || DisplayFormatCompressed_BaseFormatOffset - DisplayFormatCompressed_Format_s > 255
    271276%error "DisplayFormatCompressed_Format_s is out of range of DisplayFormatCompressed_BaseFormatOffset"
     
    298303%error "DisplayFormatCompressed_Format_A is out of range of DisplayFormatCompressed_BaseFormatOffset"
    299304%endif
     305%endif
    300306
    301307;; translated usage stats
     
    304310;; format usage stats
    305311;; A:4
    306 ;; c:6
    307 ;; s:14
    308312;; 2-u:1
    309 ;; u:5
    310313;; 5-u:3
    311 ;; 2-I:1
    312314;; x:6
    313315;; 5-x:1
     316;; s:14
    314317;; nl:6
     318;; 2-I:1
     319;; c:6
     320;; u:5
    315321;; total format: 10
    316322
  • trunk/XTIDE_Universal_BIOS/makefile

    r188 r194  
    145145
    146146$(SRC_ASM):     src\StringsCompressed.asm
     147
     148xt_unused:  xt
     149    $(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS
     150    perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm
     151
Note: See TracChangeset for help on using the changeset viewer.