6 - 38
Examples
6.15.3. 8bit BCD adder
BM00.00
Z1
BM00.01
Z2
Z3
BM00.02
8bit
BCD
adder
Program
****** BCD correction ******************************
CLR LBM00.01
;marker for BCD correction
L
BM00.00
;Z1 1st summand
A
%00001111 ;extract upper 4 bits
=
LBM00.00
;1st decade of this
L
BM00.01
;Z2 2nd summand
A
%00001111 ;1st decade of this
ADD LBM00.00
CMP 10
;BCD correction necessary?
JP<
ADDIT
;jump if not
L
6
;load correction
=
LBM00.01
;value if yes
****** Addition ***********************************
ADDIT
L
LBM00.01
ADD BM00.00
;Z1 1st summand
ADD BM00.01
;Z2 2nd summand
=
BM00.02
;Z3 sum
Z1:
1st summand 8bit
0-99
BM00.00
Z2:
2nd summand 8bit 0-99
BM00.01
Z3:
sum
8bit
0-99
BM00.02
Summary of Contents for KUAX 680C
Page 10: ...Contents 8 Table of contents...
Page 12: ...1 2 Introduction...
Page 90: ...4 36 Description of the commands...
Page 99: ...4 45 Software 4 7 10 Module hierarchy example for different module calls...
Page 102: ...5 2 Networking...
Page 132: ...6 30 Examples...
Page 160: ...A 4 Appendix...
Page 164: ...C 2 Appendix...
Page 180: ...Index 6 Index...