📄 fiotest.lst
字号:
ARM COMPILER V2.53, fiotest 23/07/06 08:29:51 PAGE 1
ARM COMPILER V2.53, COMPILATION OF MODULE fiotest
OBJECT MODULE PLACED IN .\Obj\fiotest.obj
COMPILER INVOKED BY: g:\Keil\ARM\BIN\CA.exe fiotest.c THUMB INCDIR(..\Common\inc) DEBUG PRINT(.\LST\FIOTEST.LST) TABS(4)
- OBJECT(.\Obj\fiotest.obj)
stmt level source
1 /*****************************************************************************
2 * fiotest.c: main C entry file for Philips LPC214x Family Microprocessors
3 *
4 * Copyright(C) 2006, Philips Semiconductor
5 * All rights reserved.
6 *
7 * History
8 * 2005.10.01 ver 1.00 Prelimnary version, first Release
9 *
10 ******************************************************************************/
11 #include "LPC214x.H" /* LPC21xx definitions */
12 #include "type.h"
13 #include "irq.h"
14 #include "timer.h"
15 #include "fio.h"
16
17 extern DWORD timer_counter;
18
19 /*****************************************************************************
20 ** Main Function main()
21 ******************************************************************************/
22 int main (void)
23 {
24 1 DWORD counter = 0;
25 1 DWORD flip_port = REGULAR_PORT;
26 1
27 1 /********* The main Function is an endless loop ***********/
28 1 init_VIC();
29 1 init_timer();
30 1
31 1 /* Initialize GPIO pins, default is REGULAR_PORT */
32 1 GPIOInit( REGULAR_PORT );
33 1
34 1 /* Initialize timer for GPIO toggling timing */
35 1 enable_timer( 0 );
36 1
37 1 /* From the blink speed of the LED, it won't tell the difference between
38 1 the regular port and fast port unless a scope is applied. This demo is
39 1 show how the regular and fast port should be initialized and the level
40 1 of the port can be changed. */
41 1 while( 1 )
42 1 {
43 2 if ( flip_port == REGULAR_PORT )
44 2 {
45 3 if ( counter == 0 )
46 3 {
47 4 GPIOInit( REGULAR_PORT ); /* only need to do once when port is
48 4 switched. */
49 4 }
50 3 if ( timer_counter >= 0x20 * counter )
51 3 {
52 4 IOSET1 = 1 << (16 + counter);
53 4 counter++;
54 4 if ( counter > 8 )
55 4 {
56 5 counter = 0;
57 5 timer_counter = 0;
58 5 IOCLR1 = 0x00FF0000;
ARM COMPILER V2.53, fiotest 23/07/06 08:29:51 PAGE 2
59 5 flip_port = FAST_PORT; /* switch port from regular to fast */
60 5 }
61 4 }
62 3 }
63 2 if ( flip_port == FAST_PORT )
64 2 {
65 3 if ( counter == 0 )
66 3 {
67 4 GPIOInit( FAST_PORT ); /* only need to do once when port is
68 4 switched. */
69 4 }
70 3 if ( timer_counter >= 0x20 * counter )
71 3 {
72 4 FIO1SET = 1 << (16 + counter);
73 4 counter++;
74 4 if ( counter > 8 )
75 4 {
76 5 counter = 0;
77 5 timer_counter = 0;
78 5 FIO1CLR = 0x00FF0000;
79 5 flip_port = REGULAR_PORT; /* switch port from fast to regular */
80 5 }
81 4 }
82 3 }
83 2 }
84 1 return 0;
85 1 }
86
87 /*****************************************************************************
88 ** End Of File
89 *****************************************************************************/
90
ARM COMPILER V2.53, fiotest 23/07/06 08:29:51 PAGE 3
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN CODE16 (init_VIC?T)
EXTERN CODE16 (init_timer?T)
EXTERN CODE16 (enable_timer?T)
EXTERN CODE16 (GPIOInit?T)
EXTERN DATA (timer_counter)
EXTERN NUMBER (__startup)
*** PUBLICS:
PUBLIC main
*** CODE SEGMENT '?PR?main?fiotest':
22: int main (void)
00000000 B500 PUSH {LR}
23: {
00000002 ; SCOPE-START
24: DWORD counter = 0;
00000002 2500 MOV R5,#0x0
00000004 ---- Variable 'counter' assigned to Register 'R5' ----
25: DWORD flip_port = REGULAR_PORT;
00000004 2602 MOV R6,#0x2
00000006 1C34 MOV R4,R6 ; flip_port
00000008 ---- Variable 'flip_port' assigned to Register 'R4' ----
28: init_VIC();
00000008 F7FF BL init_VIC?T ; T=0x0001 (1)
0000000A FFFA BL init_VIC?T ; T=0x0001 (2)
29: init_timer();
0000000C F7FF BL init_timer?T ; T=0x0001 (1)
0000000E FFF8 BL init_timer?T ; T=0x0001 (2)
32: GPIOInit( REGULAR_PORT );
00000010 1C30 MOV R0,R6
00000012 F7FF BL GPIOInit?T ; T=0x0001 (1)
00000014 FFF5 BL GPIOInit?T ; T=0x0001 (2)
35: enable_timer( 0 );
00000016 2000 MOV R0,#0x0
00000018 F7FF BL enable_timer?T ; T=0x0001 (1)
0000001A FFF2 BL enable_timer?T ; T=0x0001 (2)
41: while( 1 )
0000001C L_3:
43: if ( flip_port == REGULAR_PORT )
0000001C 1C20 MOV R0,R4 ; flip_port
0000001E 2802 CMP R0,#0x2 ; flip_port
00000020 D11E BNE L_5 ; T=0x00000060
45: if ( counter == 0 )
00000022 1C28 MOV R0,R5 ; counter
00000024 2800 CMP R0,#0x0 ; counter
00000026 D102 BNE L_6 ; T=0x0000002E
47: GPIOInit( REGULAR_PORT ); /* only need to do once when port is
00000028 2002 MOV R0,#0x2
0000002A F7FF BL GPIOInit?T ; T=0x0001 (1)
0000002C FFE9 BL GPIOInit?T ; T=0x0001 (2)
49: }
0000002E L_6:
50: if ( timer_counter >= 0x20 * counter )
0000002E 1C29 MOV R1,R5 ; counter
00000030 0149 LSL R1,R1,#0x5 ; counter
00000032 4800 LDR R0,=timer_counter ; timer_counter
00000034 6800 LDR R0,[R0,#0x0] ; timer_counter
00000036 4288 CMP R0,R1
00000038 D312 BCC L_5 ; T=0x00000060
52: IOSET1 = 1 << (16 + counter);
0000003A 1C29 MOV R1,R5 ; counter
0000003C 3110 ADD R1,#0x10
ARM COMPILER V2.53, fiotest 23/07/06 08:29:51 PAGE 4
0000003E 2001 MOV R0,#0x1
00000040 1C02 MOV R2,R0
00000042 408A LSL R2,R1
00000044 4800 LDR R1,=0xE0028014
00000046 600A STR R2,[R1,#0x0]
53: counter++;
00000048 3501 ADD R5,#0x1
54: if ( counter > 8 )
0000004A 1C29 MOV R1,R5 ; counter
0000004C 2908 CMP R1,#0x8 ; counter
0000004E D907 BLS L_5 ; T=0x00000060
56: counter = 0;
00000050 2200 MOV R2,#0x0
00000052 1C15 MOV R5,R2 ; counter
57: timer_counter = 0;
00000054 4800 LDR R1,=timer_counter ; timer_counter
00000056 600A STR R2,[R1,#0x0] ; timer_counter
58: IOCLR1 = 0x00FF0000;
00000058 4800 LDR R2,=0xFF0000
0000005A 4800 LDR R1,=0xE002801C
0000005C 600A STR R2,[R1,#0x0]
59: flip_port = FAST_PORT; /* switch port from regular to fast */
0000005E 1C04 MOV R4,R0 ; flip_port
62: }
00000060 L_5:
63: if ( flip_port == FAST_PORT )
00000060 1C20 MOV R0,R4 ; flip_port
00000062 2801 CMP R0,#0x1 ; flip_port
00000064 D1DA BNE L_3 ; T=0x0000001C
65: if ( counter == 0 )
00000066 1C28 MOV R0,R5 ; counter
00000068 2800 CMP R0,#0x0 ; counter
0000006A D102 BNE L_10 ; T=0x00000072
67: GPIOInit( FAST_PORT ); /* only need to do once when port is
0000006C 2001 MOV R0,#0x1
0000006E F7FF BL GPIOInit?T ; T=0x0001 (1)
00000070 FFC7 BL GPIOInit?T ; T=0x0001 (2)
69: }
00000072 L_10:
70: if ( timer_counter >= 0x20 * counter )
00000072 1C29 MOV R1,R5 ; counter
00000074 0149 LSL R1,R1,#0x5 ; counter
00000076 4800 LDR R0,=timer_counter ; timer_counter
00000078 6800 LDR R0,[R0,#0x0] ; timer_counter
0000007A 4288 CMP R0,R1
0000007C D3CE BCC L_3 ; T=0x0000001C
72: FIO1SET = 1 << (16 + counter);
0000007E 1C28 MOV R0,R5 ; counter
00000080 3010 ADD R0,#0x10
00000082 2101 MOV R1,#0x1
00000084 4081 LSL R1,R0
00000086 4800 LDR R0,=0x3FFFC038
00000088 6001 STR R1,[R0,#0x0]
73: counter++;
0000008A 3501 ADD R5,#0x1
74: if ( counter > 8 )
0000008C 1C28 MOV R0,R5 ; counter
0000008E 2808 CMP R0,#0x8 ; counter
00000090 D9C4 BLS L_3 ; T=0x0000001C
76: counter = 0;
00000092 2100 MOV R1,#0x0
00000094 1C0D MOV R5,R1 ; counter
77: timer_counter = 0;
00000096 4800 LDR R0,=timer_counter ; timer_counter
00000098 6001 STR R1,[R0,#0x0] ; timer_counter
78: FIO1CLR = 0x00FF0000;
ARM COMPILER V2.53, fiotest 23/07/06 08:29:51 PAGE 5
0000009A 4800 LDR R1,=0xFF0000
0000009C 4800 LDR R0,=0x3FFFC03C
0000009E 6001 STR R1,[R0,#0x0]
79: flip_port = REGULAR_PORT; /* switch port from fast to regular */
000000A0 2402 MOV R4,#0x2
83: }
000000A2 E7BB B L_3 ; T=0x0000001C
84: return 0;
000000A4 ; SCOPE-END
85: }
000000A4 BC08 POP {R3}
000000A6 4718 BX R3
000000A8 ENDP ; 'main'
Module Information Static
----------------------------------
code size = ------
data size = ------
const size = ------
End of Module Information.
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -