1984-12-17 11:03:13 +00:00
|
|
|
.define Printhex
|
1987-01-30 18:41:42 +00:00
|
|
|
.sect .text
|
|
|
|
.sect .rom
|
|
|
|
.sect .data
|
|
|
|
.sect .bss
|
|
|
|
.sect .text
|
1984-12-17 11:03:13 +00:00
|
|
|
|
|
|
|
! This subroutine print the contents of register A to the screen
|
|
|
|
! in hexadecimal form.
|
|
|
|
! The subroutine WRCH is a special one provided by the BBC
|
|
|
|
! microcomputer.
|
|
|
|
|
|
|
|
|
|
|
|
Printhex:
|
|
|
|
pha ! save A
|
|
|
|
lsr a
|
|
|
|
lsr a
|
|
|
|
lsr a
|
|
|
|
lsr a ! get four high bits
|
|
|
|
jsr 1f
|
|
|
|
pla ! restore A
|
1988-08-19 17:05:03 +00:00
|
|
|
and #0x0F ! get four low bits
|
1984-12-17 11:03:13 +00:00
|
|
|
jsr 1f
|
|
|
|
rts
|
|
|
|
1: sed ! print in hex
|
|
|
|
clc
|
1988-08-19 17:05:03 +00:00
|
|
|
adc #0x90
|
|
|
|
adc #0x40
|
1984-12-17 11:03:13 +00:00
|
|
|
cld
|
|
|
|
jmp WRCH
|
|
|
|
|
|
|
|
|