Changeset 142 in xtideuniversalbios
- Timestamp:
- Mar 14, 2011, 5:17:47 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/Assembly_Library
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Inc/Debug.inc
r45 r142 1 ; File name : Debug.inc2 1 ; Project name : Assembly Library 3 ; Created date : 8.8.20104 ; Last update : 29.9.20105 ; Author : Tomi Tilli6 2 ; Description : Debugging macros. 7 3 %ifndef DEBUG_INC … … 28 24 mov bx, %2 29 25 CALL_DISPLAY_LIBRARY PrintWordFromAXwithBaseInBX 26 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 30 27 call Keyboard_RemoveAllKeystrokesFromBuffer 28 %endif 31 29 call Keyboard_GetKeystrokeToAXandWaitIfNecessary 32 30 … … 54 52 mov al, %1 55 53 CALL_DISPLAY_LIBRARY PrintCharacterFromAL 54 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 56 55 call Keyboard_RemoveAllKeystrokesFromBuffer 56 %endif 57 57 call Keyboard_GetKeystrokeToAXandWaitIfNecessary 58 58 … … 95 95 %macro WAIT_ANY_KEY_TO_CONTINUE 0 96 96 push ax 97 %ifndef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 97 98 call Keyboard_RemoveAllKeystrokesFromBuffer 99 %endif 98 100 call Keyboard_GetKeystrokeToAXandWaitIfNecessary 99 101 pop ax … … 101 103 102 104 103 104 105 %endif ; DEBUG_INC -
trunk/Assembly_Library/Src/Util/Size.asm
r141 r142 32 32 ALIGN JUMP_ALIGN 33 33 Size_GetSizeToAXAndCharToDLfromBXDXAXwithMagnitudeInCX: 34 %ifndef USE_186 ; If 8086/8088 35 push di 36 %endif 34 37 push si 35 38 36 39 ALIGN JUMP_ALIGN 37 40 .MagnitudeConversionLoop: 38 ePUSH_T si, .MagnitudeConversionLoop39 test bx, bx ; Bits 32...47 in use?41 ePUSH_T di, .MagnitudeConversionLoop; DI corrupted only on 8086/8088 build 42 test bx, bx ; Bits 32...47 in use? 40 43 jnz SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 41 test dx, dx ; Bits 16...31 in use?44 test dx, dx ; Bits 16...31 in use? 42 45 jnz SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 43 cmp ax, 10000 ; 5 digits needed?46 cmp ax, 10000 ; 5 digits needed? 44 47 jae SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 45 add sp, BYTE 2 ; Clean return address from stack46 xchg si, cx ; CX = Remainder (0...1023), SI = Magnitude48 add sp, BYTE 2 ; Clean return address from stack 49 xchg si, cx ; CX = Remainder (0...1023), SI = Magnitude 47 50 48 51 ; Convert remainder to tenths 49 xchg bx, ax ; Store AX52 xchg bx, ax ; Store AX 50 53 mov ax, 10 51 mul cx ; DX:AX = remainder * 1052 eSHR_IM ax, 10 ; Divide AX by 102453 xchg cx, ax ; CX = tenths54 mul cx ; DX:AX = remainder * 10 55 eSHR_IM ax, 10 ; Divide AX by 1024 56 xchg cx, ax ; CX = tenths 54 57 xchg ax, bx 55 58 … … 58 61 59 62 pop si 63 %ifndef USE_186 64 pop di 65 %endif 60 66 ret 61 67 .rgbMagnitudeToChar: db " kMGTP"
Note:
See TracChangeset
for help on using the changeset viewer.