PPT Slide
A0 A
A1 X
A2 count=40
A3 A*X
A4 Y
A15
MVK .S 40, A2
LDH .D *MemA, A0
LDH .D *MemX, A1
MPY .M A0, A1, A3
ADD .L A3, A4, A4
SUB .L A2, 1, A2
B .S loop
STH .D A4, *MemY
32-bits
Data Memory
.M
.L
Register File A
.D
.S
loop:
.
.
.
3
Previous slide
Next slide
Back to first slide
View graphic version
Notes:
The correct instruction is subtract, .L, A2, one, A2. This subtracts one from the value of the contents of register A2, and places the result back in A2.