-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre2.s43
45 lines (42 loc) · 1.56 KB
/
pre2.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
45
#include <msp430xG46x.h> ; define controlled include file
ORG 1100h
avivID DW 0,8,4,8,8,9,7,3
asafID DW 1,3,3,9,0,4,2,9
IDsize DW 8
num DW 0
;---------------------------------------------------------------
RSEG CSTACK
RSEG CODE ; ORG 0x3100 - place program in 'CODE' segment in to Flash memory
Main MOV #SFE(CSTACK),SP
PUSH #avivID ; Pushing the argument addresses to the stack
PUSH #asafID
PUSH #IDsize
PUSH #num
CALL #Func ; call the xor function
L JMP L ; infinite loop
;---------------------------------------------------------------------------
Func POP R4 ; return Adress
POP R5 ; num
POp R6 ; IDsize
POP R7 ; asafID
POP R8 ; avivID
MOV @R5,R5
MOV @R6,R6
CLR R11
L1 MOV @R7,R9
MOV @R8,R10
XOR R9,R10
ADD R10,R11
INCD R7
INCD R8
MOV R11,num
DEC R6 ;counter IDsize
JNZ L1
PUSH R4 ;returns the return address
RET
;-------------------------------------------------------------------------------
COMMON INTVEC ; Interrupt Vectors
;-------------------------------------------------------------------------------
ORG RESET_VECTOR ; POR, ext. Reset
DW Main
END