Changeset 94 for trunk/bootcode/regular/videoio.asm
- Timestamp:
- Apr 8, 2017, 12:26:36 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/videoio.asm
r67 r94 200 200 VideoIO_PrintSingleChar EndP 201 201 202 203 IF 0 204 ; Print dec-byte to screen 205 ; This outputs 1 to 3 characters 206 ; In: AL - byte to send 207 ; Out: AL - byte sent 208 ; Destroyed: None 209 VideoIO_PrintDecByte Proc Near Uses ax 210 call CONV_BinToPBCD ; Convert to PBCD 211 mov dx, ax ; Save PBCD value 212 shr ah, 4 ; Move digit count to low nibble 213 cmp ah, 3 ; Less than 3 digits ? 214 jb @F ; Yep, skip digit with index 2 215 mov al, dh ; Get byte with digit 216 and al, 0fh ; Mask it out 217 add al, '0' ; To ASCII 218 call VideoIO_PrintSingleChar 219 @@: 220 shr dh, 4 ; Move digit count to low nibble 221 cmp dh, 2 ; Less that 2 digits ? 222 jb @F ; Yep, skip digit with index 1 223 mov al, dl ; Get byte with digit 224 shr al, 4 ; Move to lower nibble 225 add al, '0' ; To ASCII 226 call VideoIO_PrintSingleChar 227 @@: 228 mov al, dl ; Get byte with digit 229 and al, 0fh ; Mask it out 230 add al, '0' ; To ASCII 231 call VideoIO_PrintSingleChar 232 ret 233 VideoIO_PrintDecByte EndP 234 ENDIF 202 235 203 236
Note:
See TracChangeset
for help on using the changeset viewer.