![background image](http://html1.mh-extra.com/html/omron/c500-asc04/c500-asc04_operation-manual_743033112.webp)
102
130 ’
*****
*****
$2000 to $2005.
140
CDX$=”13426285903581693417”
’Original character string for comparison CDX$.
150
CDY$=”57201674337291551930”
’Original character string for comparison CDY$.
160
ANS$=”00000000000000000000”
’Result storage character string ANS$.
170
DEF USR0=&H2170
’Storage address definition of assembly language function.
180
CX%=VARPTR(CDY$)+1
’Calculation of the storage address of CDX$.
190
POKE &H2000, CX% \ 256
’Leftmost storage address of CDX$ --> Work area
200
POKE &H2001, CX% MOD 256
’Rightmost storage address of CDX$ --> Work area
210
CY%=VARPTR(CDY$)+1
’Calculation of the storage address of CDY$.
220
POKE &H2002, CY% / 256
’Leftmost storage address of CDY$ --> Work area
230
POKE &H2003, CY% MOD 256
’Rightmost storage address of CDY$ --> Work area
240
ANS$=USR0(ANS$)
’Execute assembly language function.
250
PRINT ANS$
260
END
Operation
Use VARPTR to obtain the addresses of parameters to be used in the assembly
language function program and store them in the work area in advance. In the
above example, three parameters are used in the assembly language function
program.
Note The addresses of parameters are calculated as integral parameters.
Parameters with the parameter name format “XXXX” will not be stored in the pa-
rameter area but the data in the source program will be used. Therefore, after the
execution of line 240, the value between the quotation marks in line 160 will
change.
Assembly Program
2170
E8
00
LDAB
$00, X
’The length of ANS$
³
B register
2172
EE
01
LDX
$01, X
2174
FF
20
04
STX
$2004
’ANS$ address memory.
2177
FF
20
00
LDX
$2000
217A
EE
00
LDX
$00, X
217C
FF
20
00
STX
$2000
’SDX$ address memory.
217F
FE
20
02
LDX
$2002
2182
EE
00
LDX
$00, X
2184
FF
20
02
STX
$2002
’SDY$ address memory.
2187
FE
20
00
LDX
$2000
218A
A6
00
LDAA
$00, X
’SDX$ data read.
218C
08
INX
218D
FF
20
00
STX
$2000
2190
FE
20
02
LDX
$2002
2193
A1
00
CMPA
$00, X
’Comparison with the data of SDY$.
2195
24
02
BCC
$2199
’The data of SDX$ < the data of SDY$?
2197
A6
00
LDAA
$00, X
’SDY$ data read.
2199
08
INX
219A
FF
20
02
STX
$2002
219D
FE
20
04
LDX
$2004
Assembly Language Examples
Summary of Contents for C500-ASC04
Page 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Page 5: ...iv ...
Page 7: ...vi ...