104
610
IF LEN(FCS$)=1 THEN FCS$=”0”+FCS$
620
ANS$=DA$+FCS$
630
PRINT ANS$
640
END
As seen above, there is a program which is calculated using BASIC instructions
in lines 500 to 640 for purposes of comparison.
The execution times required by the assembly language functions and BASIC
instructions are as follows:
Assembly language functions (lines 140 to 220): 29 ms
BASIC instructions (lines 540 to 630):
160 ms
Assembly Program
2100
E6
00
LDAB
$00, X
’The length of DA$
³
B register
2102
EE
01
LDX
$01, X
’The storage of DA$
³
X register
2104
4F
CLRA
2105
A8
00
EORA
$00, X
’Calculate the EOR.
2107
08
INX
2108
5A
DECB
2109
26
FA
BNE
$2105
’Repeat for the number of character strings.
210B
16
TAB
210C
C4
0F
ANDB
#$0F
’ASCII conversion of the FCS value.
210E
C1
0A
CMPB
#$0A
2110
25
02
BCS
$2114
’If the rightmost digit of the FCS
y
10
2112
CB
09
ADDB
#$07
’ THEN convert to A to F.
2114
CB
30
ADDB
#$30
2116
44
LSRA
2117
44
LSRA
2118
44
LSRA
2119
44
LSRA
211A
81
0A
CMPA
#$0A
211C
25
02
BCS
$2120
’If the leftmost digit of the FCS
y
10
211E
8B
09
ADDA
#$07
’ THEN convert to A to F.
2120
8B
30
ADDA
#$30
2122
FE
20
00
LDX
$2000
2125
EE
00
LDX
$00, X
2127
ED
00
STD
$00, X
’Store the data in the FCS$ area.
2129
39
RTS
Work Area
$2000
$2001
Storage address memory area of parameter FCS$.
Note The address of parameter FCS$ is stored in $2000 and $2001 before retrieving
the assembly program.
Assembly Language Examples
Содержание C500-ASC04
Страница 1: ...C500 ASC04 ASCII Unit Operation Manual Revised February 2001 ...
Страница 5: ...iv ...
Страница 7: ...vi ...