?? main.lst
字號(hào):
ARM COMPILER V2.00f, main 20/02/05 10:38:14 PAGE 1
ARM COMPILER V2.00f, COMPILATION OF MODULE main
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe main.c THUMB OPTIMIZE(7,SPEED) BROWSE DEBUG TABS(4)
stmt level source
1 /************************************************************/
2 /* PROJECT NAME: GPIO */
3 /* Project: LPC2100 Training course */
4 /* Engineer: T Martin tmartin@hitex.co.uk */
5 /* Filename: main.c */
6 /* Language: C */
7 /* Compiler: Keil ARM V2.0b */
8 /* Assembler: */
9 /* */
10 /************************************************************/
11 /* COPYRIGHT: Hitex UK Ltd 2005 */
12 /* LICENSE: THIS VERSION CREATED FOR FREE DISTRIBUTION */
13 /************************************************************/
14 /* Function: */
15 /* */
16 /* Example */
17 /* */
18 /* Demonstrates Use of the LPC2100 GPIO */
19 /* */
20 /* Oscillator frequency 12.000 Mhz */
21 /* Target board Keil MCB21000 */
22 /************************************************************/
23
24 #include <LPC21xx.H>
25
26 void ChangeGPIOPinState(unsigned int state);
27
28
29 int main(void)
30 {
31 1 unsigned int delay;
32 1 unsigned int flasher = 0x00010000; // define locals
33 1
34 1 IODIR1 = 0x00FF0000; // set all ports to output
35 1
36 1 while(1)
37 1 {
38 2
39 2 for(delay = 0;delay<0xA0000;delay++) //simple delay loop
40 2 {
41 3 ;
42 3 }
43 2
44 2 ChangeGPIOPinState(flasher); //set the state of the ports
45 2 flasher = flasher <<1; //shift the active led
46 2 if(flasher&0x01000000)
47 2 flasher = 0x00010000; //Increment flasher led and test for overflow
48 2
49 2 }
50 1 }
51
52 void ChangeGPIOPinState(unsigned int state)
53 {
54 1 IOCLR1 = ~state; //clear output pins
55 1 IOSET1 = state; //set output pins
56 1
57 1 }
58
59
ARM COMPILER V2.00f, main 20/02/05 10:38:14 PAGE 2
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN NUMBER (__startup)
*** PUBLICS:
PUBLIC ChangeGPIOPinState?T
PUBLIC main
*** CODE SEGMENT '?PR?main?main':
29: int main(void)
00000000 B500 PUSH {LR}
30: {
00000002 ; SCOPE-START
32: unsigned int flasher = 0x00010000; // define locals
00000002 4800 LDR R4,=0x10000
00000004 ---- Variable 'flasher' assigned to Register 'R4' ----
34: IODIR1 = 0x00FF0000; // set all ports to output
00000004 4800 LDR R1,=0xFF0000
00000006 4800 LDR R0,=0xE0028018
00000008 6001 STR R1,[R0,#0x0]
39: for(delay = 0;delay<0xA0000;delay++) //simple delay loop
0000000A L_9:
0000000A 2000 MOV R0,#0x0
0000000C ---- Variable 'delay' assigned to Register 'R0' ----
42: }
0000000C L_5:
0000000C 3001 ADD R0,#0x1
0000000E 4800 LDR R1,=0xA0000
00000010 4288 CMP R0,R1 ; delay
00000012 D3FB BCC L_5 ; T=0x0000000C
44: ChangeGPIOPinState(flasher); //set the state of the ports
00000014 1C20 MOV R0,R4
00000016 F7FF BL ChangeGPIOPinState?T ; T=0x0001 (1)
00000018 FFF3 BL ChangeGPIOPinState?T ; T=0x0001 (2)
45: flasher = flasher <<1; //shift the active led
0000001C 0064 LSL R4,R4,#0x1 ; flasher
46: if(flasher&0x01000000)
0000001E 4800 LDR R0,=0x1000000
00000020 4204 TST R4,R0 ; flasher
00000022 D0F2 BEQ L_9 ; T=0x0000000A
47: flasher = 0x00010000; //Increment flasher led and test for overflow
00000024 4800 LDR R4,=0x10000
49: }
00000026 E7F0 B L_9 ; T=0x0000000A
00000028 ; SCOPE-END
00000028 BC08 POP {R3}
0000002A 4718 BX R3
0000002C ENDP ; 'main'
*** CODE SEGMENT '?PR?ChangeGPIOPinState?T?main':
52: void ChangeGPIOPinState(unsigned int state)
00000000 1C03 MOV R3,R0 ; state
00000002 ---- Variable 'state' assigned to Register 'R3' ----
54: IOCLR1 = ~state; //clear output pins
00000002 1C19 MOV R1,R3 ; state
00000004 43CA MVN R2,R1 ; state
00000006 4800 LDR R0,=0xE002801C
00000008 6002 STR R2,[R0,#0x0]
55: IOSET1 = state; //set output pins
0000000A 4800 LDR R0,=0xE0028014
0000000C 6001 STR R1,[R0,#0x0]
57: }
0000000E 4770 BX R14
00000010 ENDP ; 'ChangeGPIOPinState?T'
ARM COMPILER V2.00f, main 20/02/05 10:38:14 PAGE 3
Module Information Static
----------------------------------
code size = ------
data size = ------
const size = ------
End of Module Information.
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -