CT-Lab_6_ALU_and_Branch_Ins.../bcd/build/main.lst

455 lines
14 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 ; -- main.s
11 00000000 ; --
12 00000000 ; -- CT1 P06 "ALU und Sprungbefehle" mit MUL
13 00000000 ; --
14 00000000 ; -- $Id: main.s 4857 2019-09-10 17:30:17Z akdi $
15 00000000 ; ------------------------------------------------------
------------
16 00000000 ;Directives
17 00000000 PRESERVE8
18 00000000 THUMB
19 00000000
20 00000000 ; ------------------------------------------------------
------------
21 00000000 ; -- Address Defines
22 00000000 ; ------------------------------------------------------
------------
23 00000000
24 00000000 60000100
ADDR_LED_15_0
EQU 0x60000100
25 00000000 60000102
ADDR_LED_31_16
EQU 0x60000102
26 00000000 60000200
ADDR_DIP_SWITCH_7_0
EQU 0x60000200
27 00000000 60000201
ADDR_DIP_SWITCH_15_8
EQU 0x60000201
28 00000000 60000114
ADDR_7_SEG_BIN_DS3_0
EQU 0x60000114
29 00000000 60000210
ADDR_BUTTONS
EQU 0x60000210
30 00000000
31 00000000 60000340
ADDR_LCD_RED
EQU 0x60000340
32 00000000 60000342
ADDR_LCD_GREEN
EQU 0x60000342
ARM Macro Assembler Page 2
33 00000000 60000344
ADDR_LCD_BLUE
EQU 0x60000344
34 00000000 0000FFFF
LCD_BACKLIGHT_FULL
EQU 0xffff
35 00000000 00000000
LCD_BACKLIGHT_OFF
EQU 0x0000
36 00000000
37 00000000 0000000F
MASK_LOW_NIBBLE
EQU 0xf
38 00000000 0000000A
FACTOR_10
EQU 0xa
39 00000000 00000001
BITMASK_KEY_T0
EQU 0x01
40 00000000
41 00000000 ; ------------------------------------------------------
------------
42 00000000 ; -- myCode
43 00000000 ; ------------------------------------------------------
------------
44 00000000 AREA myCode, CODE, READONLY
45 00000000
46 00000000 ENTRY
47 00000000
48 00000000 main PROC
49 00000000 export main
50 00000000
51 00000000 ; STUDENTS: To be programmed
52 00000000
53 00000000 4A17 LDR R2, =MASK_LOW_NIBBLE
54 00000002
55 00000002 ; Load BCD Tens in R0
56 00000002 4818 LDR R0, =ADDR_DIP_SWITCH_15_8
57 00000004 7800 LDRB R0, [R0]
58 00000006 4010 ANDS R0, R0, R2
59 00000008
60 00000008 ; Load BCD Ones in R1
61 00000008 4917 LDR R1, =ADDR_DIP_SWITCH_7_0
62 0000000A 7809 LDRB R1, [R1]
63 0000000C 4011 ANDS R1, R1, R2
64 0000000E
65 0000000E ; Check if T0 is pressed. If pressed goto CalcByMult
66 0000000E 4B17 LDR R3, =ADDR_BUTTONS ; load base a
ddress of keys
67 00000010 4C17 LDR R4, =BITMASK_KEY_T0
; load key mask T0
68 00000012 781A LDRB R2, [R3] ; load key values
69 00000014 4222 TST R2, R4 ; check, if key T0
is pressed
70 00000016 D00A BEQ CalcByMult ; goto CalcByMult
71 00000018
72 00000018
73 00000018 CalcByBitShift
74 00000018 ; set the LCD background to red
ARM Macro Assembler Page 3
75 00000018 4A16 LDR R2, =ADDR_LCD_RED
76 0000001A 4B17 LDR R3, =0xffff
77 0000001C 8013 STRH R3, [R2]
78 0000001E 4A17 LDR R2, =ADDR_LCD_BLUE
79 00000020 4B17 LDR R3, =0x0
80 00000022 8013 STRH R3, [R2]
81 00000024
82 00000024 ; Calculate Bin Value to R2 by Bit Shifting
83 00000024 ; R2 = R0 * 10
84 00000024 00C2 LSLS R2, R0, #3
85 00000026 0043 LSLS R3, R0, #1
86 00000028 18D2 ADDS R2, R2, R3
87 0000002A 1852 ADDS R2, R2, R1
88 0000002C
89 0000002C EndCalcByBitShift
90 0000002C
91 0000002C ; goto EndCalcByMult
92 0000002C E008 B EndCalcByMult
93 0000002E
94 0000002E CalcByMult
95 0000002E
96 0000002E ; set the LCD background to blue
97 0000002E 4A11 LDR R2, =ADDR_LCD_RED
98 00000030 4B13 LDR R3, =0x0
99 00000032 8013 STRH R3, [R2]
100 00000034 4A11 LDR R2, =ADDR_LCD_BLUE
101 00000036 4B10 LDR R3, =0xffff
102 00000038 8013 STRH R3, [R2]
103 0000003A
104 0000003A ; Calculate Bin Value to R2 by Multiplication
105 0000003A ; R2 = R0 * 10
106 0000003A 4A12 LDR R2, =FACTOR_10
107 0000003C 4342 MULS R2, R0, R2
108 0000003E 1852 ADDS R2, R2, R1
109 00000040
110 00000040 EndCalcByMult
111 00000040
112 00000040 ; Shift BCD Tens in high Nibble in R0
113 00000040 ; Add BCD Ones in low Nibble in R0
114 00000040 0100 LSLS R0, R0, #4
115 00000042 4308 ORRS R0, R0, R1
116 00000044
117 00000044 ; Add Bin Value in higher Byte in R0
118 00000044 0212 LSLS R2, R2, #8
119 00000046 4310 ORRS R0, R0, R2
120 00000048
121 00000048
122 00000048 ; Show R0 on LEDs
123 00000048 4A0F LDR R2, =ADDR_LED_15_0
124 0000004A 8010 STRH R0, [R2]
125 0000004C
126 0000004C ; Show R0 on 7-Segment
127 0000004C 4A0F LDR R2, =ADDR_7_SEG_BIN_DS3_0
128 0000004E 8010 STRH R0, [R2]
129 00000050
130 00000050 ; END: To be programmed
131 00000050
132 00000050 E7FE B main
133 00000052 ENDP
ARM Macro Assembler Page 4
134 00000052
135 00000052 ;----------------------------------------------------
136 00000052 ; Subroutines
137 00000052 ;----------------------------------------------------
138 00000052
139 00000052 ;----------------------------------------------------
140 00000052 ; pause for disco_lights
141 00000052 pause PROC
142 00000052 B403 PUSH {R0, R1}
143 00000054 4906 LDR R1, =1
144 00000056 480E LDR R0, =0x000FFFFF
145 00000058
146 00000058 loop
147 00000058 1A40 SUBS R0, R0, R1
148 0000005A D2FD BCS loop
149 0000005C
150 0000005C BC03 POP {R0, R1}
151 0000005E 4770 BX LR
152 00000060 ALIGN
153 00000060 ENDP
154 00000060
155 00000060 ; ------------------------------------------------------
------------
156 00000060 ; End of code
157 00000060 ; ------------------------------------------------------
------------
158 00000060 END
0000000F
60000201
60000200
60000210
00000001
60000340
0000FFFF
60000344
00000000
0000000A
60000100
60000114
000FFFFF
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M0 --depend=.\bu
ild\main.d -o.\build\main.o -I.\RTE\_Target_1 -IC:\Users\roman\AppData\Local\Ar
m\Packs\InES\CTBoard14_DFP\4.0.2\Device\Include -IC:\Users\roman\AppData\Local\
Arm\Packs\InES\CTBoard14_DFP\4.0.2\Device\Include\m0 -IC:\Users\roman\AppData\L
ocal\Arm\Packs\InES\CTBoard14_DFP\4.0.2\HAL\Include --predefine="__EVAL SETA 1"
--predefine="__UVISION_VERSION SETA 537" --predefine="_RTE_ SETA 1" --predefin
e="_RTE_ SETA 1" --list=.\build\main.lst app\main.s
ARM Macro Assembler Page 1 Alphabetic symbol ordering
Relocatable symbols
CalcByBitShift 00000018
Symbol: CalcByBitShift
Definitions
At line 73 in file app\main.s
Uses
None
Comment: CalcByBitShift unused
CalcByMult 0000002E
Symbol: CalcByMult
Definitions
At line 94 in file app\main.s
Uses
At line 70 in file app\main.s
Comment: CalcByMult used once
EndCalcByBitShift 0000002C
Symbol: EndCalcByBitShift
Definitions
At line 89 in file app\main.s
Uses
None
Comment: EndCalcByBitShift unused
EndCalcByMult 00000040
Symbol: EndCalcByMult
Definitions
At line 110 in file app\main.s
Uses
At line 92 in file app\main.s
Comment: EndCalcByMult used once
loop 00000058
Symbol: loop
Definitions
At line 146 in file app\main.s
Uses
At line 148 in file app\main.s
Comment: loop used once
main 00000000
Symbol: main
Definitions
At line 48 in file app\main.s
Uses
At line 49 in file app\main.s
At line 132 in file app\main.s
myCode 00000000
Symbol: myCode
Definitions
At line 44 in file app\main.s
Uses
None
Comment: myCode unused
pause 00000052
ARM Macro Assembler Page 2 Alphabetic symbol ordering
Relocatable symbols
Symbol: pause
Definitions
At line 141 in file app\main.s
Uses
None
Comment: pause unused
8 symbols
ARM Macro Assembler Page 1 Alphabetic symbol ordering
Absolute symbols
ADDR_7_SEG_BIN_DS3_0 60000114
Symbol: ADDR_7_SEG_BIN_DS3_0
Definitions
At line 28 in file app\main.s
Uses
At line 127 in file app\main.s
Comment: ADDR_7_SEG_BIN_DS3_0 used once
ADDR_BUTTONS 60000210
Symbol: ADDR_BUTTONS
Definitions
At line 29 in file app\main.s
Uses
At line 66 in file app\main.s
Comment: ADDR_BUTTONS used once
ADDR_DIP_SWITCH_15_8 60000201
Symbol: ADDR_DIP_SWITCH_15_8
Definitions
At line 27 in file app\main.s
Uses
At line 56 in file app\main.s
Comment: ADDR_DIP_SWITCH_15_8 used once
ADDR_DIP_SWITCH_7_0 60000200
Symbol: ADDR_DIP_SWITCH_7_0
Definitions
At line 26 in file app\main.s
Uses
At line 61 in file app\main.s
Comment: ADDR_DIP_SWITCH_7_0 used once
ADDR_LCD_BLUE 60000344
Symbol: ADDR_LCD_BLUE
Definitions
At line 33 in file app\main.s
Uses
At line 78 in file app\main.s
At line 100 in file app\main.s
ADDR_LCD_GREEN 60000342
Symbol: ADDR_LCD_GREEN
Definitions
At line 32 in file app\main.s
Uses
None
Comment: ADDR_LCD_GREEN unused
ADDR_LCD_RED 60000340
Symbol: ADDR_LCD_RED
Definitions
At line 31 in file app\main.s
Uses
At line 75 in file app\main.s
At line 97 in file app\main.s
ADDR_LED_15_0 60000100
ARM Macro Assembler Page 2 Alphabetic symbol ordering
Absolute symbols
Symbol: ADDR_LED_15_0
Definitions
At line 24 in file app\main.s
Uses
At line 123 in file app\main.s
Comment: ADDR_LED_15_0 used once
ADDR_LED_31_16 60000102
Symbol: ADDR_LED_31_16
Definitions
At line 25 in file app\main.s
Uses
None
Comment: ADDR_LED_31_16 unused
BITMASK_KEY_T0 00000001
Symbol: BITMASK_KEY_T0
Definitions
At line 39 in file app\main.s
Uses
At line 67 in file app\main.s
Comment: BITMASK_KEY_T0 used once
FACTOR_10 0000000A
Symbol: FACTOR_10
Definitions
At line 38 in file app\main.s
Uses
At line 106 in file app\main.s
Comment: FACTOR_10 used once
LCD_BACKLIGHT_FULL 0000FFFF
Symbol: LCD_BACKLIGHT_FULL
Definitions
At line 34 in file app\main.s
Uses
None
Comment: LCD_BACKLIGHT_FULL unused
LCD_BACKLIGHT_OFF 00000000
Symbol: LCD_BACKLIGHT_OFF
Definitions
At line 35 in file app\main.s
Uses
None
Comment: LCD_BACKLIGHT_OFF unused
MASK_LOW_NIBBLE 0000000F
Symbol: MASK_LOW_NIBBLE
Definitions
At line 37 in file app\main.s
Uses
At line 53 in file app\main.s
Comment: MASK_LOW_NIBBLE used once
14 symbols
357 symbols in table