Changeset 580 in xtideuniversalbios for trunk/Assembly_Library/Src/Util
- Timestamp:
- Feb 19, 2015, 1:38:02 PM (10 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/Assembly_Library/Src/Util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Util/Memory.asm
r526 r580 159 159 ; CX 160 160 ;-------------------------------------------------------------------- 161 %ifndef EXCLUDE_FROM_XTIDECFG 161 %ifndef EXCLUDE_FROM_XTIDECFG OR NO_ATAID_VALIDATION 162 162 ALIGN JUMP_ALIGN 163 163 Memory_SumCXbytesFromESSItoAL: -
trunk/Assembly_Library/Src/Util/Size.asm
r567 r580 57 57 .MagnitudeConversionLoop: 58 58 ePUSH_T di, .MagnitudeConversionLoop; DI corrupted only on 8086/8088 build 59 %ifdef USE_186 59 60 test bx, bx ; Bits 32...47 in use? 60 61 jnz SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 61 62 test dx, dx ; Bits 16...31 in use? 62 63 jnz SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 64 %else ; 808x 65 mov di, bx 66 or di, dx 67 jnz SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX 68 %endif 63 69 cmp ax, 10000 ; 5 digits needed? 64 70 jae SHORT Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX … … 68 74 ; Convert remainder to tenths 69 75 xchg bx, ax ; Store AX 70 mov a x, 576 mov al, 5 ; AH = 0 71 77 mul cx ; DX:AX = remainder * (10 / 2) 72 78 %ifdef USE_186 … … 89 95 ret 90 96 .rgbMagnitudeToChar: db " kMGTP" 91 %endif92 97 93 98 ;-------------------------------------------------------------------- … … 95 100 ; Parameters: 96 101 ; BX:DX:AX: Size 97 ; CX: Magnitude in BYTE_MULTIPLES 102 ; CX: Magnitude in BYTE_MULTIPLES (must be 254 or less) 98 103 ; Returns: 99 104 ; BX:DX:AX: Size in magnitude … … 105 110 ALIGN UTIL_SIZE_JUMP_ALIGN 106 111 Size_DivideSizeInBXDXAXby1024andIncrementMagnitudeInCX: 112 inc cx ; Increment magnitude 113 mov si, 1023 114 and si, ax ; Remainder now in SI 115 ; Fall to Size_DivideSizeInBXDXAXby1024 116 %endif ; INCLUDE_MENU_LIBRARY 117 118 ;-------------------------------------------------------------------- 119 ; Size_DivideSizeInBXDXAXby1024 120 ; Parameters: 121 ; BX:DX:AX: Size 122 ; CX: Must be 255 or less 123 ; Returns: 124 ; BX:DX:AX: Size divided by 1024 125 ; Corrupts registers: 126 ; Nothing 127 ;-------------------------------------------------------------------- 128 ALIGN UTIL_SIZE_JUMP_ALIGN 129 Size_DivideSizeInBXDXAXby1024: 130 %ifdef USE_386 131 shrd ax, dx, 10 132 shrd dx, bx, 10 133 shr bx, 10 134 %else 107 135 push cx 108 xor si, si ; Zero remainder 109 mov cl, 10 ; Divide by 1024 136 mov cl, 10 110 137 ALIGN UTIL_SIZE_JUMP_ALIGN 111 138 .ShiftLoop: 112 139 call Size_DivideBXDXAXbyTwo 113 rcr si, 1 ; Update remainder114 140 loop .ShiftLoop 115 %ifdef USE_186 116 shr si, 6 ; Remainder to SI beginning 117 %else 118 mov cl, 6 119 shr si, cl 141 pop cx 120 142 %endif 121 pop cx122 inc cx ; Increment magnitude123 143 ret 124 144 … … 134 154 ; Nothing 135 155 ;-------------------------------------------------------------------- 156 %ifdef EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS 157 %ifdef USE_386 158 %define EXCLUDE 159 %endif 160 %ifdef MODULE_BOOT_MENU 161 %undef EXCLUDE 162 %endif 163 %endif 164 165 %ifndef EXCLUDE 136 166 ALIGN UTIL_SIZE_JUMP_ALIGN 137 167 Size_ConvertSectorCountInBXDXAXtoKiB: ; unused entrypoint ok … … 141 171 rcr ax, 1 ; ...kiB 142 172 ret 173 %endif 174 %undef EXCLUDE
Note:
See TracChangeset
for help on using the changeset viewer.