ack/mach/6500/libem/printhex.s

33 lines
455 B
ArmAsm
Raw Normal View History

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