ack/mach/6500/libem/printhex.s
1987-01-30 18:41:42 +00:00

33 lines
455 B
ArmAsm

.define Printhex
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! 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
and #0Fh ! get four low bits
jsr 1f
rts
1: sed ! print in hex
clc
adc #90h
adc #40h
cld
jmp WRCH