Changeset 592 in xtideuniversalbios for trunk/Assembly_Library/Inc
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (6 years ago)
- Location:
- trunk/Assembly_Library/Inc
- Files:
-
- 8 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
Note:
See TracChangeset
for help on using the changeset viewer.