Changeset 162 in xtideuniversalbios for trunk/Assembly_Library/Src


Ignore:
Timestamp:
May 28, 2011, 7:34:42 PM (14 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes to all parts of the project:

  • Size optimizations, mostly by excluding code from the BIOS.
  • Cleaned the source a bit, fixed spelling and grammar mistakes.
Location:
trunk/Assembly_Library/Src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/AssemblyLibrary.asm

    r139 r162  
    6060    %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    6161        %include "String.asm"
     62        %include "StringProcess.asm"
    6263    %endif
    63     %include "StringProcess.asm"
    6464%endif
    6565
  • trunk/Assembly_Library/Src/Display/CgaSnow.asm

    r101 r162  
    3131
    3232
    33 ; CGA snow preventing must be kept optional so unnecerrasy overhead
    34 ; can be prevented when building program ment for non-CGA systems.
     33; CGA snow prevention must be kept optional to avoid unnecessary
     34; overhead when building programs meant for non-CGA systems.
    3535%ifdef ELIMINATE_CGA_SNOW
    3636
     
    7474.StoswWithoutWaitSinceUnknownPort:
    7575    stosw
     76    sti
    7677    pop     bx
    77     sti
    7878    ret
    7979
  • trunk/Assembly_Library/Src/Display/DisplayContext.asm

    r133 r162  
    268268;       Nothing
    269269;--------------------------------------------------------------------
    270 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS   ; This appears to be completely unused
    271 ALIGN JUMP_ALIGN
    272 DisplayContext_GetCharacterOutputParameterToDX:
    273     mov     dx, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
    274     ret
    275 %endif
     270;%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS  ; This appears to be completely unused
     271;ALIGN JUMP_ALIGN
     272;DisplayContext_GetCharacterOutputParameterToDX:
     273;   mov     dx, [VIDEO_BDA.displayContext+DISPLAY_CONTEXT.wCharOutParam]
     274;   ret
     275;%endif
    276276
    277277
  • trunk/Assembly_Library/Src/Display/DisplayPrint.asm

    r134 r162  
    2525;   For example %8-d would prepend integer with spaces so that at least
    2626;   8 characters would be printed.
    27 ; 
     27;
    2828; DisplayPrint_FormattedNullTerminatedStringFromCSSI
    2929;   Parameters:
     
    158158    loop    .PrintNextCharacter
    159159
    160     LOAD_BDA_SEGMENT_TO ds, dx
     160    mov     ds, cx  ; Restore DS to BDA. Not needed unless DisplayPrint_CharacterFromAL changes DS.
    161161    pop     cx
    162162    pop     si
  • trunk/Assembly_Library/Src/Menu/Dialog/Dialog.asm

    r60 r162  
    1 ; File name     :   Dialog.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   6.8.2010
    4 ; Last update   :   22.11.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Common functions for many dialogs.
    73
     
    235231    call    MenuLocation_GetTitleBordersTopLeftCoordinatesToAX
    236232    cmp     ah, dh      ; Dialog taller than parent?
    237     jb      SHORT .RedrawDialogAreaAndWholeParentWindow
    238     jmp     SHORT .RedrawWholeParentWindow
    239 
    240 ;--------------------------------------------------------------------
    241 ; .GetParentTitleBorderCoordinatesToDX
    242 ;   Parameters:
    243 ;       SS:SI:  Ptr to parent MENU
    244 ;       SS:BP:  Ptr to DIALOG
    245 ;   Returns:
    246 ;       DL:     Parent border column (X)
    247 ;       DH:     Parent border row (Y)
    248 ;   Corrupts:
    249 ;       AX
    250 ;--------------------------------------------------------------------
    251 ALIGN JUMP_ALIGN
    252 .GetParentTitleBorderCoordinatesToDX:
    253     xchg    si, bp
    254     call    MenuLocation_GetTitleBordersTopLeftCoordinatesToAX
    255     xchg    bp, si
    256     xchg    dx, ax
    257     ret
     233    jnb     SHORT .RedrawWholeParentWindow
     234    ; Fall to .RedrawDialogAreaAndWholeParentWindow
    258235
    259236;--------------------------------------------------------------------
     
    268245;       AX, BX, CX, DX, SI, DI
    269246;--------------------------------------------------------------------
    270 ALIGN JUMP_ALIGN
    271247.RedrawDialogAreaAndWholeParentWindow:
    272248    push    si
     
    286262    pop     bp
    287263    ret
     264
     265;--------------------------------------------------------------------
     266; .GetParentTitleBorderCoordinatesToDX
     267;   Parameters:
     268;       SS:SI:  Ptr to parent MENU
     269;       SS:BP:  Ptr to DIALOG
     270;   Returns:
     271;       DL:     Parent border column (X)
     272;       DH:     Parent border row (Y)
     273;   Corrupts:
     274;       AX
     275;--------------------------------------------------------------------
     276ALIGN JUMP_ALIGN
     277.GetParentTitleBorderCoordinatesToDX:
     278    xchg    si, bp
     279    call    MenuLocation_GetTitleBordersTopLeftCoordinatesToAX
     280    xchg    bp, si
     281    xchg    dx, ax
     282    ret
  • trunk/Assembly_Library/Src/String/Char.asm

    r145 r162  
    1 ; File name     :   Char.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   28.6.2010
    4 ; Last update   :   7.9.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Functions for handling characters.
    73
     
    1814;   Returns:
    1915;       CF:     Set if character is range
    20 ;               (Jumps to CharIsNotValid if before range)
     16;               (Jumps to Char_CharIsNotValid if before range)
    2117;   Corrupts registers:
    2218;       Nothing
     
    2420%macro IS_BETWEEN_IMMEDIATES 3
    2521    cmp     %1, %2
    26     jb      SHORT CharIsNotValid
     22    jb      SHORT Char_CharIsNotValid
    2723    cmp     %1, (%3)+1              ; Set CF if %1 is lesser
    2824%endmacro
     
    5450;       Nothing
    5551;--------------------------------------------------------------------
     52%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    5653ALIGN JUMP_ALIGN
    5754Char_IsUpperCaseLetterInAL:
    5855    IS_BETWEEN_IMMEDIATES al, 'A', 'Z'
    5956    ret
     57%endif
    6058
    6159;--------------------------------------------------------------------
     
    7068;       Nothing
    7169;--------------------------------------------------------------------
     70%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    7271ALIGN JUMP_ALIGN
    7372Char_IsHexadecimalDigitInAL:
     
    7776    IS_BETWEEN_IMMEDIATES al, 'a', 'f'
    7877    ret
     78%endif
    7979
    8080;--------------------------------------------------------------------
     
    106106;       Nothing
    107107;--------------------------------------------------------------------
     108%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    108109ALIGN JUMP_ALIGN
    109110Char_ConvertIntegerToALfromDigitInALwithBaseInBX:
     
    112113    call    dx                      ; Converts to lower case
    113114    pop     dx
    114     jnc     SHORT CharIsNotValid
     115    jnc     SHORT Char_CharIsNotValid
    115116
    116117    cmp     al, '9'                 ; Decimal digit
     
    120121.ConvertToDecimalDigit:
    121122    sub     al, '0'                 ; Convert to decimal integer
    122     ; Fall to CharIsValid
    123 
    124 ;--------------------------------------------------------------------
    125 ; CharIsValid
    126 ; CharIsNotValid
    127 ;   Parameters:
    128 ;       Nothing
    129 ;   Returns:
    130 ;       CF:     Set for CharIsValid
    131 ;               Cleared for CharIsNotValid
    132 ;   Corrupts registers:
    133 ;       Nothing
    134 ;--------------------------------------------------------------------
     123    ; Fall to Char_CharIsValid
     124%endif
     125
     126;--------------------------------------------------------------------
     127; Char_CharIsValid
     128; Char_CharIsNotValid
     129;   Parameters:
     130;       Nothing
     131;   Returns:
     132;       CF:     Set for Char_CharIsValid
     133;               Cleared for Char_CharIsNotValid
     134;   Corrupts registers:
     135;       Nothing
     136;--------------------------------------------------------------------
     137%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    135138ALIGN JUMP_ALIGN
    136139Char_CharIsValid:
    137140    stc
    138141    ret
    139 
    140 ALIGN JUMP_ALIGN
    141 CharIsNotValid:
     142%endif
     143
     144ALIGN JUMP_ALIGN
     145Char_CharIsNotValid:
    142146    clc
    143147    ret
     
    153157;       Nothing
    154158;--------------------------------------------------------------------
     159%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    155160ALIGN JUMP_ALIGN
    156161Char_ALtoLowerCaseLetter:
     
    160165.Return:
    161166    ret
     167%endif
    162168
    163169;--------------------------------------------------------------------
     
    188194;       Nothing
    189195;--------------------------------------------------------------------
     196%ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS
    190197ALIGN JUMP_ALIGN
    191198Char_GetFilterFunctionToDXforNumericBaseInBX:
     
    193200    cmp     bl, 10
    194201    je      SHORT .Return
    195     sub     dx, BYTE Char_IsDecimalDigitInAL - Char_IsHexadecimalDigitInAL
     202    mov     dx, Char_IsHexadecimalDigitInAL
    196203.Return:
    197204    ret
     205%endif
  • trunk/Assembly_Library/Src/String/StringProcess.asm

    r67 r162  
    1 ; File name     :   StringProcess.asm
    21; Project name  :   Assembly Library
    3 ; Created date  :   12.10.2010
    4 ; Last update   :   7.12.2010
    5 ; Author        :   Tomi Tilli
    62; Description   :   Functions for processing characters in a string.
    73
     
    3329;       CX:     Number of characters processed
    3430;       CF:     Clear if all characters processed
    35 ;               Set if terminated by processing function               
     31;               Set if terminated by processing function
    3632;   Corrupts registers:
    3733;       Nothing (processing function can corrupt BX,DI,ES)
     
    9187StringProcess_ConvertToWordInDIWithBaseInBX:
    9288    call    Char_ConvertIntegerToALfromDigitInALwithBaseInBX
    93     jnc     SHORT .InvalidCharacter
     89    cmc
     90    jc      SHORT .InvalidCharacter
    9491    push    dx
    9592
     
    9996    jc      SHORT .Overflow
    10097    add     di, ax      ; Add old WORD to new integer
    101     jc      SHORT .Overflow
    10298
    103     pop     dx
    104     ret
    10599.Overflow:
    106100    pop     dx
    107101.InvalidCharacter:
    108     stc                 ; Set CF to stop processing
    109102    ret
Note: See TracChangeset for help on using the changeset viewer.