Square Value and Accumulate Previous Product
SQRA
7-169
Assembly Language Instructions
Cycles for a Repeat (RPT) Execution of an SQRA Instruction
Program
Operand
ROM
DARAM
SARAM
External
DARAM
n
n
n
n+p
SARAM
n
n
n, n+1
†
n+p
External
n+nd
n+nd
n+nd
n+1+p+nd
† If the operand and the code are in the same SARAM block
Example 1
SQRA
DAT30
;(DP = 6: addresses 0300h–037Fh,
;PM = 0: no shift of product)
Before Instruction
After Instruction
Data Memory
Data Memory
31Eh
0Fh
31Eh
0Fh
TREG
3h
TREG
0Fh
PREG
12Ch
PREG
0E1h
ACC
X
1F4h
ACC
0
320h
C
C
Example 2
SQRA
*,AR4
;(PM = 0)
Before Instruction
After Instruction
ARP
3
ARP
4
AR3
31Eh
AR3
31Eh
Data Memory
Data Memory
31Eh
0Fh
31Eh
0Fh
TREG
3h
TREG
0Fh
PREG
12Ch
PREG
0E1h
ACC
X
1F4h
ACC
0
320h
C
C