Base 16 numbers needing a to f: Difference between revisions

m
No edit summary
Line 55:
bcc dontPrintThis
 
JSR printD0 ;unimplemented printing routine.
 
 
dontPrintThis: ;loop overhead time
Line 89 ⟶ 90:
RTS
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
printD0:
 
MOVE.W D0,D1
JSR UnpackNibbles
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CMP.B #$0A,D2 ;compare to $0A
BCC noCorrectHex2 ;the letters A-F are not next to 0-9 in ascii
ADD.B #$07,D2 ;in fact they are 7 characters away!
 
noCorrectHex2:
ADD.B #$30,D2 ;now D2 equals the ascii equivalent of its numeric value.
JSR PrintChar ;unimplemented hardware-dependent print routine.
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CMP.B #$0A,D3
BCC noCorrectHex3
ADD.B #$07,D3
noCorrectHex3:
 
ADD.B #$30,D3
JSR PrintChar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CMP.B #$0A,D4
BCC noCorrectHex4
ADD.B #$07,D4
noCorrectHex4:
 
ADD.B #$30,D4
JSR PrintChar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CMP.B #$0A,D5
BCC noCorrectHex5
ADD.B #$07,D5
noCorrectHex5:
 
ADD.B #$30,D5
JSR PrintChar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
move.b #$20,d6 ;ascii for spacebar
jsr PrintChar ;unimplemented hardware-dependent print routine.
rts
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</lang>
 
1,489

edits