; generated by ARM C/C++ Compiler, 4.1 [Build 713]
; commandline ArmCC [--list --split_sections --debug -c --asm --interleave -o.\output\main.o --asm_dir=.\listing\ --list_dir=.\listing\ --depend=.\output\main.d --cpu=Cortex-M3 --apcs=interwork -O3 -I.\ -IC:\Keil\ARM\CMSIS\Include -IC:\Keil\ARM\INC\ST\STM32F10x -D__MICROLIB --omf_browse=.\output\main.crf main.c]
                          THUMB

                          AREA ||i.GPIO_Configuration||, CODE, READONLY, ALIGN=2

                  GPIO_Configuration PROC
;;;142    *******************************************************************************/
;;;143    void GPIO_Configuration(void)
000000  b538              PUSH     {r3-r5,lr}
;;;144    {
;;;145      GPIO_InitTypeDef GPIO_InitStructure;
;;;146        
;;;147      /* Configure PC13 as input floating (EXTI Line13) */
;;;148      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
000002  2003              MOVS     r0,#3
000004  f88d0002          STRB     r0,[sp,#2]
;;;149      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
000008  f44f5000          MOV      r0,#0x2000
00000c  f8ad0000          STRH     r0,[sp,#0]
;;;150      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
000010  2404              MOVS     r4,#4
000012  f88d4003          STRB     r4,[sp,#3]
;;;151      GPIO_Init(GPIOC, &GPIO_InitStructure);
000016  4669              MOV      r1,sp
000018  480b              LDR      r0,|L1.72|
00001a  f7fffffe          BL       GPIO_Init
;;;152    
;;;153      /* Configure USART1 Tx (PA.9) as alternate function push-pull */
;;;154      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
00001e  01e0              LSLS     r0,r4,#7
000020  f8ad0000          STRH     r0,[sp,#0]
;;;155      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
000024  2018              MOVS     r0,#0x18
;;;156      GPIO_Init(GPIOA, &GPIO_InitStructure);
000026  4d09              LDR      r5,|L1.76|
000028  f88d0003          STRB     r0,[sp,#3]            ;155
00002c  4669              MOV      r1,sp
00002e  4628              MOV      r0,r5
000030  f7fffffe          BL       GPIO_Init
;;;157        
;;;158      /* Configure USART1 Rx (PA.10) as input floating */
;;;159      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
000034  0220              LSLS     r0,r4,#8
000036  f8ad0000          STRH     r0,[sp,#0]
;;;160      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
00003a  f88d4003          STRB     r4,[sp,#3]
;;;161      GPIO_Init(GPIOA, &GPIO_InitStructure);
00003e  4669              MOV      r1,sp
000040  4628              MOV      r0,r5
000042  f7fffffe          BL       GPIO_Init
;;;162    }
000046  bd38              POP      {r3-r5,pc}
;;;163    
                          ENDP

                  |L1.72|
                          DCD      0x40011000
                  |L1.76|
                          DCD      0x40010800

                          AREA ||i.NVIC_Configuration||, CODE, READONLY, ALIGN=1

                  NVIC_Configuration PROC
;;;170    *******************************************************************************/
;;;171    void NVIC_Configuration(void)
000000  b508              PUSH     {r3,lr}
;;;172    {
;;;173      NVIC_InitTypeDef NVIC_InitStructure;
;;;174      
;;;175    #ifdef  VECT_TAB_RAM  
;;;176      /* Set the Vector Table base location at 0x20000000 */ 
;;;177      NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); 
;;;178    #else  /* VECT_TAB_FLASH  */
;;;179      /* Set the Vector Table base location at 0x08000000 */ 
;;;180      NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);   
000002  2100              MOVS     r1,#0
000004  f04f6000          MOV      r0,#0x8000000
000008  f7fffffe          BL       NVIC_SetVectorTable
;;;181    #endif
;;;182    
;;;183      /* Configure one bit for preemption priority */
;;;184      NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
00000c  f44f60c0          MOV      r0,#0x600
000010  f7fffffe          BL       NVIC_PriorityGroupConfig
;;;185      
;;;186      /* Enable the EXTI15_10 Interrupt */
;;;187      NVIC_InitStructure.NVIC_IRQChannel = EXTI15_10_IRQChannel;
000014  2028              MOVS     r0,#0x28
000016  f88d0000          STRB     r0,[sp,#0]
;;;188      NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
00001a  2000              MOVS     r0,#0
00001c  f88d0001          STRB     r0,[sp,#1]
;;;189      NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
000020  f88d0002          STRB     r0,[sp,#2]
;;;190      NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
000024  2001              MOVS     r0,#1
000026  f88d0003          STRB     r0,[sp,#3]
;;;191      NVIC_Init(&NVIC_InitStructure);
00002a  4668              MOV      r0,sp
00002c  f7fffffe          BL       NVIC_Init
;;;192    }
000030  bd08              POP      {r3,pc}
;;;193    
                          ENDP


                          AREA ||i.RCC_Configuration||, CODE, READONLY, ALIGN=2

                  RCC_Configuration PROC
;;;84     *******************************************************************************/
;;;85     void RCC_Configuration(void)
000000  b510              PUSH     {r4,lr}
;;;86     {
;;;87       /* RCC system reset(for debug purpose) */
;;;88       RCC_DeInit();
000002  f7fffffe          BL       RCC_DeInit
;;;89     
;;;90       /* Enable HSE */
;;;91       RCC_HSEConfig(RCC_HSE_ON);
000006  f44f3480          MOV      r4,#0x10000
00000a  4620              MOV      r0,r4
00000c  f7fffffe          BL       RCC_HSEConfig
;;;92     
;;;93       /* Wait till HSE is ready */
;;;94       HSEStartUpStatus = RCC_WaitForHSEStartUp();
000010  f7fffffe          BL       RCC_WaitForHSEStartUp
000014  4917              LDR      r1,|L3.116|
;;;95     
;;;96       if(HSEStartUpStatus == SUCCESS)
000016  2801              CMP      r0,#1
000018  7008              STRB     r0,[r1,#0]            ;94
00001a  d123              BNE      |L3.100|
;;;97       {
;;;98         /* HCLK = SYSCLK */
;;;99         RCC_HCLKConfig(RCC_SYSCLK_Div1); 
00001c  2000              MOVS     r0,#0
00001e  f7fffffe          BL       RCC_HCLKConfig
;;;100      
;;;101        /* PCLK2 = HCLK */
;;;102        RCC_PCLK2Config(RCC_HCLK_Div1); 
000022  2000              MOVS     r0,#0
000024  f7fffffe          BL       RCC_PCLK2Config
;;;103    
;;;104        /* PCLK1 = HCLK/2 */
;;;105        RCC_PCLK1Config(RCC_HCLK_Div2);
000028  11a0              ASRS     r0,r4,#6
00002a  f7fffffe          BL       RCC_PCLK1Config
;;;106    
;;;107        /* Flash 2 wait state */
;;;108        FLASH_SetLatency(FLASH_Latency_2);
00002e  2002              MOVS     r0,#2
000030  f7fffffe          BL       FLASH_SetLatency
;;;109        /* Enable Prefetch Buffer */
;;;110        FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
000034  2010              MOVS     r0,#0x10
000036  f7fffffe          BL       FLASH_PrefetchBufferCmd
;;;111    
;;;112        /* PLLCLK = 8MHz * 9 = 72 MHz */
;;;113        RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
00003a  f44f11e0          MOV      r1,#0x1c0000
00003e  4620              MOV      r0,r4
000040  f7fffffe          BL       RCC_PLLConfig
;;;114    
;;;115        /* Enable PLL */ 
;;;116        RCC_PLLCmd(ENABLE);
000044  2001              MOVS     r0,#1
000046  f7fffffe          BL       RCC_PLLCmd
                  |L3.74|
;;;117    
;;;118        /* Wait till PLL is ready */
;;;119        while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
00004a  2039              MOVS     r0,#0x39
00004c  f7fffffe          BL       RCC_GetFlagStatus
000050  2800              CMP      r0,#0
000052  d0fa              BEQ      |L3.74|
;;;120        {
;;;121        }
;;;122    
;;;123        /* Select PLL as system clock source */
;;;124        RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
000054  2002              MOVS     r0,#2
000056  f7fffffe          BL       RCC_SYSCLKConfig
;;;125    
;;;126        /* Wait till PLL is used as system clock source */
;;;127        while(RCC_GetSYSCLKSource() != 0x08)
00005a  bf00              NOP      
                  |L3.92|
00005c  f7fffffe          BL       RCC_GetSYSCLKSource
000060  2808              CMP      r0,#8
000062  d1fb              BNE      |L3.92|
                  |L3.100|
;;;128        {
;;;129        }
;;;130      }
;;;131       
;;;132      /* Enable GPIOA, GPIOC,USART1 and AFIO clock */
;;;133      RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOC| RCC_APB2Periph_AFIO|RCC_APB2Periph_USART1|RCC_APB2Periph_GPIOA, ENABLE);
000064  e8bd4010          POP      {r4,lr}
000068  2101              MOVS     r1,#1
00006a  f2440015          MOV      r0,#0x4015
00006e  f7ffbffe          B.W      RCC_APB2PeriphClockCmd
;;;134    }
;;;135    
                          ENDP

000072  0000              DCW      0x0000
                  |L3.116|
                          DCD      ||.data||

                          AREA ||i.USART_Configuration||, CODE, READONLY, ALIGN=2

                  USART_Configuration PROC
;;;200    *******************************************************************************/
;;;201    void USART_Configuration(void)
000000  b530              PUSH     {r4,r5,lr}
;;;202    {
000002  b087              SUB      sp,sp,#0x1c
;;;203      USART_InitTypeDef USART_InitStructure;
;;;204      USART_ClockInitTypeDef  USART_ClockInitStructure;
;;;205    /* USART1 configuration -----------------------------------------------
;;;206    
;;;207    -------*/
;;;208      /* USART1 configured as follow:
;;;209            - BaudRate = 115200 baud  
;;;210            - Word Length = 8 Bits
;;;211            - One Stop Bit
;;;212            - No parity
;;;213            - Hardware flow control disabled (RTS and CTS signals)
;;;214            - Receive and transmit enabled
;;;215            - USART Clock disabled
;;;216            - USART CPOL: Clock is active low
;;;217            - USART CPHA: Data is captured on the middle 
;;;218            - USART LastBit: The clock pulse of the last data bit is not 
;;;219    
;;;220    output to 
;;;221                             the SCLK pin
;;;222      */
;;;223    USART_ClockInitStructure.USART_Clock = USART_Clock_Disable;
000004  2400              MOVS     r4,#0
;;;224    USART_ClockInitStructure.USART_CPOL = USART_CPOL_Low;
;;;225    USART_ClockInitStructure.USART_CPHA = USART_CPHA_2Edge;
000006  f44f7000          MOV      r0,#0x200
00000a  f8ad0014          STRH     r0,[sp,#0x14]
;;;226    USART_ClockInitStructure.USART_LastBit = USART_LastBit_Disable;
;;;227    /* Configure the USART1 synchronous paramters */
;;;228    USART_ClockInit(USART1, &USART_ClockInitStructure);
00000e  4d11              LDR      r5,|L4.84|
000010  f8ad4010          STRH     r4,[sp,#0x10]         ;223
000014  f8ad4012          STRH     r4,[sp,#0x12]         ;224
000018  f8ad4016          STRH     r4,[sp,#0x16]         ;226
00001c  a904              ADD      r1,sp,#0x10
00001e  4628              MOV      r0,r5
000020  f7fffffe          BL       USART_ClockInit
;;;229    
;;;230    USART_InitStructure.USART_BaudRate = 19200;
000024  f44f4096          MOV      r0,#0x4b00
;;;231    USART_InitStructure.USART_WordLength = USART_WordLength_8b;
000028  9000              STR      r0,[sp,#0]
;;;232    USART_InitStructure.USART_StopBits = USART_StopBits_1;
;;;233    USART_InitStructure.USART_Parity = USART_Parity_No ;
00002a  f8ad4008          STRH     r4,[sp,#8]
;;;234    USART_InitStructure.USART_HardwareFlowControl = 
;;;235    
;;;236    USART_HardwareFlowControl_None;
;;;237    
;;;238    
;;;239    USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
00002e  200c              MOVS     r0,#0xc
000030  f8ad4004          STRH     r4,[sp,#4]            ;231
000034  f8ad000a          STRH     r0,[sp,#0xa]
000038  f8ad4006          STRH     r4,[sp,#6]            ;232
00003c  f8ad400c          STRH     r4,[sp,#0xc]          ;234
;;;240    /* Configure USART1 basic and asynchronous paramters */
;;;241    USART_Init(USART1, &USART_InitStructure);
000040  4669              MOV      r1,sp
000042  4628              MOV      r0,r5
000044  f7fffffe          BL       USART_Init
;;;242        
;;;243      /* Enable USART1 */
;;;244      USART_Cmd(USART1, ENABLE);
000048  2101              MOVS     r1,#1
00004a  4628              MOV      r0,r5
00004c  f7fffffe          BL       USART_Cmd
;;;245    }
000050  b007              ADD      sp,sp,#0x1c
000052  bd30              POP      {r4,r5,pc}
;;;246    
                          ENDP

                  |L4.84|
                          DCD      0x40013800

                          AREA ||i.fputc||, CODE, READONLY, ALIGN=2

                  fputc PROC
;;;254    
;;;255    int fputc(int ch, FILE *f)
000000  b570              PUSH     {r4-r6,lr}
;;;256    {
;;;257    #ifdef DBG_ITM
;;;258    /* PrintfݷITMĴ˿  */
;;;259      if (DEMCR & TRCENA) {
;;;260        while (ITM_Port32(0) == 0);
;;;261        ITM_Port8(0) = ch;
;;;262      }
;;;263    #else  
;;;264    /* Printfݷ */
;;;265      USART_SendData(USART1, (unsigned char) ch);
000002  4d05              LDR      r5,|L5.24|
000004  4604              MOV      r4,r0                 ;256
000006  b2c1              UXTB     r1,r0
000008  4628              MOV      r0,r5
00000a  f7fffffe          BL       USART_SendData
                  |L5.14|
;;;266      while (!(USART1->SR & USART_FLAG_TXE));
00000e  8828              LDRH     r0,[r5,#0]
000010  0600              LSLS     r0,r0,#24
000012  d5fc              BPL      |L5.14|
;;;267    #endif  
;;;268      return (ch);
000014  4620              MOV      r0,r4
;;;269    }
000016  bd70              POP      {r4-r6,pc}
;;;270    
                          ENDP

                  |L5.24|
                          DCD      0x40013800

                          AREA ||i.main||, CODE, READONLY, ALIGN=2

                  main PROC
;;;43     *******************************************************************************/
;;;44     int main(void)
000000  f7fffffe          BL       RCC_Configuration
;;;45     {
;;;46     #ifdef DEBUG
;;;47       debug();
;;;48     #endif
;;;49       
;;;50       /* System Clocks Configuration */
;;;51       RCC_Configuration();
;;;52            
;;;53       /* NVIC configuration */
;;;54       NVIC_Configuration();
000004  f7fffffe          BL       NVIC_Configuration
;;;55         
;;;56       /* Configure the GPIO ports */
;;;57       GPIO_Configuration();
000008  f7fffffe          BL       GPIO_Configuration
;;;58       USART_Configuration(); 
00000c  f7fffffe          BL       USART_Configuration
;;;59       printf(" System boot success!\n");
000010  a00b              ADR      r0,|L6.64|
000012  f7fffffe          BL       __2printf
;;;60       /* Connect EXTI Line13 to PC.13 */
;;;61       GPIO_EXTILineConfig(GPIO_PortSourceGPIOC, GPIO_PinSource13);
000016  210d              MOVS     r1,#0xd
000018  2002              MOVS     r0,#2
00001a  f7fffffe          BL       GPIO_EXTILineConfig
;;;62     
;;;63       /* Configure EXTI Line13 to generate an interrupt on falling edge */  
;;;64       EXTI_InitStructure.EXTI_Line = EXTI_Line13;
00001e  490e              LDR      r1,|L6.88|
000020  f44f5400          MOV      r4,#0x2000
;;;65       EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
000024  2000              MOVS     r0,#0
000026  600c              STR      r4,[r1,#0]  ; EXTI_InitStructure
000028  7108              STRB     r0,[r1,#4]
;;;66       EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;
00002a  200c              MOVS     r0,#0xc
00002c  7148              STRB     r0,[r1,#5]
;;;67       EXTI_InitStructure.EXTI_LineCmd = ENABLE;
00002e  2001              MOVS     r0,#1
000030  7188              STRB     r0,[r1,#6]
;;;68       EXTI_Init(&EXTI_InitStructure);
000032  4608              MOV      r0,r1
000034  f7fffffe          BL       EXTI_Init
;;;69     
;;;70       /* Generate software interrupt: simulate a falling edge applied on EXTI line 13 */
;;;71       EXTI_GenerateSWInterrupt(EXTI_Line13);
000038  4620              MOV      r0,r4
00003a  f7fffffe          BL       EXTI_GenerateSWInterrupt
                  |L6.62|
;;;72             
;;;73       while (1)
00003e  e7fe              B        |L6.62|
;;;74       {
;;;75       }
;;;76     }
;;;77     
                          ENDP

                  |L6.64|
000040  20537973          DCB      " System boot success!\n",0
000044  74656d20
000048  626f6f74
00004c  20737563
000050  63657373
000054  210a00  
000057  00                DCB      0
                  |L6.88|
                          DCD      ||.data||+0x4

                          AREA ||.data||, DATA, ALIGN=2

                  HSEStartUpStatus
000000  00000000          DCB      0x00,0x00,0x00,0x00
                  EXTI_InitStructure
                          %        8

                  __ARM_use_no_argv EQU 0
