Changeset 592 in xtideuniversalbios for trunk/Assembly_Library
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (6 years ago)
- Location:
- trunk/Assembly_Library
- Files:
-
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/BiosFunctions.inc
r510 r592 6 6 ; BIOS interrupts 7 7 BIOS_VIDEO_INTERRUPT_10h EQU 10h 8 BIOS_EQUIPMENT_INTERRUPT_11h EQU 11h 8 9 BIOS_DISK_INTERRUPT_13h EQU 13h 9 10 BIOS_SYSTEM_INTERRUPT_15h EQU 15h -
trunk/Assembly_Library/Inc/Debug.inc
r590 r592 24 24 mov bl, %2 25 25 CALL_DISPLAY_LIBRARY PrintWordFromAXWithBaseInBL 26 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS26 %ifndef EXCLUDE_FROM_XUB 27 27 call Keyboard_RemoveAllKeystrokesFromBuffer 28 28 %endif … … 52 52 mov al, %1 53 53 CALL_DISPLAY_LIBRARY PrintCharacterFromAL 54 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS54 %ifndef EXCLUDE_FROM_XUB 55 55 call Keyboard_RemoveAllKeystrokesFromBuffer 56 56 %endif … … 95 95 %macro WAIT_ANY_KEY_TO_CONTINUE 0 96 96 push ax 97 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS97 %ifndef EXCLUDE_FROM_XUB 98 98 call Keyboard_RemoveAllKeystrokesFromBuffer 99 99 %endif -
trunk/Assembly_Library/Inc/Display.inc
r590 r592 61 61 .InitializeDisplayContext resb 2 62 62 63 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS63 %ifndef EXCLUDE_FROM_XUB 64 64 .SetCharacterPointerFromBXAX resb 2 65 65 %endif … … 74 74 .SynchronizeDisplayContextToHardware resb 2 75 75 76 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS76 %ifndef EXCLUDE_FROM_XUB 77 77 .GetCharacterPointerToBXAX resb 2 78 78 %endif … … 81 81 82 82 .FormatNullTerminatedStringFromCSSI resb 2 83 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS83 %ifndef EXCLUDE_FROM_XUB 84 84 .PrintSignedWordFromAXWithBaseInBL resb 2 85 85 %endif 86 86 .PrintWordFromAXWithBaseInBL resb 2 87 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG87 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 88 88 .PrintQWordFromSSBPwithBaseInBX resb 2 89 89 %endif … … 94 94 .PrintCharacterFromAL resb 2 95 95 .PrintNewlineCharacters resb 2 96 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS96 %ifndef EXCLUDE_FROM_XUB 97 97 .ClearAreaWithHeightInAHandWidthInAL resb 2 98 98 %endif -
trunk/Assembly_Library/Inc/DosFunctions.inc
r589 r592 6 6 ; DOS interrupts 7 7 DOS_INTERRUPT_21h EQU 21h 8 DOS_CTRL_C_CTRL_BREAK_HANDLER_23h EQU 23h 8 9 DOS_CRITICAL_ERROR_HANDLER_24h EQU 24h 9 10 DOS_TSR_MULTIPLEX_INTERRUPT_2Fh EQU 2Fh … … 31 32 FIND_FIRST_MATCHING_FILE EQU 4Eh ; DOS 2+ 32 33 FIND_NEXT_MATCHING_FILE EQU 4Fh ; DOS 2+ 34 GET_EXTENDED_ERROR_INFORMATION EQU 59h ; DOS 3.0+ 33 35 34 36 ; DOS errors -
trunk/Assembly_Library/Inc/Emulate.inc
r589 r592 60 60 61 61 ;-------------------------------------------------------------------- 62 ; Find String In String 63 ; 64 ; FSIS 65 ; Parameters: 66 ; %1: String to search for (case-insensitive) 67 ; %2: String to search in 68 ; Returns: 69 ; strpos: Position of %1 in %2 if found, 0 if not found 70 ;-------------------------------------------------------------------- 71 %macro FSIS 2.nolist 72 %defstr s1 %1 73 %defstr s2 %2 74 %strlen sl1 s1 75 %strlen sl2 s2 76 %assign strpos 0 77 %if sl1 <= sl2 78 %assign strpos sl2 - sl1 + 1 79 %rep strpos 80 %substr %%ss s2 strpos, sl1 81 %ifidni %%ss, s1 82 %exitrep 83 %else 84 %assign strpos strpos - 1 85 %endif 86 %endrep 87 %endif 88 %endmacro 89 90 91 ;-------------------------------------------------------------------- 62 92 ; The undocumented instruction SALC (Set AL According to CF). 63 93 ; Available on all Intel processors and truly compatible clones. … … 108 138 ;-------------------------------------------------------------------- 109 139 ; The AAM instruction (ASCII Adjust after Multiplication). 110 ; Available on all Intel processors and truly compatible clones.111 ; Does not work on the NEC V20/V30 or Sony CXQ70108 processors112 ; unless %1 is 10 (0Ah).113 140 ; 114 141 ; eAAM … … 152 179 %macro eBSF 2 153 180 %ifndef USE_386 154 push cx155 181 cmp WORD %2, BYTE 0 ; Source operand is zero? 156 182 je SHORT %%Return ; If so, return with ZF set 157 183 158 184 ; Set destination to zero and load mask for bit 0 185 push cx 159 186 xor %1, %1 160 187 mov cx, 1 … … 163 190 %%BitLoop: 164 191 test %2, cx ; Bit set? 165 jnz SHORT %% Return; If so, return with ZF cleared192 jnz SHORT %%PopAndReturn; If so, return with ZF cleared 166 193 shl cx, 1 ; Prepare to test next bit 167 194 inc %1 ; Increment bit index 168 195 jmp SHORT %%BitLoop ; Loop until bit found 169 %% Return:196 %%PopAndReturn: 170 197 pop cx 198 %%Return: 171 199 ;----------------------------------- 172 200 %else … … 193 221 %macro eBSR 2 194 222 %ifndef USE_386 195 push cx196 223 cmp WORD %2, BYTE 0 ; Source operand is zero? 197 224 je SHORT %%Return ; If so, return with ZF set 198 225 199 226 ; Load mask for highest order bit 227 push cx 200 228 mov cx, 1<<15 201 229 mov %1, 15 … … 204 232 %%BitLoop: 205 233 test %2, cx ; Bit set? 206 jnz SHORT %% Return; If so, return with ZF cleared234 jnz SHORT %%PopAndReturn; If so, return with ZF cleared 207 235 shr cx, 1 ; Prepare to test next bit 208 236 dec %1 ; Decrement bit index 209 237 jmp SHORT %%BitLoop ; Loop until bit found 210 %% Return:238 %%PopAndReturn: 211 239 pop cx 240 %%Return: 212 241 ;----------------------------------- 213 242 %else … … 260 289 261 290 %macro eCMOVE 2 262 eCMOVZ 291 eCMOVZ %1, %2 263 292 %endmacro 264 293 265 294 %macro eCMOVNE 2 266 eCMOVNZ 295 eCMOVNZ %1, %2 267 296 %endmacro 268 297 269 298 %macro eCMOVB 2 270 jnb SHORT %%Return 271 mov %1, %2 272 %%Return: 299 eCMOVC %1, %2 273 300 %endmacro 274 301 … … 289 316 ; Conditional Set. 290 317 ; 291 ; e CSETcc318 ; eSETcc 292 319 ; Parameters: 293 320 ; %1: Destination data … … 297 324 ; Flags 298 325 ;-------------------------------------------------------------------- 299 %macro e CSETZ 1326 %macro eSETZ 1 300 327 mov %1, 0 ; Clear while preserving flags 301 328 jnz SHORT %%Return ; Nothing to set … … 304 331 %endmacro 305 332 306 %macro e CSETNZ 1333 %macro eSETNZ 1 307 334 mov %1, 0 ; Clear while preserving flags 308 335 jz SHORT %%Return ; Nothing to set … … 339 366 xor dh, dh 340 367 %else ; SI, DI, BP (all may be used in effective address) 341 push ax 342 mov al, %2 343 xor ah, ah 344 xchg ax, %1 345 pop ax 368 FSIS %1, %2 369 %if strpos 370 push ax 371 mov al, %2 372 xor ah, ah 373 xchg %1, ax 374 pop ax 375 %else 376 xchg %1, ax 377 mov al, %2 378 xor ah, ah 379 xchg %1, ax 380 %endif 346 381 %endif 347 382 ;----------------------------------- … … 484 519 ; eSEG_STR 485 520 ; Parameters: 486 ; %1: REP/REP NE or REPEprefix521 ; %1: REP/REPE/REPZ or REPNE/REPNZ prefix 487 522 ; %2: Source segment override (destination is always ES) 488 523 ; %3: String instruction … … 491 526 ; FLAGS for cmps and scas only 492 527 ; Corrupts registers: 493 ; Nothing528 ; FLAGS 494 529 ;-------------------------------------------------------------------- 495 530 %macro eSEG_STR 3 … … 499 534 %2 ; SEG is the prefix that won't be lost 500 535 %3 ; String instruction 536 FSIS cmps, %3 537 %ifn strpos 538 FSIS scas, %3 539 %endif 540 %if strpos ; Must preserve FLAGS 501 541 jcxz %%End ; Jump to end if no repeats left (preserves FLAGS) 502 542 jmp SHORT %%Loop ; Loop while repeats left 503 543 %%End: 544 %else ; No need to preserve FLAGS 545 inc cx 546 loop %%Loop 547 %endif 504 548 %else ; No bug on V20/V30 and later, don't know about 188/186 505 549 %2 … … 556 600 %ifdef USE_386 557 601 %if %2 = 1 558 add %1, %1 ; Same size but faster on 386 and 486. Fails if %1 is a memory operand. 602 FSIS ], %1 603 %if strpos 604 eSHIFT_IM %1, %2, shl 605 %else 606 add %1, %1 ; Same size but faster on 386 and 486. 607 %endif 559 608 %else 560 609 eSHIFT_IM %1, %2, shl … … 582 631 %ifdef USE_386 583 632 %if %2 = 1 584 adc %1, %1 ; Same size but faster on 386 and 486. Fails if %1 is a memory operand. 633 FSIS ], %1 634 %if strpos 635 eSHIFT_IM %1, %2, rcl 636 %else 637 adc %1, %1 ; Same size but faster on 386 and 486. 638 %endif 585 639 %else 586 640 eSHIFT_IM %1, %2, rcl -
trunk/Assembly_Library/Inc/Macros.inc
r566 r592 18 18 ; %1 19 19 ;-------------------------------------------------------------------- 20 %macro SKIP2B 1 20 %macro SKIP2B 1.nolist 21 21 %ifidni %1, f 22 22 db 03Dh ; Opcode byte for CMP AX, <immed> -
trunk/Assembly_Library/Inc/Math.inc
r589 r592 23 23 jb %%Return ; If so, return 24 24 mov %1, %2 ; Copy %2 to %1 25 ALIGN JUMP_ALIGN26 25 %%Return: 27 26 %endmacro … … 31 30 jl %%Return ; If so, return 32 31 mov %1, %2 ; Copy %2 to %1 33 ALIGN JUMP_ALIGN34 32 %%Return: 35 33 %endmacro … … 51 49 ja %%Return ; If so, return 52 50 mov %1, %2 ; Copy %2 to %1 53 ALIGN JUMP_ALIGN54 51 %%Return: 55 52 %endmacro … … 59 56 jg %%Return ; If so, return 60 57 mov %1, %2 ; Copy %2 to %1 61 ALIGN JUMP_ALIGN62 58 %%Return: 63 59 %endmacro … … 67 63 ; SHL_DXAX 68 64 ; Parameters: 69 ; %1: Number of bits to shift 65 ; %1: Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value. 70 66 ; Returns: 71 67 ; DX:AX Shifted value … … 74 70 ;-------------------------------------------------------------------- 75 71 %macro SHL_DXAX 1 72 %ifdef USE_386 76 73 %ifnidni %1, cx 74 ; %1 is CL or an immediate 75 shld dx, ax, %1 76 shl ax, %1 77 %else 78 ; %1 is CX 79 shld dx, ax, cl 80 shl ax, cl 81 %endif 82 %else 83 %ifidni %1, cl 84 ; %1 is CL 85 xor ch, ch 86 %elifnidni %1, cx 87 ; %1 is an immediate 77 88 mov cx, %1 78 89 %endif … … 82 93 eRCL_IM dx, 1 83 94 loop .ShiftNextBit 95 %endif 84 96 %endmacro 85 97 … … 88 100 ; SHR_DXAX 89 101 ; Parameters: 90 ; %1: Number of bits to shift 102 ; %1: Number of bits to shift. Can be (in preferred order) CX, CL or an immediate value. 91 103 ; Returns: 92 104 ; DX:AX Shifted value … … 95 107 ;-------------------------------------------------------------------- 96 108 %macro SHR_DXAX 1 109 %ifdef USE_386 97 110 %ifnidni %1, cx 111 ; %1 is CL or an immediate 112 shrd ax, dx, %1 113 shr dx, %1 114 %else 115 ; %1 is CX 116 shrd ax, dx, cl 117 shr dx, cl 118 %endif 119 %else 120 %ifidni %1, cl 121 ; %1 is CL 122 xor ch, ch 123 %elifnidni %1, cx 124 ; %1 is an immediate 98 125 mov cx, %1 99 126 %endif … … 103 130 rcr ax, 1 104 131 loop .ShiftNextBit 132 %endif 105 133 %endmacro 106 134 -
trunk/Assembly_Library/Inc/Menu.inc
r525 r592 159 159 SCROLL_THUMB_CHARACTER EQU BLOCK_FULL_FOREGROUND 160 160 161 NO_ITEM_SELECTED EQU -1161 ;NO_ITEM_SELECTED EQU -1 162 162 NO_ITEM_HIGHLIGHTED EQU -1 163 163 NO_TIMEOUT_USED EQU 0 -
trunk/Assembly_Library/Src/AssemblyLibrary.asm
r526 r592 90 90 %endif 91 91 %include "Char.asm" 92 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS92 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 93 93 %include "String.asm" 94 94 %include "StringProcess.asm" … … 106 106 107 107 %ifdef INCLUDE_TIME_LIBRARY 108 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS108 %ifndef EXCLUDE_FROM_XUB 109 109 %include "Delay.asm" 110 110 %ifndef EXCLUDE_FROM_XTIDECFG … … 119 119 %define UTIL_SIZE_JUMP_ALIGN 1 120 120 %endif 121 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 122 %include "Bit.asm" 121 %ifndef EXCLUDE_FROM_XUB 122 %ifndef EXCLUDE_FROM_BIOSDRVS 123 %include "Bit.asm" 124 %endif 125 %include "Math.asm" 123 126 %endif 124 %include "Math.asm" 125 %include "Registers.asm" 126 %include "Reboot.asm" 127 %include "Memory.asm" 127 %ifndef EXCLUDE_FROM_BIOSDRVS 128 %include "Registers.asm" 129 %include "Reboot.asm" 130 %include "Memory.asm" 131 %endif 128 132 %include "Size.asm" 129 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS133 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 130 134 %include "Sort.asm" 131 135 %endif -
trunk/Assembly_Library/Src/Display/CgaSnow.asm
r583 r592 106 106 ; AX, CX, DX 107 107 ;-------------------------------------------------------------------- 108 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS108 %ifdef EXCLUDE_FROM_XUB 109 109 %ifdef MODULE_STRINGS_COMPRESSED 110 110 %define EXCLUDE -
trunk/Assembly_Library/Src/Display/Display.asm
r590 r592 38 38 push dx 39 39 40 %ifdef CLD_NEEDED 40 41 cld 42 %endif 41 43 LOAD_BDA_SEGMENT_TO ds, dx 42 44 mov dx, di … … 76 78 %define InitializeDisplayContext DisplayContext_Initialize 77 79 78 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS80 %ifndef EXCLUDE_FROM_XUB 79 81 %define SetCharacterPointerFromBXAX DisplayContext_SetCharacterPointerFromBXAX 80 82 %endif … … 89 91 %define SynchronizeDisplayContextToHardware DisplayContext_SynchronizeToHardware 90 92 91 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS93 %ifndef EXCLUDE_FROM_XUB 92 94 %define GetCharacterPointerToBXAX DisplayContext_GetCharacterPointerToBXAX 93 95 %endif … … 96 98 97 99 %define FormatNullTerminatedStringFromCSSI Display_FormatNullTerminatedStringFromCSSI 98 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS100 %ifndef EXCLUDE_FROM_XUB 99 101 %define PrintSignedWordFromAXWithBaseInBL DisplayPrint_SignedWordFromAXWithBaseInBL 100 102 %endif 101 103 %define PrintWordFromAXWithBaseInBL DisplayPrint_WordFromAXWithBaseInBL 102 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG104 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 103 105 %define PrintQWordFromSSBPwithBaseInBX DisplayPrint_QWordFromSSBPwithBaseInBX 104 106 %endif … … 109 111 %define PrintCharacterFromAL DisplayPrint_CharacterFromAL 110 112 %define PrintNewlineCharacters DisplayPrint_Newline 111 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS113 %ifndef EXCLUDE_FROM_XUB 112 114 %define ClearAreaWithHeightInAHandWidthInAL DisplayPrint_ClearAreaWithHeightInAHandWidthInAL 113 115 %endif -
trunk/Assembly_Library/Src/Display/DisplayContext.asm
r588 r592 110 110 ; AX, DI 111 111 ;-------------------------------------------------------------------- 112 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS112 %ifdef EXCLUDE_FROM_XUB 113 113 %ifndef MODULE_BOOT_MENU 114 114 %define EXCLUDE … … 116 116 %endif 117 117 118 %ifndef EXCLUDE 118 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 119 119 ALIGN DISPLAY_JUMP_ALIGN 120 120 DisplayContext_Push: … … 170 170 mov ds, di ; Restore DS 171 171 ret 172 %endif ; EXCLUDE 172 %endif ; EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 173 173 %undef EXCLUDE 174 174 … … 184 184 ; AX, DI 185 185 ;-------------------------------------------------------------------- 186 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS186 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 187 187 ALIGN DISPLAY_JUMP_ALIGN 188 188 DisplayContext_PrepareOffScreenBufferInESBXwithLengthInCX: … … 202 202 pop ds 203 203 ret 204 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS204 %endif ; EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 205 205 206 206 … … 215 215 ; AX 216 216 ;-------------------------------------------------------------------- 217 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS217 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 218 218 ALIGN DISPLAY_JUMP_ALIGN 219 219 DisplayContext_SetCharacterPointerFromBXAX: … … 235 235 ; Nothing 236 236 ;-------------------------------------------------------------------- 237 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS237 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 238 238 ALIGN DISPLAY_JUMP_ALIGN 239 239 DisplayContext_GetCharacterPointerToBXAX: … … 244 244 245 245 246 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS246 %ifdef EXCLUDE_FROM_XUB 247 247 %ifndef MODULE_BOOT_MENU 248 248 %define EXCLUDE … … 282 282 ;-------------------------------------------------------------------- 283 283 %ifndef EXCLUDE ; 2 of 3 284 %ifndef EXCLUDE_FROM_BIOSDRVS 284 285 ALIGN DISPLAY_JUMP_ALIGN 285 286 DisplayContext_SetCharacterAttributeFromAL: … … 287 288 ret 288 289 %endif 290 %endif 289 291 290 292 … … 300 302 ;-------------------------------------------------------------------- 301 303 %ifndef EXCLUDE ; 3 of 3 304 %ifndef EXCLUDE_FROM_BIOSDRVS 302 305 ALIGN DISPLAY_JUMP_ALIGN 303 306 DisplayContext_SetCharacterOutputParameterFromAX: … … 305 308 ret 306 309 %endif 310 %endif 307 311 308 312 %undef EXCLUDE … … 318 322 ; Nothing 319 323 ;-------------------------------------------------------------------- 320 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG324 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS 321 325 ALIGN DISPLAY_JUMP_ALIGN 322 326 DisplayContext_GetCharacterOutputParameterToDX: -
trunk/Assembly_Library/Src/Display/DisplayCursor.asm
r526 r592 48 48 ; Nothing 49 49 ;-------------------------------------------------------------------- 50 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS50 %ifdef EXCLUDE_FROM_XUB 51 51 %ifndef MODULE_BOOT_MENU 52 52 %define EXCLUDE … … 54 54 %endif 55 55 56 %ifndef EXCLUDE 56 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 57 57 ALIGN DISPLAY_JUMP_ALIGN 58 58 DisplayCursor_SetShapeFromAX: -
trunk/Assembly_Library/Src/Display/DisplayFormat.asm
r590 r592 142 142 143 143 .rgcFormatCharToLookupIndex: 144 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS144 %ifndef EXCLUDE_FROM_XUB 145 145 db "aIAduxsSctz-+%" 146 146 %else … … 150 150 ALIGN WORD_ALIGN 151 151 .rgfnFormatSpecifierParser: 152 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS152 %ifndef EXCLUDE_FROM_XUB 153 153 dw a_FormatAttributeForNextCharacter 154 154 %endif 155 155 dw I_FormatDashForZero 156 156 dw A_FormatAttributeForRemainingString 157 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS157 %ifndef EXCLUDE_FROM_XUB 158 158 dw d_FormatSignedDecimalWord 159 159 %endif … … 161 161 dw x_FormatHexadecimalWord 162 162 dw s_FormatStringFromSegmentCS 163 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS163 %ifndef EXCLUDE_FROM_XUB 164 164 dw S_FormatStringFromFarPointer 165 165 %endif 166 166 dw c_FormatCharacter 167 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS167 %ifndef EXCLUDE_FROM_XUB 168 168 dw t_FormatRepeatCharacter 169 169 %endif 170 170 dw z_FormatStringFromSegmentZero 171 171 dw PrepareToPrependParameterWithSpaces 172 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS172 %ifndef EXCLUDE_FROM_XUB 173 173 dw PrepareToAppendSpacesAfterParameter 174 174 dw percent_FormatPercent … … 308 308 ; AX, BX, DX 309 309 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 310 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS310 %ifndef EXCLUDE_FROM_XUB 311 311 ALIGN DISPLAY_JUMP_ALIGN 312 312 a_FormatAttributeForNextCharacter: … … 330 330 ret 331 331 332 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS332 %ifndef EXCLUDE_FROM_XUB 333 333 ALIGN DISPLAY_JUMP_ALIGN 334 334 d_FormatSignedDecimalWord: … … 391 391 ret 392 392 393 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS393 %ifndef EXCLUDE_FROM_XUB 394 394 ALIGN DISPLAY_JUMP_ALIGN 395 395 S_FormatStringFromFarPointer: … … 408 408 jmp DisplayPrint_CharacterFromAL 409 409 410 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS410 %ifndef EXCLUDE_FROM_XUB 411 411 ALIGN DISPLAY_JUMP_ALIGN 412 412 t_FormatRepeatCharacter: -
trunk/Assembly_Library/Src/Display/DisplayPage.asm
r589 r592 31 31 ; AX, DX 32 32 ;-------------------------------------------------------------------- 33 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG33 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS 34 34 ALIGN DISPLAY_JUMP_ALIGN 35 35 DisplayPage_SetFromAL: … … 41 41 42 42 43 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS43 %ifdef EXCLUDE_FROM_XUB 44 44 %define EXCLUDE 45 45 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU … … 48 48 %endif 49 49 50 %ifndef EXCLUDE 50 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 51 51 ;-------------------------------------------------------------------- 52 52 ; DisplayPage_GetColumnsToALandRowsToAH -
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r590 r592 94 94 ; AX, BH, DX 95 95 ;-------------------------------------------------------------------- 96 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS96 %ifndef EXCLUDE_FROM_XUB 97 97 ALIGN DISPLAY_JUMP_ALIGN 98 98 DisplayPrint_SignedWordFromAXWithBaseInBL: … … 163 163 ; AX, DX, [SS:BP] 164 164 ;-------------------------------------------------------------------- 165 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG165 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 166 166 ALIGN DISPLAY_JUMP_ALIGN 167 167 DisplayPrint_QWordFromSSBPwithBaseInBX: … … 194 194 ; AX, DX 195 195 ;-------------------------------------------------------------------- 196 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS196 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 197 197 ALIGN DISPLAY_JUMP_ALIGN 198 198 DisplayPrint_CharacterBufferFromBXSIwithLengthInCX: … … 261 261 ; AX, DX 262 262 ;-------------------------------------------------------------------- 263 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS263 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 264 264 ALIGN DISPLAY_JUMP_ALIGN 265 265 DisplayPrint_ClearAreaWithHeightInAHandWidthInAL: … … 292 292 %endif 293 293 294 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS294 %ifdef EXCLUDE_FROM_XUB 295 295 %define EXCLUDE 296 296 %ifndef MODULE_STRINGS_COMPRESSED -
trunk/Assembly_Library/Src/File/Directory.asm
r526 r592 99 99 ; Nothing 100 100 ;-------------------------------------------------------------------- 101 %ifndef EXCLUDE_FROM_XTIDECFG 101 102 ALIGN JUMP_ALIGN 102 103 Directory_GetMatchCountToAXforSearchStringInDSSIwithAttributesInCX: … … 115 116 pop dx 116 117 ret 118 %endif 117 119 118 120 -
trunk/Assembly_Library/Src/File/DosCritical.asm
r526 r592 1 ; File name : DosCritical.asm2 1 ; Project name : Assembly Library 3 ; Created date : 1.9.20104 ; Last update : 2.9.20105 ; Author : Tomi Tilli6 2 ; Description : DOS Critical Error Handler (24h) replacements. 7 3 … … 22 18 ; 23 19 20 ; Note! Only DOS functions 01h - 0Ch, 30h and 59h can be called from a Critical Error Handler. 24 21 25 22 ; DOS Critical Error Handler return values … … 28 25 .retryOperation resb 1 29 26 .terminateProgramAsThoughInt21hAH4ChCalled resb 1 30 .failSystemCallInProgress resb 1 27 .failSystemCallInProgress resb 1 ; Needs DOS 3.1+ 31 28 endstruc 32 29 … … 83 80 84 81 ;-------------------------------------------------------------------- 82 ; DosCritical_CustomHandler 83 ; Parameters: 84 ; Nothing 85 ; Returns: 86 ; Nothing 87 ; Corrupts registers: 88 ; Nothing 89 ;-------------------------------------------------------------------- 90 ALIGN JUMP_ALIGN 91 DosCritical_CustomHandler: 92 add sp, 6 ; Remove the INT 24h return address and flags from stack 93 94 mov ah, GET_EXTENDED_ERROR_INFORMATION ; Requires DOS 3.0+ 95 xor bx, bx 96 int DOS_INTERRUPT_21h 97 mov [cs:bLastCriticalError], al 98 99 pop ax 100 pop bx 101 pop cx 102 pop dx 103 pop si 104 pop di 105 pop bp 106 pop ds 107 pop es 108 iret ; Return from the INT 21h call 109 110 bLastCriticalError: db 0 111 112 113 ;-------------------------------------------------------------------- 85 114 ; DosCritical_HandlerToIgnoreAllErrors 86 115 ; Parameters: … … 95 124 mov al, CRITICAL_ERROR_ACTION.ignoreErrorAndContinueProcessingRequest 96 125 iret 126 -
trunk/Assembly_Library/Src/File/Drive.asm
r589 r592 30 30 ; Nothing 31 31 ;-------------------------------------------------------------------- 32 %ifndef EXCLUDE_FROM_XTIDECFG 32 33 ALIGN JUMP_ALIGN 33 34 Drive_GetNumberOfAvailableDrivesToAX: … … 42 43 pop dx 43 44 ret 45 %endif 44 46 45 47 -
trunk/Assembly_Library/Src/File/FileIO.asm
r526 r592 35 35 ; AX, BX 36 36 ;-------------------------------------------------------------------- 37 %ifndef EXCLUDE_FROM_XTIDECFG 37 38 ALIGN JUMP_ALIGN 38 39 FileIO_CreateWithPathInDSSIandAttributesInCX: … … 40 41 SKIP2B bx 41 42 ; Fall to FileIO_OpenWithPathInDSSIandFileAccessInAL 43 %endif 42 44 43 45 ;-------------------------------------------------------------------- -
trunk/Assembly_Library/Src/Keyboard/Keyboard.asm
r589 r592 37 37 ; DX 38 38 ;-------------------------------------------------------------------- 39 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS39 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 40 40 ALIGN KEYBOARD_JUMP_ALIGN 41 41 Keyboard_ReadUserInputtedWordWhilePrinting: … … 87 87 ; AX 88 88 ;-------------------------------------------------------------------- 89 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS89 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 90 90 ALIGN KEYBOARD_JUMP_ALIGN 91 91 Keyboard_ReadUserInputtedStringToESDIWhilePrinting: … … 98 98 xor bx, bx ; Zero character counter 99 99 dec cx ; Decrement buffer size for NULL 100 %ifdef CLD_NEEDED 100 101 cld 102 %endif 101 103 ALIGN KEYBOARD_JUMP_ALIGN 102 104 .GetCharacterFromUser: … … 197 199 xor al, al ; Set ZF and clear CF 198 200 ret 199 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS201 %endif ; EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 200 202 201 203 … … 209 211 ; AX 210 212 ;-------------------------------------------------------------------- 211 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS213 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 212 214 ALIGN KEYBOARD_JUMP_ALIGN 213 215 Keyboard_PrintBackspace: … … 230 232 ; AX 231 233 ;-------------------------------------------------------------------- 232 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS234 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 233 235 ALIGN KEYBOARD_JUMP_ALIGN 234 236 Keyboard_PlayBellForUnwantedKeystroke: … … 246 248 ; AX 247 249 ;-------------------------------------------------------------------- 248 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS250 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 249 251 ALIGN KEYBOARD_JUMP_ALIGN 250 252 Keyboard_PrintInputtedCharacter: … … 266 268 ; AX 267 269 ;-------------------------------------------------------------------- 268 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS; Only used when debugging270 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS ; Only used when debugging 269 271 ALIGN KEYBOARD_JUMP_ALIGN 270 272 Keyboard_RemoveAllKeystrokesFromBuffer: … … 289 291 ; Nothing 290 292 ;-------------------------------------------------------------------- 291 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS293 %ifdef EXCLUDE_FROM_XUB 292 294 %define EXCLUDE 293 295 %ifdef MODULE_HOTKEYS OR MODULE_BOOT_MENU -
trunk/Assembly_Library/Src/LibSizeCheck.asm
r526 r592 20 20 21 21 ; Include .inc files 22 %define EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS22 %define EXCLUDE_FROM_XUB 23 23 ;%define INCLUDE_DISPLAY_LIBRARY 24 24 ;%define INCLUDE_FILE_LIBRARY -
trunk/Assembly_Library/Src/Menu/Dialog/DialogFile.asm
r589 r592 249 249 ALIGN JUMP_ALIGN 250 250 AppendFileFromDTAinDSSItoOffScreenBuffer: 251 call .FilterCurrentDirectory ; We never want "." 252 call .FilterUpDirectoryWhenInRoot ; No ".." when in root directory 251 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 252 je SHORT .Return ; We never want "." 253 test dl, dl 254 jnz SHORT .NotInRootDirectory 255 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 256 je SHORT .Return ; No ".." when in root directory 257 .NotInRootDirectory: 253 258 inc cx ; Nothing filtered so increment files/directories 254 259 … … 262 267 pop si 263 268 pop bp 264 ret 265 266 ;-------------------------------------------------------------------- 267 ; .FilterCurrentDirectory 268 ; .FilterUpDirectoryWhenInRoot 269 ; Parameters: 270 ; DL: Zero if root directory selected 271 ; DS:SI: Ptr to DTA containing file information 272 ; Returns: 273 ; Nothing 274 ; Returns from AppendFileToBufferInESDIfromDtaInDSSI when filtering 275 ; Corrupts registers: 276 ; AX 277 ;-------------------------------------------------------------------- 278 ALIGN JUMP_ALIGN 279 .FilterCurrentDirectory: 280 cmp WORD [si+DTA.szFile], CURRENTDIR_CHARACTERS 281 je SHORT .DoFilter 282 ret 283 284 ALIGN JUMP_ALIGN 285 .FilterUpDirectoryWhenInRoot: 286 test dl, dl ; Set ZF if root directory selected 287 jnz SHORT .ReturnWithoutFiltering 288 cmp WORD [si+DTA.szFile], UPDIR_CHARACTERS 289 jne SHORT .ReturnWithoutFiltering 290 .DoFilter: 291 add sp, BYTE 2 ; Remove return address from stack 292 ALIGN JUMP_ALIGN, ret 293 .ReturnWithoutFiltering: 269 .Return: 294 270 ret 295 271 … … 473 449 ALIGN JUMP_ALIGN 474 450 GetInfoLinesToCXandDialogFlagsToAX: 475 xor ax, ax476 call GetDialogFlagsToAL477 jmp Bit_GetSetCountToCXfromAX451 ePUSH_T ax, Bit_GetSetCountToCXfromAX 452 xor ah, ah 453 ; Fall to GetDialogFlagsToAL 478 454 479 455 ;-------------------------------------------------------------------- … … 696 672 call .ChangeDriveToUserSelectionFromIoInDSSI 697 673 add sp, BYTE DRIVE_DIALOG_IO_size 674 .UserCancelledDriveChange: 698 675 ret 699 676 … … 729 706 jne SHORT .UserCancelledDriveChange 730 707 708 ; Install our Custom Critical Error Handler to catch "Drive Not Ready" errors. This handler only works on DOS 3.0+ systems 709 ; but that should be OK because only DOS 3.1+ will trigger it. Under older DOS versions drives are enumerated using 710 ; GET_DOS_DRIVE_PARAMETER_BLOCK_FOR_SPECIFIC_DRIVE which will access the drive so we know it is available at this point. 711 mov dx, DosCritical_CustomHandler 712 call DosCritical_InstallNewHandlerFromCSDX 713 714 ; Save the current drive on stack in case the selected drive is not ready and the user decides to cancel the change. 715 call Drive_GetDefaultToAL 716 xchg dx, ax 717 718 .RetryDrive: 719 push dx ; Save the previous current drive to stack 720 731 721 mov dl, [si+DRIVE_DIALOG_IO.bReturnDriveNumber] 732 722 call Drive_SetDefaultFromDL 723 724 ; Now we must try to force a media access to catch "Drive Not Ready". 725 push ds 726 push ss 727 pop ds 728 ePUSH_T ax, CURRENTDIR_CHARACTERS 729 mov cx, FLG_FILEATTR_DIRECTORY 730 mov dx, sp 731 mov ax, FIND_FIRST_MATCHING_FILE<<8 732 int DOS_INTERRUPT_21h 733 pop ax 734 pop ds 735 736 pop dx ; Restore the previous current drive from stack 737 738 xchg ah, [cs:bLastCriticalError] ; Zero bLastCriticalError and fetch error code to AH 739 cmp ah, ERR_DOS_DRIVE_NOT_READY 740 jne SHORT .DriveIsReady 741 742 mov bx, g_szDlgDriveNotReady 743 call Dialogs_DisplayYesNoResponseDialogWithTitleStringInBX 744 jz SHORT .RetryDrive 745 ; The user cancelled the drive change. Restore current drive to what it was previously. 746 call Drive_SetDefaultFromDL 747 jmp DosCritical_RestoreDosHandler 748 749 .DriveIsReady: 750 call DosCritical_RestoreDosHandler 733 751 jmp RefreshFilesToDisplay 734 .UserCancelledDriveChange:735 ret736 752 737 753 -
trunk/Assembly_Library/Src/Menu/MenuAttributes.asm
r526 r592 91 91 92 92 .rgcColorAttributes: 93 ; Classic (default theme) 93 94 istruc ATTRIBUTE_CHARS 94 95 at ATTRIBUTE_CHARS.cBordersAndBackground, db COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE) … … 100 101 at ATTRIBUTE_CHARS.cNormalTimeout, db COLOR_ATTRIBUTE(COLOR_GREEN, COLOR_BLUE) 101 102 iend 103 ColorTheme equ MenuAttribute_GetToAXfromTypeInSI.rgcColorAttributes 102 104 103 105 .rgcBlackAndWhiteAttributes: ; Only COLOR_WHITE, COLOR_BRIGHT_WHITE and COLOR_BLACK should be used -
trunk/Assembly_Library/Src/Menu/MenuBorders.asm
r583 r592 87 87 ; AX, BX, CX, DX, SI, DI 88 88 ;-------------------------------------------------------------------- 89 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS89 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 90 90 ALIGN MENU_JUMP_ALIGN 91 91 MenuBorders_RefreshItemBorders: -
trunk/Assembly_Library/Src/Menu/MenuInit.asm
r532 r592 114 114 ; AX, BX, DX 115 115 ;-------------------------------------------------------------------- 116 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS116 %ifndef EXCLUDE_FROM_XUB 117 117 ALIGN MENU_JUMP_ALIGN 118 118 MenuInit_CloseMenuIfExitEventAllows: … … 138 138 139 139 140 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS140 %ifndef EXCLUDE_FROM_XUB 141 141 ;-------------------------------------------------------------------- 142 142 ; MenuInit_HighlightItemFromAX … … 168 168 mov ax, [bp+MENUINIT.wHighlightedItem] 169 169 ret 170 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS170 %endif ; EXCLUDE_FROM_XUB 171 171 172 172 … … 183 183 ; Nothing 184 184 ;-------------------------------------------------------------------- 185 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 185 %ifndef EXCLUDE_FROM_XUB 186 %ifndef EXCLUDE_FROM_XTIDECFG 186 187 ALIGN MENU_JUMP_ALIGN 187 188 MenuInit_SetTitleHeightFromAL: … … 193 194 mov [bp+MENUINIT.bInfoLines], al 194 195 ret 196 %endif ; EXCLUDE_FROM_XTIDECFG 195 197 196 198 ALIGN MENU_JUMP_ALIGN … … 198 200 mov [bp+MENUINIT.wItems], ax 199 201 ret 200 %endif 202 %endif ; EXCLUDE_FROM_XUB 201 203 202 204 … … 212 214 ; Nothing 213 215 ;-------------------------------------------------------------------- 214 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 216 %ifndef EXCLUDE_FROM_XUB 217 %ifndef EXCLUDE_FROM_XTIDECFG 215 218 ALIGN MENU_JUMP_ALIGN 216 219 MenuInit_SetUserDataFromDSSI: … … 218 221 mov [bp+MENU.dwUserData+2], ds 219 222 ret 223 %endif ; EXCLUDE_FROM_XTIDECFG 220 224 221 225 ALIGN MENU_JUMP_ALIGN … … 223 227 lds si, [bp+MENU.dwUserData] 224 228 ret 225 %endif 229 %endif ; EXCLUDE_FROM_XUB -
trunk/Assembly_Library/Src/Menu/MenuLocation.asm
r583 r592 55 55 ; Nothing 56 56 ;-------------------------------------------------------------------- 57 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS57 %ifndef EXCLUDE_FROM_XUB 58 58 MenuLocation_GetItemBordersTopLeftCoordinatesToAX: 59 59 %endif -
trunk/Assembly_Library/Src/Menu/MenuText.asm
r583 r592 32 32 ; AX, BX, CX, DX, SI, DI 33 33 ;-------------------------------------------------------------------- 34 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS34 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 35 35 ALIGN MENU_JUMP_ALIGN 36 36 MenuText_ClearTitleArea: -
trunk/Assembly_Library/Src/Serial/SerialServer.asm
r568 r592 61 61 push ax ; working copy on the top of the stack 62 62 63 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS ; DF already cleared in Int13h.asm 63 %ifndef EXCLUDE_FROM_XUB ; DF already cleared in Int13h.asm 64 %ifdef CLD_NEEDED 64 65 cld 66 %endif 65 67 %endif 66 68 -
trunk/Assembly_Library/Src/String/Char.asm
r526 r592 51 51 ; Nothing 52 52 ;-------------------------------------------------------------------- 53 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS53 %ifdef EXCLUDE_FROM_XUB 54 54 %ifndef MODULE_HOTKEYS 55 55 %define EXCLUDE … … 57 57 %endif 58 58 59 %ifndef EXCLUDE 59 %ifndef EXCLUDE OR EXCLUDE_FROM_BIOSDRVS 60 60 ALIGN STRING_JUMP_ALIGN 61 61 Char_IsLowerCaseLetterInAL: … … 76 76 ; Nothing 77 77 ;-------------------------------------------------------------------- 78 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS78 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 79 79 ALIGN STRING_JUMP_ALIGN 80 80 Char_IsUpperCaseLetterInAL: … … 95 95 ; Nothing 96 96 ;-------------------------------------------------------------------- 97 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS97 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 98 98 ALIGN STRING_JUMP_ALIGN 99 99 Char_IsHexadecimalDigitInAL: … … 136 136 ; Nothing 137 137 ;-------------------------------------------------------------------- 138 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS138 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 139 139 ALIGN STRING_JUMP_ALIGN 140 140 Char_ConvertIntegerToALfromDigitInALwithBaseInBX: … … 166 166 ; Nothing 167 167 ;-------------------------------------------------------------------- 168 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS168 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 169 169 ALIGN STRING_JUMP_ALIGN 170 170 Char_CharIsValid: … … 174 174 175 175 176 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS176 %ifdef EXCLUDE_FROM_XUB 177 177 %ifndef MODULE_HOTKEYS 178 178 %define EXCLUDE … … 201 201 ; Nothing 202 202 ;-------------------------------------------------------------------- 203 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS203 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 204 204 ALIGN STRING_JUMP_ALIGN 205 205 Char_ALtoLowerCaseLetter: … … 218 218 ; Nothing 219 219 ;-------------------------------------------------------------------- 220 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS220 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 221 221 ALIGN STRING_JUMP_ALIGN 222 222 Char_ALtoUpperCaseLetter: … … 237 237 ; Nothing 238 238 ;-------------------------------------------------------------------- 239 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS239 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 240 240 Char_ChangeCaseInAL: 241 241 xor al, 32 … … 254 254 ; Nothing 255 255 ;-------------------------------------------------------------------- 256 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS256 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_BIOSDRVS 257 257 ALIGN STRING_JUMP_ALIGN 258 258 Char_GetFilterFunctionToDXforNumericBaseInBX: -
trunk/Assembly_Library/Src/Time/TimerTicks.asm
r526 r592 48 48 ; CX 49 49 ;-------------------------------------------------------------------- 50 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS50 %ifndef EXCLUDE_FROM_XUB 51 51 %ifndef EXCLUDE_FROM_XTIDECFG 52 52 ALIGN JUMP_ALIGN … … 64 64 div cx ; Divide DX:AX by CX, Minutes to AX, remainder ticks to DX 65 65 ret 66 %endif ; EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS67 68 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG66 %endif ; EXCLUDE_FROM_XUB 67 68 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 69 69 ALIGN JUMP_ALIGN 70 70 TimerTicks_GetSecondsToAXandRemainderTicksToDXfromTicksInDX: … … 80 80 81 81 82 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS82 %ifdef EXCLUDE_FROM_XUB 83 83 %ifndef MODULE_BOOT_MENU 84 84 %define EXCLUDE … … 164 164 ; Nothing 165 165 ;-------------------------------------------------------------------- 166 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS166 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 167 167 ALIGN JUMP_ALIGN 168 168 TimerTicks_GetElapsedToAXandResetDSBX: … … 184 184 ; Nothing 185 185 ;-------------------------------------------------------------------- 186 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS186 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 187 187 ALIGN JUMP_ALIGN 188 188 TimerTicks_GetElapsedToAXfromDSBX: … … 202 202 ; Nothing 203 203 ;-------------------------------------------------------------------- 204 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS204 %ifdef EXCLUDE_FROM_XUB 205 205 %ifndef MODULE_BOOT_MENU OR MODULE_HOTKEYS 206 206 %define EXCLUDE -
trunk/Assembly_Library/Src/Util/Bit.asm
r526 r592 24 24 ; Bit_GetSetCountToCXfromDXAX 25 25 ; Parameters 26 ; DX:AX: 26 ; DX:AX: Source DWORD 27 27 ; Returns: 28 28 ; CX: Number of bits set in DX:AX … … 58 58 push ax 59 59 60 xor cx, cx60 mov cx, -1 61 61 ALIGN JUMP_ALIGN 62 .BitScanLoop: 62 .IncrementCX: 63 inc cx 64 .ShiftLoop: 63 65 shr ax, 1 64 jz SHORT .LastBitInCF 65 adc cl, ch 66 jmp SHORT .BitScanLoop 67 ALIGN JUMP_ALIGN 68 .LastBitInCF: 69 adc cl, ch 66 jc SHORT .IncrementCX 67 jnz SHORT .ShiftLoop 70 68 71 69 pop ax … … 95 93 ret 96 94 95 97 96 ;-------------------------------------------------------------------- 98 97 ; Bit_SetToAXfromIndexInCL … … 115 114 pop dx 116 115 ret 116 -
trunk/Assembly_Library/Src/Util/Math.asm
r589 r592 33 33 ; AX 34 34 ;-------------------------------------------------------------------- 35 %ifndef EXCLUDE_FROM_XTIDE _UNIVERSAL_BIOS OR EXCLUDE_FROM_XTIDECFG35 %ifndef EXCLUDE_FROM_XTIDECFG 36 36 ALIGN JUMP_ALIGN 37 37 Math_DivQWatSSBPbyCX: 38 %if 139 xor dx, dx40 mov ax, [bp+6] ; Load highest divident WORD to DX:AX41 div cx42 mov [bp+6], ax ; Store quotient43 44 mov ax, [bp+4]45 div cx46 mov [bp+4], ax47 48 mov ax, [bp+2]49 div cx50 mov [bp+2], ax51 52 mov ax, [bp]53 div cx54 mov [bp], ax55 ret56 %else ; ~157 ; This is about half the size compared to the above code but it's not tested which is why it's commented away.58 38 push di 59 39 mov di, 6 … … 65 45 dec di 66 46 dec di 67 jns .Next47 jns SHORT .Next 68 48 pop di 69 49 ret 70 %endif ; 171 50 %endif 72 51 … … 83 62 ; Nothing 84 63 ;-------------------------------------------------------------------- 85 %ifndef EXCLUDE_FROM_XTIDECFG 64 %ifndef EXCLUDE_FROM_XTIDECFG OR EXCLUDE_FROM_BIOSDRVS 86 65 ALIGN JUMP_ALIGN 87 66 Math_DivDXAXbyCX: -
trunk/Assembly_Library/Src/Util/Memory.asm
r580 r592 24 24 ; OPTIMIZE_STRING_OPERATION 25 25 ; Parameters 26 ; %1: Repeat instruction 27 ; %2: String instruction without size (for example MOVS and not MOVSB or MOVSW) 26 ; %1: String instruction without size (only MOVS and STOS is supported) 28 27 ; CX: Number of BYTEs to operate 29 ; DS:SI: Ptr to source data 28 ; DS:SI: Ptr to source data (for MOVS) 30 29 ; ES:DI: Ptr to destination 31 30 ; Returns: 31 ; CF: Cleared 32 ; CX: Zero 32 33 ; SI, DI: Updated by number of bytes operated 33 34 ; Corrupts registers: 34 35 ; Nothing 35 36 ;-------------------------------------------------------------------- 36 %macro OPTIMIZE_STRING_OPERATION 2 37 push cx 38 39 shr cx, 1 ; Operate with WORDs for performance 40 jz %%HandleRemainingByte 41 %1 %2w 42 %%HandleRemainingByte: 43 jnc SHORT %%OperationCompleted 44 %2b 45 46 ALIGN JUMP_ALIGN 47 %%OperationCompleted: 48 pop cx 37 %macro OPTIMIZE_STRING_OPERATION 1 38 shr cx, 1 39 rep %1w 40 eRCL_IM cx, 1 41 rep %1b 49 42 %endmacro 50 43 … … 57 50 ; ES:DI: Ptr to destination buffer 58 51 ; Returns: 52 ; CF: Cleared 59 53 ; SI, DI: Updated by number of bytes copied 60 54 ; Corrupts registers: 61 55 ; Nothing 62 56 ;-------------------------------------------------------------------- 63 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS57 %ifndef EXCLUDE_FROM_XUB 64 58 ALIGN JUMP_ALIGN 65 59 Memory_CopyCXbytesFromDSSItoESDI: 66 OPTIMIZE_STRING_OPERATION rep, movs 60 push cx 61 OPTIMIZE_STRING_OPERATION movs 62 pop cx 67 63 ret 68 64 %endif … … 77 73 ; Nothing 78 74 ; Corrupts registers: 79 ; Nothing75 ; CX 80 76 ;-------------------------------------------------------------------- 81 77 %ifdef INCLUDE_MENU_LIBRARY … … 102 98 ; DI: Updated by number of BYTEs stored 103 99 ; Corrupts registers: 104 ; AX 100 ; AX, CX 105 101 ;-------------------------------------------------------------------- 106 102 ALIGN JUMP_ALIGN … … 118 114 ; DI: Updated by number of BYTEs stored 119 115 ; Corrupts registers: 120 ; Nothing116 ; CX 121 117 ;-------------------------------------------------------------------- 122 ALIGN JUMP_ALIGN123 118 Memory_StoreCXbytesFromAccumToESDI: 124 OPTIMIZE_STRING_OPERATION rep,stos119 OPTIMIZE_STRING_OPERATION stos 125 120 ret 126 121 … … 135 130 ; AX 136 131 ;-------------------------------------------------------------------- 137 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS132 %ifndef EXCLUDE_FROM_XUB 138 133 ALIGN JUMP_ALIGN 139 134 Memory_ReserveCXbytesFromStackToDSSI: -
trunk/Assembly_Library/Src/Util/Reboot.asm
r526 r592 44 44 mov al, 0FEh ; System reset (AT+ keyboard controller) 45 45 out 64h, al ; Reset computer (AT+) 46 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS46 %ifndef EXCLUDE_FROM_XUB 47 47 %ifdef INCLUDE_TIME_LIBRARY 48 48 mov ax, 10 -
trunk/Assembly_Library/Src/Util/Registers.asm
r526 r592 59 59 %endif 60 60 61 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS61 %ifndef EXCLUDE_FROM_XUB 62 62 ALIGN JUMP_ALIGN 63 63 Registers_CopySSBPtoDSSI: … … 91 91 ; 92 92 ;-------------------------------------------------------------------- 93 %ifndef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOSOR EXCLUDE_FROM_XTIDECFG93 %ifndef EXCLUDE_FROM_XUB OR EXCLUDE_FROM_XTIDECFG 94 94 ALIGN JUMP_ALIGN 95 95 Registers_NormalizeESSI: 96 96 mov cx, si 97 and si, byte 0fh98 jmp Registers_NormalizeFinish97 and si, BYTE 0Fh 98 jmp SHORT Registers_NormalizeFinish 99 99 100 100 ALIGN JUMP_ALIGN 101 101 Registers_NormalizeESDI: 102 102 mov cx, di 103 and di, byte 0fh103 and di, BYTE 0Fh 104 104 ;;; fall-through 105 105 -
trunk/Assembly_Library/Src/Util/Size.asm
r580 r592 70 70 jae SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 71 71 add sp, BYTE 2 ; Clean return address from stack 72 xchg si, cx ; CX = Remainder (0...1023), SI = Magnitude73 72 74 73 ; Convert remainder to tenths 75 xchg bx, ax ; Store AX 76 mov al, 5 ; AH = 0 77 mul cx ; DX:AX = remainder * (10 / 2) 78 %ifdef USE_186 79 shr ax, 9 ; Divide AX by (1024 / 2) 80 %else 81 shr ax, 1 82 mov al, ah 83 cbw 84 %endif 85 xchg cx, ax ; CX = tenths 86 xchg ax, bx 74 mov bx, 640 75 xchg bx, ax ; BX = Size, AX = (10 / 1024) * 65536 76 mul si ; DX = Remainder * (10 / 1024) 77 xchg dx, ax 78 xchg cx, ax ; CX = Tenths, AX = Magnitude 79 xchg bx, ax ; AX = Size, BX = Magnitude 87 80 88 81 ; Convert magnitude to character 89 mov dl, [cs: si+.rgbMagnitudeToChar]82 mov dl, [cs:bx+.rgbMagnitudeToChar] 90 83 91 84 pop si … … 154 147 ; Nothing 155 148 ;-------------------------------------------------------------------- 156 %ifdef EXCLUDE_FROM_X TIDE_UNIVERSAL_BIOS149 %ifdef EXCLUDE_FROM_XUB 157 150 %ifdef USE_386 158 151 %define EXCLUDE -
trunk/Assembly_Library/Src/Util/Sort.asm
r526 r592 63 63 push cx 64 64 65 %ifdef CLD_NEEDED 65 66 cld 67 %endif 66 68 mov cx, di ; Restore item size to CX 67 69 xor ax, ax ; Zero starting index … … 191 193 192 194 cmp ax, dx ; If (left <= right) 193 jg SHORT ArrangeItemsInRangeAXtoDXtoBothSidesOfPivotInESDI195 jg SHORT .BreakLoopSinceAllItemsExamined 194 196 call SwapItemsFromIndexesAXandDX 195 197 inc ax
Note:
See TracChangeset
for help on using the changeset viewer.