ARM Macro Assembler Page 1 1 00000000 ;------------------------------------------------------- ----------------------------------------------- 2 00000000 ; Module 7: Design and Implementation of an AHB UART per ipheral 3 00000000 ; 1)Display text string: "TEST" on VGA. 4 00000000 ; 2)Receive/ print characters from/ to a computer throug h UART port. 5 00000000 ;------------------------------------------------------- ----------------------------------------------- 6 00000000 7 00000000 8 00000000 ; Vector Table Mapped to Address 0 at Reset 9 00000000 10 00000000 PRESERVE8 11 00000000 THUMB 12 00000000 13 00000000 AREA RESET, DATA, READONLY ; First 3 2 WORDS is VECTOR T ABLE 14 00000000 EXPORT __Vectors 15 00000000 16 00000000 0000FFFC __Vectors DCD 0x0000FFFC 17 00000004 00000000 DCD Reset_Handler 18 00000008 00000000 DCD 0 19 0000000C 00000000 DCD 0 20 00000010 00000000 DCD 0 21 00000014 00000000 DCD 0 22 00000018 00000000 DCD 0 23 0000001C 00000000 DCD 0 24 00000020 00000000 DCD 0 25 00000024 00000000 DCD 0 26 00000028 00000000 DCD 0 27 0000002C 00000000 DCD 0 28 00000030 00000000 DCD 0 29 00000034 00000000 DCD 0 30 00000038 00000000 DCD 0 31 0000003C 00000000 DCD 0 32 00000040 33 00000040 ; External Interrupts 34 00000040 35 00000040 00000000 DCD 0 36 00000044 00000000 DCD 0 37 00000048 00000000 DCD 0 38 0000004C 00000000 DCD 0 39 00000050 00000000 DCD 0 40 00000054 00000000 DCD 0 41 00000058 00000000 DCD 0 42 0000005C 00000000 DCD 0 43 00000060 00000000 DCD 0 44 00000064 00000000 DCD 0 45 00000068 00000000 DCD 0 46 0000006C 00000000 DCD 0 47 00000070 00000000 DCD 0 48 00000074 00000000 DCD 0 49 00000078 00000000 DCD 0 50 0000007C 00000000 DCD 0 51 00000080 ARM Macro Assembler Page 2 52 00000080 AREA |.text|, CODE, READONLY 53 00000000 ;Reset Handler 54 00000000 Reset_Handler PROC 55 00000000 GLOBAL Reset_Handler 56 00000000 ENTRY 57 00000000 58 00000000 4A11 LDR R2, =0x50000000 59 00000002 2077 MOVS R0,#0x77 60 00000004 6010 STR R0, [R2] 61 00000006 62 00000006 ;Write "TEST" to the UART 63 00000006 64 00000006 Again 65 00000006 66 00000006 4A11 LDR R2, =0x51000000 67 00000008 200A MOVS R0, #'\n' 68 0000000A 6010 STR R0, [R2] 69 0000000C 70 0000000C 4A0F LDR R2, =0x51000000 71 0000000E 200D MOVS R0, #'\r' 72 00000010 6010 STR R0, [R2] 73 00000012 74 00000012 75 00000012 4A0E LDR R2, =0x51000000 76 00000014 2054 MOVS R0, #'T' 77 00000016 6010 STR R0, [R2] 78 00000018 79 00000018 4A0C LDR R2, =0x51000000 80 0000001A 2045 MOVS R0, #'E' 81 0000001C 6010 STR R0, [R2] 82 0000001E 83 0000001E 4A0B LDR R2, =0x51000000 84 00000020 2053 MOVS R0, #'S' 85 00000022 6010 STR R0, [R2] 86 00000024 87 00000024 4A09 LDR R2, =0x51000000 88 00000026 2054 MOVS R0, #'T' 89 00000028 6010 STR R0, [R2] 90 0000002A 91 0000002A 4A08 LDR R2, =0x51000000 92 0000002C 203A MOVS R0, #':' 93 0000002E 6010 STR R0, [R2] 94 00000030 95 00000030 96 00000030 ;wait until receive buffer is not empty 97 00000030 98 00000030 4907 WAIT LDR R1, =0x51000004 99 00000032 6808 LDR R0, [R1] 100 00000034 2101 MOVS R1, #01 101 00000036 4008 ANDS R0, R0, R1 102 00000038 2800 CMP R0, #0x00 103 0000003A D1F9 BNE WAIT 104 0000003C 105 0000003C ;print received text to UART 106 0000003C 107 0000003C 4903 LDR R1, =0x51000000 108 0000003E 4A02 LDR R2, =0x50000000 109 00000040 ARM Macro Assembler Page 3 110 00000040 6808 LDR R0, [R1] 111 00000042 6008 STR R0, [R1] 112 00000044 6010 STR R0, [R2] 113 00000046 114 00000046 E7DE B Again 115 00000048 116 00000048 ENDP 117 00000048 118 00000048 ALIGN 4 ; Align to a word b oundary 119 00000048 120 00000048 END 50000000 51000000 51000004 Command Line: --debug --xref --cpu=Cortex-M0 --apcs=interwork --depend=.\cm0dsa sm.d -o.\cm0dsasm.o -IC:\Keil_v5\ARM\RV31\INC -IC:\Keil_v5\ARM\CMSIS\Include -- predefine="__EVAL SETA 1" --list=.\cm0dsasm.lst cm0dsasm.s ARM Macro Assembler Page 1 Alphabetic symbol ordering Relocatable symbols RESET 00000000 Symbol: RESET Definitions At line 13 in file cm0dsasm.s Uses None Comment: RESET unused __Vectors 00000000 Symbol: __Vectors Definitions At line 16 in file cm0dsasm.s Uses At line 14 in file cm0dsasm.s Comment: __Vectors used once 2 symbols ARM Macro Assembler Page 1 Alphabetic symbol ordering Relocatable symbols .text 00000000 Symbol: .text Definitions At line 52 in file cm0dsasm.s Uses None Comment: .text unused Again 00000006 Symbol: Again Definitions At line 64 in file cm0dsasm.s Uses At line 114 in file cm0dsasm.s Comment: Again used once Reset_Handler 00000000 Symbol: Reset_Handler Definitions At line 54 in file cm0dsasm.s Uses At line 17 in file cm0dsasm.s At line 55 in file cm0dsasm.s WAIT 00000030 Symbol: WAIT Definitions At line 98 in file cm0dsasm.s Uses At line 103 in file cm0dsasm.s Comment: WAIT used once 4 symbols 339 symbols in table