home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
program
/
compiler
/
nasm20b
/
nasm_src
/
lib
/
src
/
utoh.s65
< prev
Wrap
Text File
|
1993-01-19
|
785b
|
45 lines
.zext _string1
.zext _value
; --------------------------------------------------------------
; convert unsigned word to hex ascii
; value in _VALUE
; return in _STRING1
; --------------------------------------------------------------
utoh:
lda _value+1
jsr utob
ldy #2
lda _value
.byte $2C ;; makes a BIT
; --------------------------------------------------------------
; convert unsigned byte to hex ascii
; value in A
; return in _STRING1
; --------------------------------------------------------------
utob
ldy #0
:utob:
pha
iny
jsr :cnv
dey
pla
lsr a
lsr a
lsr a
lsr a
:cnv
and #$F
tax
clc
lda _hextable,x
sta (_string1),y
rts
_hextable:
.byte "0123456789ABCDEF"