Changeset 580 in xtideuniversalbios for trunk/Assembly_Library/Src/Display/DisplayPrint.asm
- Timestamp:
- Feb 19, 2015, 1:38:02 PM (10 years ago)
- google:author:
- krille_n_@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Assembly_Library/Src/Display/DisplayPrint.asm
r567 r580 125 125 DisplayPrint_WordFromAXWithBaseInBX: 126 126 push cx 127 push bx128 127 129 128 xor cx, cx 130 129 ALIGN DISPLAY_JUMP_ALIGN 131 130 .DivideLoop: 131 inc cx ; Increment character count 132 132 xor dx, dx ; DX:AX now holds the integer 133 133 div bx ; Divide DX:AX by base 134 134 push dx ; Push remainder 135 inc cx ; Increment character count136 135 test ax, ax ; All divided? 137 136 jnz SHORT .DivideLoop ; If not, loop 138 137 138 ALIGN DISPLAY_JUMP_ALIGN 139 139 PrintAllPushedDigits: ; Unused entrypoint OK 140 mov bx, g_rgcDigitToCharacter141 ALIGN DISPLAY_JUMP_ALIGN142 140 .PrintNextDigit: 143 141 pop ax ; Pop digit 144 cs xlatb 142 cmp al, 10 ; Convert binary digit in AL to ASCII hex digit ('0'-'9' or 'A'-'F') 143 sbb al, 69h 144 das 145 145 call DisplayPrint_CharacterFromAL 146 146 loop .PrintNextDigit 147 147 148 pop bx 149 pop cx 150 ret 151 152 g_rgcDigitToCharacter: db "0123456789ABCDEF" 153 154 %endif ; MODULE_STRINGS_COMPRESSED 148 pop cx 149 ret 150 %endif ; ~MODULE_STRINGS_COMPRESSED 155 151 156 152 ;-------------------------------------------------------------------- … … 170 166 DisplayPrint_QWordFromSSBPwithBaseInBX: 171 167 push cx 172 push bx173 168 174 169 mov cx, bx ; CX = Integer base … … 181 176 cmp WORD [bp], BYTE 0 ; All divided? 182 177 jne SHORT .DivideLoop ; If not, loop 183 mov cx, bx ; Character count to CX178 xchg cx, bx ; Character count to CX, Integer base to BX 184 179 jmp SHORT PrintAllPushedDigits 185 180 %endif
Note:
See TracChangeset
for help on using the changeset viewer.