Omron SYSMAC C200H-ASC02 Operation Manual page 113

Ascii unit
Hide thumbs Also See for SYSMAC C200H-ASC02:
Table of Contents

Advertisement

Assembly Language Example
Assembly Program
$2000 PSHA
PSHB
PSHX
LDD
#$2600
STD
$2500
LDD
#$2700
STD
$2502
LDAB 0,X
LDX
1,X
STX
$2504
$2016 LDX
$2504
LDAA 0,X
INX
STX
$2504
CMPA #$30
BLT
$2032
CMPA #$39
BHI
$2032
LDX
$2500
STAA
0,X
INX
STX
$2500
BRA
$203B
$2032 LDX
$2502
STAA
0,X
INX
STX
$2502
$203B DECB
BNE
$2016
LDD
$2500
LDX
#$2600
STX
$2504
104
Assembly language program operation:
The numbers and characters are separated and stored in the number stor-
age buffer and the character storage buffer, respectively. Then numeric
strings and character strings are restored as the original character variables.
This program has no practical application; it is an example only.
Saves registers
Sets first address of buffer 1 in pointer 1
Sets first address of buffer 2 in pointer 2
Number of characters to GET
Character variable first address GET
DOUNTIL (number of times equal to the number of characters)
Character GET
Character variable address pointer + 1
IF ($30 min.)
THEN
IF (numeral less than $39)
THEN
Stores numeral in buffer 1
ENDIF
Stores character in buffer 2
Updates counter
ENDDO
Transfer from buffer 1 to a character variable
Section 6-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents