-
Notifications
You must be signed in to change notification settings - Fork 0
/
task2.s43
44 lines (37 loc) · 1.22 KB
/
task2.s43
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <msp430xG46x.h> ; define controlled include file
ORG 1100h
id1 DW 0,8,4,8,8,9,7,3
id2 DW 1,3,3,9,0,4,2,9
size DW 8
mod4_ID1 DS16 8
mod4_ID2 DS16 8
;---------------------------------------------------------------
RSEG CSTACK
RSEG CODE ; ORG 0x3100 - place program in 'CODE' segment in to Flash memory
Main MOV #SFE(CSTACK),SP
PUSH #id1
PUSH size
PUSH #mod4_ID1
CALL #Func
PUSH #id2
PUSH size
PUSH #mod4_ID2
CALL #Func
L JMP L
Func MOV 2(SP), R4 ;mod4_/id1 -> id2
MOV 4(SP), R5 ;size
MOV 6(SP), R6 ;id1 -> id2
Loop MOV @R6+,R7
AND #3,R7 ;mod4
MOV R7,0(R4)
INCD R4
DEC R5
JZ Finish
JMP Loop
Finish RET
;-------------------------------------------------------------------------------
COMMON INTVEC ; Interrupt Vectors
;-------------------------------------------------------------------------------
ORG RESET_VECTOR ; POR, ext. Reset
DW Main
END