Changeset 162 in xtideuniversalbios for trunk/Assembly_Library/Src/String
- Timestamp:
- May 28, 2011, 7:34:42 PM (14 years ago)
- google:author:
- krille_n_@hotmail.com
- 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.asm2 1 ; Project name : Assembly Library 3 ; Created date : 28.6.20104 ; Last update : 7.9.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for handling characters. 7 3 … … 18 14 ; Returns: 19 15 ; CF: Set if character is range 20 ; (Jumps to Char IsNotValid if before range)16 ; (Jumps to Char_CharIsNotValid if before range) 21 17 ; Corrupts registers: 22 18 ; Nothing … … 24 20 %macro IS_BETWEEN_IMMEDIATES 3 25 21 cmp %1, %2 26 jb SHORT Char IsNotValid22 jb SHORT Char_CharIsNotValid 27 23 cmp %1, (%3)+1 ; Set CF if %1 is lesser 28 24 %endmacro … … 54 50 ; Nothing 55 51 ;-------------------------------------------------------------------- 52 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 56 53 ALIGN JUMP_ALIGN 57 54 Char_IsUpperCaseLetterInAL: 58 55 IS_BETWEEN_IMMEDIATES al, 'A', 'Z' 59 56 ret 57 %endif 60 58 61 59 ;-------------------------------------------------------------------- … … 70 68 ; Nothing 71 69 ;-------------------------------------------------------------------- 70 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 72 71 ALIGN JUMP_ALIGN 73 72 Char_IsHexadecimalDigitInAL: … … 77 76 IS_BETWEEN_IMMEDIATES al, 'a', 'f' 78 77 ret 78 %endif 79 79 80 80 ;-------------------------------------------------------------------- … … 106 106 ; Nothing 107 107 ;-------------------------------------------------------------------- 108 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 108 109 ALIGN JUMP_ALIGN 109 110 Char_ConvertIntegerToALfromDigitInALwithBaseInBX: … … 112 113 call dx ; Converts to lower case 113 114 pop dx 114 jnc SHORT Char IsNotValid115 jnc SHORT Char_CharIsNotValid 115 116 116 117 cmp al, '9' ; Decimal digit … … 120 121 .ConvertToDecimalDigit: 121 122 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 135 138 ALIGN JUMP_ALIGN 136 139 Char_CharIsValid: 137 140 stc 138 141 ret 139 140 ALIGN JUMP_ALIGN 141 CharIsNotValid: 142 %endif 143 144 ALIGN JUMP_ALIGN 145 Char_CharIsNotValid: 142 146 clc 143 147 ret … … 153 157 ; Nothing 154 158 ;-------------------------------------------------------------------- 159 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 155 160 ALIGN JUMP_ALIGN 156 161 Char_ALtoLowerCaseLetter: … … 160 165 .Return: 161 166 ret 167 %endif 162 168 163 169 ;-------------------------------------------------------------------- … … 188 194 ; Nothing 189 195 ;-------------------------------------------------------------------- 196 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 190 197 ALIGN JUMP_ALIGN 191 198 Char_GetFilterFunctionToDXforNumericBaseInBX: … … 193 200 cmp bl, 10 194 201 je SHORT .Return 195 sub dx, BYTE Char_IsDecimalDigitInAL -Char_IsHexadecimalDigitInAL202 mov dx, Char_IsHexadecimalDigitInAL 196 203 .Return: 197 204 ret 205 %endif -
trunk/Assembly_Library/Src/String/StringProcess.asm
r67 r162 1 ; File name : StringProcess.asm2 1 ; Project name : Assembly Library 3 ; Created date : 12.10.20104 ; Last update : 7.12.20105 ; Author : Tomi Tilli6 2 ; Description : Functions for processing characters in a string. 7 3 … … 33 29 ; CX: Number of characters processed 34 30 ; CF: Clear if all characters processed 35 ; Set if terminated by processing function 31 ; Set if terminated by processing function 36 32 ; Corrupts registers: 37 33 ; Nothing (processing function can corrupt BX,DI,ES) … … 91 87 StringProcess_ConvertToWordInDIWithBaseInBX: 92 88 call Char_ConvertIntegerToALfromDigitInALwithBaseInBX 93 jnc SHORT .InvalidCharacter 89 cmc 90 jc SHORT .InvalidCharacter 94 91 push dx 95 92 … … 99 96 jc SHORT .Overflow 100 97 add di, ax ; Add old WORD to new integer 101 jc SHORT .Overflow102 98 103 pop dx104 ret105 99 .Overflow: 106 100 pop dx 107 101 .InvalidCharacter: 108 stc ; Set CF to stop processing109 102 ret
Note:
See TracChangeset
for help on using the changeset viewer.