-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOnes_Zeros.ewp
More file actions
49 lines (28 loc) · 912 Bytes
/
Ones_Zeros.ewp
File metadata and controls
49 lines (28 loc) · 912 Bytes
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
46
47
48
49
#include "msp430.h" ; #define controlled include file
ORG 0X3010
DW 0X2010
NAME main ; module name
PUBLIC main ; make the main label vissible
; outside this module
ORG 0FFFEh
DC16 init ; set reset vector to 'init' label
RSEG CSTACK ; pre-declaration of segment
RSEG CODE ; place program in 'CODE' segment
init: MOV #SFE(CSTACK), SP ; set up stack
main: NOP ; main program
MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer
CLR.W R5
MOV.W 0X3010(R5),R6
CLR.W R8
MOV.W #0X0010 ,R7
NEXT: RRC.W R6
JNC DOWN
INC R8
DOWN: DEC R7
JNZ NEXT
MOV.W #0X0010, R9
SUB.W R8, R9
MOV.W R9, 0X3020(R5)
MOV.W R8, 0X3030(R5)
JMP $
END