?login_element?
?pathlinks? – Rev 1424
Blame |
Last modification |
View Log
| Download
;Write a Hex number in BCHL, CHL, HL or A to memory at DE
sphex8
DI
LD A,B
;Big multidecker fall-through...
CALL sphex2
sphex6
LD A,C
CALL sphex2
sphex4
LD A,H
CALL sphex2
LD A,L
sphex2
PUSH AF
RRCA
RRCA
RRCA
RRCA
CALL sphex1
POP AF
sphex1
AND #0F
CP #0A
JR C,sph1a
ADD A,7
sph1a
ADD A,"0"
LD (DE),A
INC DE
EI
RET
;;;;
;Write decimal numbers in HL to memory at DE
cphlbc
PUSH HL
AND A
SBC HL,BC
POP HL
RET
spdec
DI
LD BC,10000
CALL cphlbc
JR NC,spdec5
LD BC,1000
CALL cphlbc
JR NC,spdec4
LD BC,100
CALL cphlbc
JR NC,spdec3
LD A,L
CP 10
JR NC,spdec2 ;>=10
JR spdec1
spdec5
LD BC,10000
CALL dodec
spdec4
LD BC,1000
CALL dodec
spdec3
LD BC,100
CALL dodec
spdec2
LD BC,10
CALL dodec
spdec1
LD A,L
ADD A,"0"
LD (DE),A
INC DE
EI
RET
dodec
LD A,"0"
ddlp
INC A
AND A
SBC HL,BC
JR NC,ddlp
DEC A
ADD HL,BC
LD (DE),A
INC DE
RET