-
Notifications
You must be signed in to change notification settings - Fork 0
/
hexUpdate.s
97 lines (80 loc) · 1.53 KB
/
hexUpdate.s
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
INCLUDE core_cm4_constants.s ; Load Constant Definitions
INCLUDE stm32l476xx_constants.s
IMPORT USART2_Write
AREA hexUpdate, CODE, READONLY
EXPORT hex_update ; make __main visible to linker
ENTRY
hex_update PROC
CMP r11, #0x1
BEQ hex_1
CMP r11, #0x2
BEQ hex_2
CMP r11, #0x4
BEQ hex_3
CMP r11, #0x8
BEQ hex_4
hex_1
LDR r0, =GPIOA_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x3
ORR r1, #0x2
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOC_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x800
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOD_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x4
STR r1, [r0, #GPIO_ODR]
B hex_endl
hex_2
LDR r0, =GPIOA_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x3
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOC_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x800
ORR r1, #0x800
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOD_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x4
STR r1, [r0, #GPIO_ODR]
B hex_endl
hex_3
LDR r0, =GPIOA_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x3
ORR r1, #0x2
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOC_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x800
ORR r1, #0x800
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOD_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x4
STR r1, [r0, #GPIO_ODR]
B hex_endl
hex_4
LDR r0, =GPIOA_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x3
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOC_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x800
STR r1, [r0, #GPIO_ODR]
LDR r0, =GPIOD_BASE
LDR r1, [r0, #GPIO_ODR]
BIC r1, #0x4
ORR r1, #0x4
STR r1, [r0, #GPIO_ODR]
B hex_endl
hex_endl
BX LR
ENDP
END