Hardware Reference
In-Depth Information
ldd
#cs
jsr
[strlen,PCR]
char *strcpy(char *s1, char *s2);
Pointer address: $EE9A
This function copies the string pointed to by s2 into the string pointed to by s1 and returns
a pointer to s1. The following instruction sequence copies the string pointed to by s1 to the
memory location pointed to by s2 :
strcpy
equ
$EE9A
s1
db
“……”
s2
ds.b
ldd
#s2
pshd
ldd
#s1
jsr
[strcpy,PCR]
leas
2,sp
void far out2hex(unsigned int num);
Pointer address: $EE9C
This function displays the lower byte of num on the terminal screen as two hex characters.
The upper byte of num is ignored. The function out2hex() simply calls printf() with a format string
of “%2.2X.”
The following instruction sequence outputs the number in accumulator B as two hex digits
to the terminal screen:
out2hex
equ
$EE9C
data
ds.b
20
ldab
data
clra
call
[out2hex,PCR]
void far out4hex(unsigned int num);
Pointer address: $EEA0
This function displays num on the control terminal as four hex characters. The function
out4hex() simply calls printf() with a format string of “%4.4X.” The following instruction sequence
outputs the 16-bit number stored at memory location num as four hex digits:
out4hex
equ
$EEA0
num
db
ldd
num
call
[out4hex,PCR]
 
Search WWH ::




Custom Search