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 ; -- table.s 11 00000000 ; -- 12 00000000 ; -- CT1 P04 Ein- und Ausgabe von Tabellenwerten 13 00000000 ; -- 14 00000000 ; -- $Id: table.s 800 2014-10-06 13:19:25Z ruan $ 15 00000000 ; ------------------------------------------------------ ------------ 16 00000000 ;Directives 17 00000000 PRESERVE8 18 00000000 THUMB 19 00000000 ; ------------------------------------------------------ ------------ 20 00000000 ; -- Symbolic Literals 21 00000000 ; ------------------------------------------------------ ------------ 22 00000000 60000200 ADDR_DIP_SWITCH_7_0 EQU 0x60000200 23 00000000 60000201 ADDR_DIP_SWITCH_15_8 EQU 0x60000201 24 00000000 60000203 ADDR_DIP_SWITCH_31_24 EQU 0x60000203 25 00000000 60000100 ADDR_LED_7_0 EQU 0x60000100 26 00000000 60000101 ADDR_LED_15_8 EQU 0x60000101 27 00000000 60000102 ADDR_LED_23_16 EQU 0x60000102 28 00000000 60000103 ADDR_LED_31_24 EQU 0x60000103 29 00000000 60000210 ADDR_BUTTONS EQU 0x60000210 30 00000000 60000114 ADDR_7_SEGMENT EQU 0x60000114 ARM Macro Assembler Page 2 31 00000000 32 00000000 00000001 BITMASK_KEY_T0 EQU 0x01 33 00000000 0000000F BITMASK_LOWER_NIBBLE EQU 0x0F 34 00000000 00000008 SHIFT_BITS_MSB EQU 0x08 35 00000000 36 00000000 ; ------------------------------------------------------ ------------ 37 00000000 ; -- Variables 38 00000000 ; ------------------------------------------------------ ------------ 39 00000000 AREA MyAsmVar, DATA, READWRITE 40 00000000 ; STUDENTS: To be programmed 41 00000000 42 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 store_table SPACE 32 ; reserve 16 byte ( 4 words) 43 00000020 44 00000020 45 00000020 46 00000020 47 00000020 ; END: To be programmed 48 00000020 ALIGN 49 00000020 50 00000020 ; ------------------------------------------------------ ------------ 51 00000020 ; -- myCode 52 00000020 ; ------------------------------------------------------ ------------ 53 00000020 AREA myCode, CODE, READONLY 54 00000000 55 00000000 main PROC 56 00000000 EXPORT main 57 00000000 58 00000000 readInput 59 00000000 F000 F820 BL waitForKey ; wait for key to b e pressed and relea sed 60 00000004 ; STUDENTS: To be programmed 61 00000004 ; Read Valules from Dip Switches 7-0 to R0 62 00000004 4815 LDR R0, =ADDR_DIP_SWITCH_7_0 63 00000006 7800 LDRB R0, [R0] 64 00000008 65 00000008 ; Write Values to LED 7-0 from R0 ARM Macro Assembler Page 3 66 00000008 4915 LDR R1, =ADDR_LED_7_0 67 0000000A 7008 STRB R0, [R1] 68 0000000C 69 0000000C ; Read Index from Dip Switches 15-8 to R1 70 0000000C 4915 LDR R1, =ADDR_DIP_SWITCH_15_8 71 0000000E 7809 LDRB R1, [R1] 72 00000010 4A15 LDR R2, =BITMASK_LOWER_NIBBLE 73 00000012 4011 ANDS R1, R1, R2 74 00000014 75 00000014 76 00000014 ; Write Index to LED 15-8 from R1 77 00000014 4A15 LDR R2, =ADDR_LED_15_8 78 00000016 7011 STRB R1, [R2] 79 00000018 80 00000018 ; Write Values to Store Table 81 00000018 000B MOVS R3, R1 82 0000001A 4A15 LDR R2, =SHIFT_BITS_MSB 83 0000001C 4093 LSLS R3, R3, R2 84 0000001E 18C0 ADDS R0, R0, R3 85 00000020 4A14 LDR R2, =store_table 86 00000022 1849 ADDS R1, R1, R1 87 00000024 5250 STRH R0, [R2, R1] 88 00000026 89 00000026 90 00000026 91 00000026 92 00000026 93 00000026 ; Read Index from Dip Switches 15-8 to R1 94 00000026 ; Todo: Maskierung 95 00000026 4814 LDR R0, =ADDR_DIP_SWITCH_31_24 96 00000028 7800 LDRB R0, [R0] 97 0000002A 490F LDR R1, =BITMASK_LOWER_NIBBLE 98 0000002C 4008 ANDS R0, R0, R1 99 0000002E 100 0000002E ; Write Index to LED 15-8 from R1 101 0000002E 4913 LDR R1, =ADDR_LED_31_24 102 00000030 7008 STRB R0, [R1] 103 00000032 104 00000032 ; Read Values from Store Table 105 00000032 4910 LDR R1, =store_table 106 00000034 1800 ADDS R0, R0, R0 107 00000036 5A08 LDRH R0, [R1, R0] 108 00000038 109 00000038 ; Write Values to LED 7-0 from R0 110 00000038 4911 LDR R1, =ADDR_LED_23_16 111 0000003A 7008 STRB R0, [R1] 112 0000003C 113 0000003C ;Write Values to 7-Segment Display 114 0000003C 4911 LDR R1, =ADDR_7_SEGMENT 115 0000003E 8008 STRH R0, [R1] 116 00000040 117 00000040 118 00000040 ; END: To be programmed 119 00000040 E7DE B readInput 120 00000042 00 00 ALIGN 121 00000044 122 00000044 ; ------------------------------------------------------ ------------ 123 00000044 ; Subroutines ARM Macro Assembler Page 4 124 00000044 ; ------------------------------------------------------ ------------ 125 00000044 126 00000044 ; wait for key to be pressed and released 127 00000044 waitForKey 128 00000044 B407 PUSH {R0, R1, R2} 129 00000046 4910 LDR R1, =ADDR_BUTTONS ; laod base a ddress of keys 130 00000048 4A10 LDR R2, =BITMASK_KEY_T0 ; load key mask T0 131 0000004A 132 0000004A waitForPress 133 0000004A 7808 LDRB R0, [R1] ; load key values 134 0000004C 4210 TST R0, R2 ; check, if key T0 is pressed 135 0000004E D0FC BEQ waitForPress 136 00000050 137 00000050 waitForRelease 138 00000050 7808 LDRB R0, [R1] ; load key values 139 00000052 4210 TST R0, R2 ; check, if key T0 is released 140 00000054 D1FC BNE waitForRelease 141 00000056 142 00000056 BC07 POP {R0, R1, R2} 143 00000058 4770 BX LR 144 0000005A 00 00 ALIGN 145 0000005C 146 0000005C ; ------------------------------------------------------ ------------ 147 0000005C ; End of code 148 0000005C ; ------------------------------------------------------ ------------ 149 0000005C ENDP 150 0000005C END 60000200 60000100 60000201 0000000F 60000101 00000008 00000000 60000203 60000103 60000102 60000114 60000210 00000001 Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M0 --depend=.\bu ild\table.d -o.\build\table.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\table.lst app\table.s ARM Macro Assembler Page 1 Alphabetic symbol ordering Relocatable symbols MyAsmVar 00000000 Symbol: MyAsmVar Definitions At line 39 in file app\table.s Uses None Comment: MyAsmVar unused store_table 00000000 Symbol: store_table Definitions At line 42 in file app\table.s Uses At line 85 in file app\table.s At line 105 in file app\table.s 2 symbols ARM Macro Assembler Page 1 Alphabetic symbol ordering Relocatable symbols main 00000000 Symbol: main Definitions At line 55 in file app\table.s Uses At line 56 in file app\table.s Comment: main used once myCode 00000000 Symbol: myCode Definitions At line 53 in file app\table.s Uses None Comment: myCode unused readInput 00000000 Symbol: readInput Definitions At line 58 in file app\table.s Uses At line 119 in file app\table.s Comment: readInput used once waitForKey 00000044 Symbol: waitForKey Definitions At line 127 in file app\table.s Uses At line 59 in file app\table.s Comment: waitForKey used once waitForPress 0000004A Symbol: waitForPress Definitions At line 132 in file app\table.s Uses At line 135 in file app\table.s Comment: waitForPress used once waitForRelease 00000050 Symbol: waitForRelease Definitions At line 137 in file app\table.s Uses At line 140 in file app\table.s Comment: waitForRelease used once 6 symbols ARM Macro Assembler Page 1 Alphabetic symbol ordering Absolute symbols ADDR_7_SEGMENT 60000114 Symbol: ADDR_7_SEGMENT Definitions At line 30 in file app\table.s Uses At line 114 in file app\table.s Comment: ADDR_7_SEGMENT used once ADDR_BUTTONS 60000210 Symbol: ADDR_BUTTONS Definitions At line 29 in file app\table.s Uses At line 129 in file app\table.s Comment: ADDR_BUTTONS used once ADDR_DIP_SWITCH_15_8 60000201 Symbol: ADDR_DIP_SWITCH_15_8 Definitions At line 23 in file app\table.s Uses At line 70 in file app\table.s Comment: ADDR_DIP_SWITCH_15_8 used once ADDR_DIP_SWITCH_31_24 60000203 Symbol: ADDR_DIP_SWITCH_31_24 Definitions At line 24 in file app\table.s Uses At line 95 in file app\table.s Comment: ADDR_DIP_SWITCH_31_24 used once ADDR_DIP_SWITCH_7_0 60000200 Symbol: ADDR_DIP_SWITCH_7_0 Definitions At line 22 in file app\table.s Uses At line 62 in file app\table.s Comment: ADDR_DIP_SWITCH_7_0 used once ADDR_LED_15_8 60000101 Symbol: ADDR_LED_15_8 Definitions At line 26 in file app\table.s Uses At line 77 in file app\table.s Comment: ADDR_LED_15_8 used once ADDR_LED_23_16 60000102 Symbol: ADDR_LED_23_16 Definitions At line 27 in file app\table.s Uses At line 110 in file app\table.s Comment: ADDR_LED_23_16 used once ADDR_LED_31_24 60000103 Symbol: ADDR_LED_31_24 ARM Macro Assembler Page 2 Alphabetic symbol ordering Absolute symbols Definitions At line 28 in file app\table.s Uses At line 101 in file app\table.s Comment: ADDR_LED_31_24 used once ADDR_LED_7_0 60000100 Symbol: ADDR_LED_7_0 Definitions At line 25 in file app\table.s Uses At line 66 in file app\table.s Comment: ADDR_LED_7_0 used once BITMASK_KEY_T0 00000001 Symbol: BITMASK_KEY_T0 Definitions At line 32 in file app\table.s Uses At line 130 in file app\table.s Comment: BITMASK_KEY_T0 used once BITMASK_LOWER_NIBBLE 0000000F Symbol: BITMASK_LOWER_NIBBLE Definitions At line 33 in file app\table.s Uses At line 72 in file app\table.s At line 97 in file app\table.s SHIFT_BITS_MSB 00000008 Symbol: SHIFT_BITS_MSB Definitions At line 34 in file app\table.s Uses At line 82 in file app\table.s Comment: SHIFT_BITS_MSB used once 12 symbols 355 symbols in table