📄 lab3.asm
字号:
************************************************
* lab3.asm y= a1*x1+a2*x2+a3*x3+a4*x4 *
************************************************
.title "lab3.asm"
.mmregs
STACK .usect "STACK",10h ;allocate space for stack
.bss a,4 ;allocate 9 word for variates
.bss x,4
.bss y,1
.def start
; .def INT_2
.data
.mmregs
table: .word 1,2,3,4 ;data follows ...
.word 8,6,4,2
.text ;code follows ...
start: STM #0,SWWSR ;adds no wait states
STM #STACK+10h,SP ;set stack pointer
; RSBX INTM
; STM #0004h,IMR
STM #a,AR1 ;AR1 point to a
RPT #7 ;move 8 values
MVPD table,*AR1+ ;from program memory
;into data memory
CALL SUM ;call SUM subrotine
end: B end
;INT_2: NEG A
; RETE
SUM: STM #a,AR3 ;The subrotine lmplememt
STM #x,AR4 ;multiply--accumulate
RPTZ A,#3
MAC *AR3+,*AR4+,A
STL A,@y
RET
.end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -