Changeset 162 in xtideuniversalbios for trunk/Assembly_Library/Src/String


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/String
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • 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.