330 lines
11 KiB
Plaintext
330 lines
11 KiB
Plaintext
|
|
|
|
|
|
ARM Macro Assembler Page 1
|
|
|
|
|
|
1 00000000 ; ------------------------------------------------------
|
|
------------
|
|
2 00000000 ; -- _____ ______ _____
|
|
-
|
|
3 00000000 ; -- |_ _| | ____|/ ____|
|
|
-
|
|
4 00000000 ; -- | | _ __ | |__ | (___ Institute of Embedded
|
|
Systems -
|
|
5 00000000 ; -- | | | '_ \| __| \___ \ Zurich University of
|
|
-
|
|
6 00000000 ; -- _| |_| | | | |____ ____) | Applied Sciences
|
|
-
|
|
7 00000000 ; -- |_____|_| |_|______|_____/ 8401 Winterthur, Switz
|
|
erland -
|
|
8 00000000 ; ------------------------------------------------------
|
|
------------
|
|
9 00000000 ; --
|
|
10 00000000 ; -- add64.s
|
|
11 00000000 ; --
|
|
12 00000000 ; -- CT1 P05 64 Bit Addition
|
|
13 00000000 ; --
|
|
14 00000000 ; -- $Id: add64.s 3712 2016-10-20 08:44:57Z kesr $
|
|
15 00000000 ; ------------------------------------------------------
|
|
------------
|
|
16 00000000 ;Directives
|
|
17 00000000 PRESERVE8
|
|
18 00000000 THUMB
|
|
19 00000000
|
|
20 00000000 ; ------------------------------------------------------
|
|
------------
|
|
21 00000000 ; -- Symbolic Literals
|
|
22 00000000 ; ------------------------------------------------------
|
|
------------
|
|
23 00000000 60000200
|
|
ADDR_DIP_SWITCH_31_0
|
|
EQU 0x60000200
|
|
24 00000000 60000210
|
|
ADDR_BUTTONS
|
|
EQU 0x60000210
|
|
25 00000000 60000340
|
|
ADDR_LCD_RED
|
|
EQU 0x60000340
|
|
26 00000000 60000342
|
|
ADDR_LCD_GREEN
|
|
EQU 0x60000342
|
|
27 00000000 60000344
|
|
ADDR_LCD_BLUE
|
|
EQU 0x60000344
|
|
28 00000000 60000330
|
|
ADDR_LCD_BIN
|
|
EQU 0x60000330
|
|
29 00000000 00000001
|
|
MASK_KEY_T0
|
|
EQU 0x00000001
|
|
30 00000000 0000FFFF
|
|
BACKLIGHT_FULL
|
|
EQU 0xffff
|
|
31 00000000
|
|
32 00000000 ; ------------------------------------------------------
|
|
|
|
|
|
|
|
ARM Macro Assembler Page 2
|
|
|
|
|
|
------------
|
|
33 00000000 ; -- myCode
|
|
34 00000000 ; ------------------------------------------------------
|
|
------------
|
|
35 00000000 AREA MyCode, CODE, READONLY
|
|
36 00000000
|
|
37 00000000 main PROC
|
|
38 00000000 EXPORT main
|
|
39 00000000
|
|
40 00000000 user_prog
|
|
41 00000000 4F0F LDR R7, =ADDR_LCD_BLUE ; load base
|
|
address of pwm blue
|
|
|
|
42 00000002 4E10 LDR R6, =BACKLIGHT_FULL ; backlight
|
|
full blue
|
|
43 00000004 803E STRH R6, [R7] ; write pwm registe
|
|
r
|
|
44 00000006
|
|
45 00000006 4810 LDR R0, =0 ; lower 32 bits of
|
|
total sum
|
|
46 00000008 490F LDR R1, =0 ; higher 32 bits of
|
|
total sum
|
|
47 0000000A endless
|
|
48 0000000A F000 F80D BL waitForKey ; wait for key T0 t
|
|
o be pressed
|
|
49 0000000E
|
|
50 0000000E ; STUDENTS: To be programmed
|
|
51 0000000E
|
|
52 0000000E 4A0F LDR R2, =ADDR_DIP_SWITCH_31_0
|
|
53 00000010 6812 LDR R2, [R2] ; Read Values of Di
|
|
p Switches
|
|
54 00000012
|
|
55 00000012
|
|
56 00000012 1880 ADDS R0, R0, R2 ; Add Value of Dip
|
|
Siwtches to R0
|
|
57 00000014
|
|
58 00000014 F3EF 8400 MRS R4, APSR ; Read Flags to R4
|
|
59 00000018 0F64 LSRS R4, R4, #29 ; Move Flags 24 Bit
|
|
right
|
|
60 0000001A 4D0D LDR R5, =MASK_KEY_T0
|
|
61 0000001C 402C ANDS R4, R4, R5 ; Mask only carry F
|
|
lag
|
|
62 0000001E 1909 ADDS R1, R1, R4 ; Add Carry Flag to
|
|
R1
|
|
63 00000020
|
|
64 00000020
|
|
65 00000020 4B0C LDR R3, =ADDR_LCD_BIN
|
|
66 00000022 6018 STR R0, [R3, #0] ; write lower 32 B
|
|
its to LCD Display
|
|
67 00000024 6059 STR R1, [R3, #4] ; write higher 32
|
|
Bits to LCD Display
|
|
|
|
68 00000026
|
|
69 00000026
|
|
70 00000026
|
|
71 00000026
|
|
72 00000026 ; END: To be programmed
|
|
73 00000026 E7F0 B endless
|
|
74 00000028 ALIGN
|
|
|
|
|
|
|
|
ARM Macro Assembler Page 3
|
|
|
|
|
|
75 00000028
|
|
76 00000028
|
|
77 00000028 ;----------------------------------------------------
|
|
78 00000028 ; Subroutines
|
|
79 00000028 ;----------------------------------------------------
|
|
80 00000028
|
|
81 00000028 ; wait for key to be pressed and released
|
|
82 00000028 waitForKey
|
|
83 00000028 B407 PUSH {R0, R1, R2}
|
|
84 0000002A 490B LDR R1, =ADDR_BUTTONS ; laod base a
|
|
ddress of keys
|
|
85 0000002C 4A08 LDR R2, =MASK_KEY_T0
|
|
; load key mask T0
|
|
86 0000002E
|
|
87 0000002E waitForPress
|
|
88 0000002E 7808 LDRB R0, [R1] ; load key values
|
|
89 00000030 4210 TST R0, R2 ; check, if key T0
|
|
is pressed
|
|
90 00000032 D0FC BEQ waitForPress
|
|
91 00000034
|
|
92 00000034 waitForRelease
|
|
93 00000034 7808 LDRB R0, [R1] ; load key values
|
|
94 00000036 4210 TST R0, R2 ; check, if key T0
|
|
is released
|
|
95 00000038 D1FC BNE waitForRelease
|
|
96 0000003A
|
|
97 0000003A BC07 POP {R0, R1, R2}
|
|
98 0000003C 4770 BX LR
|
|
99 0000003E 00 00 ALIGN
|
|
100 00000040
|
|
101 00000040 ; ------------------------------------------------------
|
|
------------
|
|
102 00000040 ; End of code
|
|
103 00000040 ; ------------------------------------------------------
|
|
------------
|
|
104 00000040 ENDP
|
|
105 00000040 END
|
|
60000344
|
|
0000FFFF
|
|
00000000
|
|
60000200
|
|
00000001
|
|
60000330
|
|
60000210
|
|
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M0 --depend=.\bu
|
|
ild\add64.d -o.\build\add64.o -I.\RTE\_Target_1 -IC:\Users\roman\AppData\Local\
|
|
Arm\Packs\InES\CTBoard14_DFP\4.0.2\Device\Include -IC:\Users\roman\AppData\Loca
|
|
l\Arm\Packs\InES\CTBoard14_DFP\4.0.2\Device\Include\m0 -IC:\Users\roman\AppData
|
|
\Local\Arm\Packs\InES\CTBoard14_DFP\4.0.2\HAL\Include --predefine="__EVAL SETA
|
|
1" --predefine="__UVISION_VERSION SETA 537" --predefine="_RTE_ SETA 1" --predef
|
|
ine="_RTE_ SETA 1" --list=.\build\add64.lst app\add64.s
|
|
|
|
|
|
|
|
ARM Macro Assembler Page 1 Alphabetic symbol ordering
|
|
Relocatable symbols
|
|
|
|
MyCode 00000000
|
|
|
|
Symbol: MyCode
|
|
Definitions
|
|
At line 35 in file app\add64.s
|
|
Uses
|
|
None
|
|
Comment: MyCode unused
|
|
endless 0000000A
|
|
|
|
Symbol: endless
|
|
Definitions
|
|
At line 47 in file app\add64.s
|
|
Uses
|
|
At line 73 in file app\add64.s
|
|
Comment: endless used once
|
|
main 00000000
|
|
|
|
Symbol: main
|
|
Definitions
|
|
At line 37 in file app\add64.s
|
|
Uses
|
|
At line 38 in file app\add64.s
|
|
Comment: main used once
|
|
user_prog 00000000
|
|
|
|
Symbol: user_prog
|
|
Definitions
|
|
At line 40 in file app\add64.s
|
|
Uses
|
|
None
|
|
Comment: user_prog unused
|
|
waitForKey 00000028
|
|
|
|
Symbol: waitForKey
|
|
Definitions
|
|
At line 82 in file app\add64.s
|
|
Uses
|
|
At line 48 in file app\add64.s
|
|
Comment: waitForKey used once
|
|
waitForPress 0000002E
|
|
|
|
Symbol: waitForPress
|
|
Definitions
|
|
At line 87 in file app\add64.s
|
|
Uses
|
|
At line 90 in file app\add64.s
|
|
Comment: waitForPress used once
|
|
waitForRelease 00000034
|
|
|
|
Symbol: waitForRelease
|
|
Definitions
|
|
At line 92 in file app\add64.s
|
|
Uses
|
|
At line 95 in file app\add64.s
|
|
Comment: waitForRelease used once
|
|
7 symbols
|
|
|
|
|
|
|
|
ARM Macro Assembler Page 1 Alphabetic symbol ordering
|
|
Absolute symbols
|
|
|
|
ADDR_BUTTONS 60000210
|
|
|
|
Symbol: ADDR_BUTTONS
|
|
Definitions
|
|
At line 24 in file app\add64.s
|
|
Uses
|
|
At line 84 in file app\add64.s
|
|
Comment: ADDR_BUTTONS used once
|
|
ADDR_DIP_SWITCH_31_0 60000200
|
|
|
|
Symbol: ADDR_DIP_SWITCH_31_0
|
|
Definitions
|
|
At line 23 in file app\add64.s
|
|
Uses
|
|
At line 52 in file app\add64.s
|
|
Comment: ADDR_DIP_SWITCH_31_0 used once
|
|
ADDR_LCD_BIN 60000330
|
|
|
|
Symbol: ADDR_LCD_BIN
|
|
Definitions
|
|
At line 28 in file app\add64.s
|
|
Uses
|
|
At line 65 in file app\add64.s
|
|
Comment: ADDR_LCD_BIN used once
|
|
ADDR_LCD_BLUE 60000344
|
|
|
|
Symbol: ADDR_LCD_BLUE
|
|
Definitions
|
|
At line 27 in file app\add64.s
|
|
Uses
|
|
At line 41 in file app\add64.s
|
|
Comment: ADDR_LCD_BLUE used once
|
|
ADDR_LCD_GREEN 60000342
|
|
|
|
Symbol: ADDR_LCD_GREEN
|
|
Definitions
|
|
At line 26 in file app\add64.s
|
|
Uses
|
|
None
|
|
Comment: ADDR_LCD_GREEN unused
|
|
ADDR_LCD_RED 60000340
|
|
|
|
Symbol: ADDR_LCD_RED
|
|
Definitions
|
|
At line 25 in file app\add64.s
|
|
Uses
|
|
None
|
|
Comment: ADDR_LCD_RED unused
|
|
BACKLIGHT_FULL 0000FFFF
|
|
|
|
Symbol: BACKLIGHT_FULL
|
|
Definitions
|
|
At line 30 in file app\add64.s
|
|
Uses
|
|
At line 42 in file app\add64.s
|
|
Comment: BACKLIGHT_FULL used once
|
|
MASK_KEY_T0 00000001
|
|
|
|
Symbol: MASK_KEY_T0
|
|
|
|
|
|
|
|
ARM Macro Assembler Page 2 Alphabetic symbol ordering
|
|
Absolute symbols
|
|
|
|
Definitions
|
|
At line 29 in file app\add64.s
|
|
Uses
|
|
At line 60 in file app\add64.s
|
|
At line 85 in file app\add64.s
|
|
|
|
8 symbols
|
|
350 symbols in table
|