Changeset 133 in xtideuniversalbios


Ignore:
Timestamp:
Mar 12, 2011, 1:48:48 PM (14 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Size optimizations in various files in the Assembly Library. Also a very small change to a string in XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Inc/Display.inc

    r91 r133  
    3737    .InitializeDisplayContext                       resb    2
    3838
     39%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    3940    .SetCharacterPointerFromBXAX                    resb    2
     41%endif
    4042    .SetCharOutputFunctionFromAXwithAttribFlagInBL  resb    2
    4143    .SetCharacterOutputParameterFromAX              resb    2
     
    4648    .SynchronizeDisplayContextToHardware            resb    2
    4749
     50%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    4851    .GetCharacterPointerToBXAX                      resb    2
     52%endif
    4953    .GetSoftwareCoordinatesToAX                     resb    2
    5054    .GetColumnsToALandRowsToAH                      resb    2
  • trunk/Assembly_Library/Src/Display/Display.asm

    r101 r133  
    6363    at  DISPLAY_LIB.InitializeDisplayContext,                       dw  DisplayContext_Initialize
    6464
     65%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    6566    at  DISPLAY_LIB.SetCharacterPointerFromBXAX,                    dw  DisplayContext_SetCharacterPointerFromBXAX
     67%endif
    6668    at  DISPLAY_LIB.SetCharOutputFunctionFromAXwithAttribFlagInBL,  dw  DisplayContext_SetCharOutputFunctionFromAXwithAttribFlagInBL
    6769    at  DISPLAY_LIB.SetCharacterOutputParameterFromAX,              dw  DisplayContext_SetCharacterOutputParameterFromAX
     
    7274    at  DISPLAY_LIB.SynchronizeDisplayContextToHardware,            dw  DisplayContext_SynchronizeToHardware
    7375
     76%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    7477    at  DISPLAY_LIB.GetCharacterPointerToBXAX,                      dw  DisplayContext_GetCharacterPointerToBXAX
     78%endif
    7579    at  DISPLAY_LIB.GetSoftwareCoordinatesToAX,                     dw  DisplayCursor_GetSoftwareCoordinatesToAX
    7680    at  DISPLAY_LIB.GetColumnsToALandRowsToAH,                      dw  DisplayPage_GetColumnsToALandRowsToAH
  • trunk/Assembly_Library/Src/Display/DisplayContext.asm

    r115 r133  
    148148;       AX, DI
    149149;--------------------------------------------------------------------
     150%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    150151ALIGN JUMP_ALIGN
    151152DisplayContext_PrepareOffScreenBufferInESBXwithLengthInCX:
     
    165166    pop     ds
    166167    ret
     168%endif
    167169
    168170
     
    177179;       AX
    178180;--------------------------------------------------------------------
     181%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    179182ALIGN JUMP_ALIGN
    180183DisplayContext_SetCharacterPointerFromBXAX:
     
    184187    mov     es, bx
    185188    ret
     189%endif
    186190
    187191
     
    195199;       Nothing
    196200;--------------------------------------------------------------------
     201%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    197202ALIGN JUMP_ALIGN
    198203DisplayContext_GetCharacterPointerToBXAX:
     
    200205    mov     bx, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.fpCursorPosition+2]
    201206    ret
     207%endif
    202208
    203209
     
    261267;   Corrupts registers:
    262268;       Nothing
    263 ;--------------------------------------------------------------------   
     269;--------------------------------------------------------------------
     270%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; This appears to be completely unused
    264271ALIGN JUMP_ALIGN
    265272DisplayContext_GetCharacterOutputParameterToDX:
    266273    mov     dx, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
    267274    ret
     275%endif
    268276
    269277
     
    277285;   Corrupts registers:
    278286;       Nothing
    279 ;--------------------------------------------------------------------   
     287;--------------------------------------------------------------------
    280288ALIGN JUMP_ALIGN
    281289DisplayContext_GetCharacterOffsetToAXfromByteOffsetInAX:
     
    294302;   Corrupts registers:
    295303;       Nothing
    296 ;--------------------------------------------------------------------   
     304;--------------------------------------------------------------------
    297305ALIGN JUMP_ALIGN
    298306DisplayContext_GetByteOffsetToAXfromCharacterOffsetInAX:
  • trunk/Assembly_Library/Src/File/Drive.asm

    r41 r133  
    1 ; File name     :   Drive.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   1.9.2010
    4 ; Last update   :   3.9.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Functions for accessing drives.
    73
     
    5248    xor     bx, bx
    5349    xor     ax, ax              ; Temporary use BX:AX for flags
    54     xor     dx, dx              ; Start from drive 0
     50    cwd                         ; Start from drive 0
    5551    call    .CheckDriveValidityUntilCXisZero
    5652    mov     dx, bx              ; Flags now in DX:AX
     
    163159Drive_GetDefaultToAL:
    164160    mov     ah, GET_CURRENT_DEFAULT_DRIVE
    165     int     DOS_INTERRUPT_21h
    166     ret
     161    SKIP2B  f   ; cmp ax, <next instruction>
     162    ; Fall to Drive_SetDefaultFromDL
    167163
    168164
     
    176172;       AH
    177173;--------------------------------------------------------------------
    178 ALIGN JUMP_ALIGN
    179174Drive_SetDefaultFromDL:
    180175    mov     ah, SELECT_DEFAULT_DRIVE
    181176    int     DOS_INTERRUPT_21h
    182177    ret
    183    
  • trunk/Assembly_Library/Src/File/FileIO.asm

    r105 r133  
    2525    xchg    si, dx
    2626    mov     bx, ax      ; Copy file handle to BX
    27     ret
    28 
    29 
    30 ;--------------------------------------------------------------------
    31 ; FileIO_CloseUsingHandleFromBX
    32 ;   Parameters:
    33 ;       BX:     File handle
    34 ;   Returns:
    35 ;       AX:     DOS error code if CF set
    36 ;       CF:     Clear if file closed successfully
    37 ;               Set if error
    38 ;   Corrupts registers:
    39 ;       AX
    40 ;--------------------------------------------------------------------
    41 ALIGN JUMP_ALIGN
    42 FileIO_CloseUsingHandleFromBX:
    43     mov     ah, CLOSE_FILE
    44     int     DOS_INTERRUPT_21h
    4527    ret
    4628
     
    7052; File position is updated so next read will start where
    7153; previous read stopped.
    72 ; 
     54;
    7355; FileIO_ReadCXbytesToDSSIusingHandleFromBX
    7456;   Parameters:
     
    11799; File position is updated so next write will start where
    118100; previous write stopped.
    119 ; 
     101;
    120102; FileIO_WriteCXbytesFromDSSIusingHandleFromBX:
    121103;   Parameters:
     
    249231
    250232;--------------------------------------------------------------------
     233; FileIO_CloseUsingHandleFromBX
     234;   Parameters:
     235;       BX:     File handle
     236;   Returns:
     237;       AX:     DOS error code if CF set
     238;       CF:     Clear if file closed successfully
     239;               Set if error
     240;   Corrupts registers:
     241;       AX
     242;--------------------------------------------------------------------
     243ALIGN JUMP_ALIGN
     244FileIO_CloseUsingHandleFromBX:
     245    mov     ah, CLOSE_FILE
     246    SKIP2B  f   ; cmp ax, <next instruction>
     247    ; Fall to FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX
     248
     249
     250;--------------------------------------------------------------------
    251251; FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX:
    252252;   Parameters:
     
    262262;       Nothing
    263263;--------------------------------------------------------------------
    264 ALIGN JUMP_ALIGN
    265264FileIO_SeekFromOriginInALtoOffsetInDXAXusingHandleFromBX:
    266265    mov     ah, SET_CURRENT_FILE_POSITION
  • trunk/Assembly_Library/Src/Keyboard/Keyboard.asm

    r131 r133  
    1010; Reads user inputted word.
    1111; Function returns when ENTER or ESC will be pressed.
    12 ; 
     12;
    1313; Keyboard_ReadUserInputtedWordWhilePrinting
    1414;   Parameters
     
    5151; supported to ignore unwanted characters.
    5252; Function returns when ENTER or ESC will be pressed.
    53 ; 
     53;
    5454; Keyboard_ReadUserInputtedStringToESDIWhilePrinting
    5555;   Parameters:
     
    249249;       AX
    250250;--------------------------------------------------------------------
     251%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; Only used when debugging
    251252ALIGN JUMP_ALIGN
    252253Keyboard_RemoveAllKeystrokesFromBuffer:
     
    254255    jnz     SHORT Keyboard_RemoveAllKeystrokesFromBuffer
    255256    ret
     257%endif
    256258
    257259
     
    271273;--------------------------------------------------------------------
    272274ALIGN JUMP_ALIGN
    273 Keyboard_GetKeystrokeToAX:
    274     call    Keyboard_GetKeystrokeToAXandLeaveItToBuffer
    275     jnz     SHORT Keyboard_GetKeystrokeToAXandWaitIfNecessary
    276     ret
    277 ALIGN JUMP_ALIGN
    278275Keyboard_GetKeystrokeToAXandLeaveItToBuffer:
    279276    mov     ah, CHECK_FOR_KEYSTROKE
    280277    int     BIOS_KEYBOARD_INTERRUPT_16h
    281278    ret
     279ALIGN JUMP_ALIGN
     280Keyboard_GetKeystrokeToAX:
     281    call    Keyboard_GetKeystrokeToAXandLeaveItToBuffer
     282    jz      SHORT Keyboard_GetKeystrokeToAXReturn
     283    ; Fall to Keyboard_GetKeystrokeToAXandWaitIfNecessary
    282284ALIGN JUMP_ALIGN
    283285Keyboard_GetKeystrokeToAXandWaitIfNecessary:
     
    285287    int     BIOS_KEYBOARD_INTERRUPT_16h
    286288    test    ax, ax                      ; Clear ZF
    287     ret
     289Keyboard_GetKeystrokeToAXReturn:
     290    ret
  • trunk/Assembly_Library/Src/Menu/Dialog/ItemLineSplitter.asm

    r52 r133  
    1 ; File name     :   ItemLineSplitter.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   12.10.2010
    4 ; Last update   :   12.10.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Functions for splitting strings to item lines.
    73
     
    130126
    131127    inc     bx                  ; Increment line
    132     xor     cx, cx              ; Zero character counter
     128    xor     cx, cx              ; Zero character counter (and clear CF)
    133129    mov     si, di              ; Start from complete word
    134130    mov     [bp+ITEM_LINE_SPLITTER.wStartOfLine], di
    135     clc
    136131    ret
    137132
  • trunk/Assembly_Library/Src/Menu/MenuEvent.asm

    r104 r133  
    2121    pop     ds
    2222    mov     si, bp
    23     mov     bx, MENUEVENT.InitializeMenuinitFromDSSI
     23    mov     bl, MENUEVENT.InitializeMenuinitFromDSSI
    2424    jmp     SHORT MenuEvent_SendFromBX
    2525
     
    3737ALIGN JUMP_ALIGN
    3838MenuEvent_ExitMenu:
    39     mov     bx, MENUEVENT.ExitMenu
     39    mov     bl, MENUEVENT.ExitMenu
    4040    jmp     SHORT MenuEvent_SendFromBX
    4141
     
    5353ALIGN JUMP_ALIGN
    5454MenuEvent_IdleProcessing:
    55     mov     bx, MENUEVENT.IdleProcessing
     55    mov     bl, MENUEVENT.IdleProcessing
    5656    jmp     SHORT MenuEvent_SendFromBX
    5757
     
    7171ALIGN JUMP_ALIGN
    7272MenuEvent_RefreshTitle:
    73     mov     bx, MENUEVENT.RefreshTitle
    74     jmp     SHORT LoadHighlightedItemToCXandSendMessageFromBX
     73    mov     bl, MENUEVENT.RefreshTitle
     74    SKIP2B  cx  ; mov cx, <next instruction>
    7575
    76 ALIGN JUMP_ALIGN
    7776MenuEvent_RefreshInformation:
    78     mov     bx, MENUEVENT.RefreshInformation
    79 LoadHighlightedItemToCXandSendMessageFromBX:
     77    mov     bl, MENUEVENT.RefreshInformation
    8078    mov     cx, [bp+MENUINIT.wHighlightedItem]
    8179    jmp     SHORT MenuEvent_SendFromBX
     
    9694ALIGN JUMP_ALIGN
    9795MenuEvent_RefreshItemFromCX:
    98     mov     bx, MENUEVENT.RefreshItemFromCX
     96    mov     bl, MENUEVENT.RefreshItemFromCX
    9997    jmp     SHORT MenuEvent_SendFromBX
    10098
     
    116114    push    dx
    117115
    118     mov     bx, MENUEVENT.ItemHighlightedFromCX
     116    mov     bl, MENUEVENT.ItemHighlightedFromCX
    119117    call    MenuEvent_SendFromBX
    120118
     
    139137ALIGN JUMP_ALIGN
    140138MenuEvent_KeyStrokeInAX:
    141     mov     bx, MENUEVENT.KeyStrokeInAX
    142     jmp     SHORT MenuEvent_SendFromBX
     139    mov     bl, MENUEVENT.KeyStrokeInAX
     140    SKIP2B  dx  ; mov dx, <next instruction>
    143141
    144142
     
    154152;       AX, BX, DX
    155153;--------------------------------------------------------------------
    156 ALIGN JUMP_ALIGN
    157154MenuEvent_ItemSelectedFromCX:
    158     mov     bx, MENUEVENT.ItemSelectedFromCX
    159     jmp     SHORT MenuEvent_SendFromBX
     155    mov     bl, MENUEVENT.ItemSelectedFromCX
     156    ; Fall to MenuEvent_SendFromBX
    160157
    161158
     
    163160; MenuEvent_SendFromBX
    164161;   Parameters
    165 ;       BX:                 Menu event to send
     162;       BL:                 Menu event to send
    166163;       SS:BP:              Ptr to MENU
    167164;       Other registers:    Event specific parameters
     
    180177    push    si
    181178    push    cx
     179    xor     bh, bh
    182180    call    [bp+MENU.fnEventHandler]
    183181    pop     cx
  • trunk/Assembly_Library/Src/Menu/MenuInit.asm

    r129 r133  
    5757    CALL_DISPLAY_LIBRARY SetCursorShapeFromAX
    5858    call    MenuEvent_InitializeMenuinit    ; User initialization
     59%ifndef USE_186
    5960    call    MenuInit_RefreshMenuWindow
    6061    jmp     MenuLoop_Enter
     62%else
     63    push    MenuLoop_Enter
     64    ; Fall to MenuInit_RefreshMenuWindow
     65%endif
    6166
    6267
     
    117122;       Nothing
    118123;--------------------------------------------------------------------
     124%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    119125ALIGN JUMP_ALIGN
    120126MenuInit_GetHighlightedItemToAX:
    121127    mov     ax, [bp+MENUINIT.wHighlightedItem]
    122128    ret
     129%endif
    123130
    124131
     
    135142;       Nothing
    136143;--------------------------------------------------------------------
     144%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    137145ALIGN JUMP_ALIGN
    138146MenuInit_SetTitleHeightFromAL:
     
    149157    mov     [bp+MENUINIT.wItems], ax
    150158    ret
     159%endif
    151160
    152161
     
    162171;       Nothing
    163172;--------------------------------------------------------------------
     173%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    164174ALIGN JUMP_ALIGN
    165175MenuInit_SetUserDataFromDSSI:
     
    172182    lds     si, [bp+MENU.dwUserData]
    173183    ret
     184%endif
  • trunk/Assembly_Library/Src/Menu/MenuLoop.asm

    r105 r133  
    5656;       SS:BP:  Ptr to MENU
    5757;   Returns:
    58 ;       Nothing 
     58;       Nothing
    5959;   Corrupts registers:
    6060;       AX, BX, CX, DX, SI, DI
     
    9292    test    BYTE [bp+MENU.bFlags], FLG_MENU_USER_HANDLES_SCROLLING
    9393    jz      SHORT MenuLoop_ProcessScrollingKeysFromAX
    94     clc     ; Clear CF since keystroke not processed
    95     ret
     94    ret     ; Return with CF cleared since keystroke not processed
    9695
    9796ALIGN JUMP_ALIGN
  • trunk/Assembly_Library/Src/Menu/MenuScrollbars.asm

    r105 r133  
    5959;   Corrupts registers:
    6060;       CX, DX
    61 ;--------------------------------------------------------------------   
     61;--------------------------------------------------------------------
    6262ALIGN JUMP_ALIGN
    6363.GetLastThumbLineToAX:
     
    161161.RotateItemInCX:
    162162    mov     dx, [bp+MENUINIT.wItems]
    163     cmp     cx, BYTE 0
    164     jl      SHORT .RotateNegativeItemInCX
     163    test    cx, cx
     164    js      SHORT .RotateNegativeItemInCX
    165165    cmp     cx, dx
    166166    jae     SHORT .RotatePositiveItemInCX
     
    193193ALIGN JUMP_ALIGN
    194194MenuScrollbars_IsItemInCXonVisiblePage:
    195     cmp     cx, [bp+MENU.wFirstVisibleItem]
    196     jb      SHORT .ItemIsNotVisible
     195    cmp     [bp+MENU.wFirstVisibleItem], cx
     196    ja      SHORT .ItemIsNotVisible
    197197
    198198    call    MenuScrollbars_GetLastVisibleItemOnPageToAX
     
    200200    ja      SHORT .ItemIsNotVisible
    201201    stc     ; Item is visible
    202     ret
    203 ALIGN JUMP_ALIGN
     202ALIGN JUMP_ALIGN, ret
    204203.ItemIsNotVisible:
    205     clc
    206204    ret
    207205
  • trunk/Assembly_Library/Src/Menu/MenuText.asm

    r125 r133  
    155155    call    MenuLocation_GetTextCoordinatesToAXforItemInAX
    156156    mov     dx, MenuCharOut_MenuTeletypeOutput
    157     ; Fall to AdjustDisplayContextForDrawingTextsAtCoordinatesInAXwithAttributeTypeInSI
     157    ; Fall to AdjustDisplayContextForDrawingTextsAtCoordsInAXwithAttrTypeInSIandCharOutFunctionInDX
    158158
    159159;--------------------------------------------------------------------
  • trunk/Assembly_Library/Src/Menu/MenuTime.asm

    r105 r133  
    9797    xchg    dx, ax
    9898    call    TimerTicks_GetSecondsToAXfromTicksInDX
    99     jmp     SHORT .PopRegistersAndReturn
     99    SKIP2B  f   ; cmp ax, <next instruction>
    100100.TimeoutHasOccurredSoMakeSureTicksAreNotBelowZero:
    101101    xor     ax, ax
    102 .PopRegistersAndReturn:
     102
    103103    pop     bx
    104104    pop     cx
  • trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm

    r109 r133  
    112112g_szItemIdeIRQ:         db  "IRQ",NULL
    113113
    114 g_szDlgBusType:         db  "Select type of bus where Ide Controller is connected.",NULL
     114g_szDlgBusType:         db  "Select type of bus where IDE Controller is connected.",NULL
    115115g_szDlgIdeCmdPort:      db  "Enter IDE command block (base port) address.",NULL
    116116g_szDlgIdeCtrlPort:     db  "Enter IDE control block address (usually command block + 200h).",NULL
Note: See TracChangeset for help on using the changeset viewer.