Omron C500-ASC04 Operation Manual page 112

Ascii unit
Table of Contents

Advertisement

Assembly Language Examples
130 '
*****
140
CDX$="13426285903581693417"
150
CDY$="57201674337291551930"
160
ANS$="00000000000000000000"
170
DEF USR0=&H2170
180
CX%=VARPTR(CDY$)+1
190
POKE &H2000, CX% \ 256
200
POKE &H2001, CX% MOD 256
210
CY%=VARPTR(CDY$)+1
220
POKE &H2002, CY% / 256
230
POKE &H2003, CY% MOD 256
240
ANS$=USR0(ANS$)
250
PRINT ANS$
260
END
Assembly Program
2170
E8
00
2172
EE
01
2174
FF
20
04
2177
FF
20
00
217A
EE
00
217C
FF
20
00
217F
FE
20
02
2182
EE
00
2184
FF
20
02
2187
FE
20
00
218A
A6
00
218C
08
218D
FF
20
00
2190
FE
20
02
2193
A1
00
2195
24
02
2197
A6
00
2199
08
219A
FF
20
02
219D
FE
20
04
102
'Original character string for comparison CDX$.
'Original character string for comparison CDY$.
'Result storage character string ANS$.
'Storage address definition of assembly language function.
'Calculation of the storage address of CDX$.
'Leftmost storage address of CDX$ --> Work area
'Rightmost storage address of CDX$ --> Work area
'Calculation of the storage address of CDY$.
'Leftmost storage address of CDY$ --> Work area
'Rightmost storage address of CDY$ --> Work area
'Execute assembly language function.
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.
LDAB
$00, X
LDX
$01, X
STX
$2004
LDX
$2000
LDX
$00, X
STX
$2000
LDX
$2002
LDX
$00, X
STX
$2002
LDX
$2000
LDAA
$00, X
INX
STX
$2000
LDX
$2002
CMPA
$00, X
BCC
$2199
LDAA
$00, X
INX
STX
$2002
LDX
$2004
*****
'The length of ANS$ ³ B register
'ANS$ address memory.
'SDX$ address memory.
'SDY$ address memory.
'SDX$ data read.
'Comparison with the data of SDY$.
'The data of SDX$ < the data of SDY$?
'SDY$ data read.
Section 6-4
$2000 to $2005.

Advertisement

Table of Contents
loading

Table of Contents