@GNU AS
@.CharSet=CP1251

.syntax unified          @ синтаксис исходного кода
.thumb               @ тип используемых инструкций Thumb
.cpu cortex-m4          @ процессор
.fpu fpv4-sp-d16     @ сопроцессор

.section .vectors

@ таблица векторов прерываний
     .word     _STACK_END              @ 0x0000 Вершина стека 
     .word     Start+1                 @ 0x0004 RESET


@ Таблица прерываний для ядра микроконтроллеров STM32F303xx
     .word     IRQ_NMI+1               @ 0x0008 NMI
     .word     IRQ_HardFault+1         @ 0x000C Hard Fault
     .word     IRQ_MemFault+1          @ 0x0010 Memory management fault
     .word     IRQ_BusFault+1          @ 0x0014 Bus Fault
     .word     IRQ_UsageFault+1        @ 0x0018 Usage Fault
     .word     0               @ 0x001C Reserved
     .word     0               @ 0x0020 Reserved
     .word     0               @ 0x0024 Reserved
     .word     0               @ 0x0028 Reserved
     .word     IRQ_SVCall+1            @ 0x002C SVCall
     .word     0               @ 0x0030 Reserved
     .word     0               @ 0x0034 Reserved
     .word     IRQ_PendSV+1            @ 0x0038 PendSV
     .word     IRQ_SysTick+1           @ 0x003C SysTick

@ Прерывания периферии микроконтроллера
     .word     IRQ_WWDG+1              @ 0x0040 Window Watchdog interrupt
     .word     IRQ_PVD+1               @ 0x0044 PVD through EXTI line detection interrupt
     .word     IRQ_TAMP_STAMP+1        @ 0x0048 Tamper and TimeStamp interrupts through the EXTI line
     .word     IRQ_RTC_WKUP+1          @ 0x004C RTC Wakeup interrupt through the EXTI line
     .word     IRQ_FLASH+1             @ 0x0050 Flash global interrupt
     .word     IRQ_RCC+1               @ 0x0054 RCC global interrupt
     .word     IRQ_EXTI0+1             @ 0x0058 EXTI Line0 interrupt
     .word     IRQ_EXTI1+1             @ 0x005C EXTI Line1 interrupt
     .word     IRQ_EXTI2_TS+1          @ 0x0060 EXTI Line2 and Touch sensing interrupts
     .word     IRQ_EXTI3+1             @ 0x0064 EXTI Line3 interrupt
     .word     IRQ_EXTI4+1             @ 0x0068 EXTI Line4 interrupt
     .word     DMA1_Channel1+1         @ 0x006C DMA1 channel 1 interrupt
     .word     DMA1_Channel2+1         @ 0x0070 DMA1 channel 2 interrupt
     .word     DMA1_Channel3+1         @ 0x0074 DMA1 channel 3 interrupt
     .word     DMA1_Channel4+1         @ 0x0078 DMA1 channel 4 interrupt
     .word     DMA1_Channel5+1         @ 0x007C DMA1 channel 5 interrupt
     .word     DMA1_Channel6+1         @ 0x0080 DMA1 channel 6 interrupt
     .word     DMA1_Channel7+1         @ 0x0084 DMA1 channel 7 interrupt
     .word     IRQ_ADC1_2+1            @ 0x0088 ADC1, ADC2 global interrupts
     .word     IRQ_USBHP_CAN_TX+1      @ 0x008C USB High Priority/CAN_TX interrupts
     .word     IRQ_USBLP_CAN_RX0+1     @ 0x0090 USB Low Priority/CAN_RX0 interrupts
     .word     IRQ_CAN_RX1+1           @ 0x0094 CAN RX1 interrupt
     .word     IRQ_CAN_SCE+1           @ 0x0098 CAN SCE interrupt
     .word     IRQ_EXTI9_5+1           @ 0x009C EXTI Line[9:5] interrupts
     .word     IRQ_TIM1_BRK_TIM15+1    @ 0x00A0 TIM1 Break/TIM15 global interrupts
     .word     IRQ_TIM1_UP_TIM16+1     @ 0x00A4 TIM1 Update/TIM16 global interrupts
     .word     IRQ_TIM1_TRG_COM_TIM17+1 @ 0x00A8 TIM1 trigger and commutation/TIM17 interrupts
     .word     IRQ_TIM1_CC+1           @ 0x00AC TIM1 Capture Compare interrupt
     .word     IRQ_TIM2+1              @ 0x00B0 TIM2 global interrupt
     .word     IRQ_TIM3+1              @ 0x00B4 TIM3 global interrupt
     .word     IRQ_TIM4+1              @ 0x00B8 TIM4 global interrupt
     .word     IRQ_I2C1_EV+1           @ 0x00BC I2C1 event interrupt & EXTI Line23 interrupt
     .word     IRQ_I2C1_ER+1           @ 0x00C0 I2C1 error interrupt
     .word     IRQ_I2C2_EV+1           @ 0x00C4 I2C2 event interrupt & EXTI Line24 interrupt
     .word     IRQ_I2C2_ER+1           @ 0x00C8 I2C2 error interrupt
     .word     IRQ_SPI1+1              @ 0x00CC SPI1 global interrupt
     .word     IRQ_SPI2+1              @ 0x00D0 SPI2 global interrupt
     .word     IRQ_USART1+1            @ 0x00D4 USART1 global interrupt
     .word     IRQ_USART2+1            @ 0x00D8 USART2 global interrupt
     .word     IRQ_USART3+1            @ 0x00DC USART3 global interrupt
     .word     IRQ_EXTI15_10+1         @ 0x00E0 EXTI Line[15:10] interrupts
     .word     IRQ_RTC_Alarm+1         @ 0x00E4 RTC Alarms (A and B) through EXTI line interrupt
     .word     IRQ_USBWakeUp+1         @ 0x00E8 USB wakeup from Suspend (EXTI line 18)
     .word     IRQ_TIM8_BRK+1          @ 0x00EC TIM8 Break interrupt
     .word     IRQ_TIM8_UP+1           @ 0x00F0 TIM8 Update interrupt
     .word     IRQ_TIM8_TRG_COM+1      @ 0x00F4 TIM8 Trigger and Commutation interrupts
     .word     IRQ_TIM8_CC+1           @ 0x00F8 TIM8 Capture Compare interrupt
     .word     IRQ_ADC3+1              @ 0x00FC ADC3 global interrupt
     .word     IRQ_FSMC+1              @ 0x0100 FSMC global interrupt
     .word     0              @ 0x0104 Reserved
     .word     0              @ 0x0108 Reserved
     .word     IRQ_SPI3+1              @ 0x010C SPI3 global interrupt
     .word     IRQ_UART4+1             @ 0x0110 UART4 global interrupt
     .word     IRQ_UART5+1             @ 0x0114 UART5 global interrupt
     .word     IRQ_TIM6_DAC+1          @ 0x0118 TIM6 global interrupt, DAC1 and DAC2 underrun error interrupts
     .word     IRQ_TIM7+1              @ 0x011C TIM7 global interrupt
     .word     IRQ_DMA2_Channel1+1     @ 0x0120 DMA2 channel1 global interrupt
     .word     IRQ_DMA2_Channel2+1     @ 0x0124 DMA2 channel2 global interrupt
     .word     IRQ_DMA2_Channel3+1     @ 0x0128 DMA2 channel3 global interrupt
     .word     IRQ_DMA2_Channel4+1     @ 0x012C DMA2 channel4 global interrupt
     .word     IRQ_DMA2_Channel5+1     @ 0x0130 DMA2 channel5 global interrupt
     .word     IRQ_ADC4+1              @ 0x0134 ADC4 global interrupt
     .word     0             @ 0x0138 Reserved
     .word     0             @ 0x013C Reserved
     .word     IRQ_COMP1_2_3+1         @ 0x0140 COMP1 & COMP2 & COMP3 interrupts combined with EXTI Lines 21, 22 and 29 interrupts.
     .word     IRQ_COMP4_5_6+1         @ 0x0144 COMP4 & COMP5 & COMP6 interrupts combined with EXTI Lines 30, 31 and 32 interrupts.
     .word     IRQ_COMP7+1             @ 0x0148 COMP7 interrupt combined with EXTI Line 33 interrupt
     .word     0             @ 0x014C Reserved
     .word     0             @ 0x0150 Reserved
     .word     0             @ 0x0154 Reserved
     .word     0             @ 0x0158 Reserved
     .word     0             @ 0x015C Reserved
     .word     IRQ_I2C3_EV+1           @ 0x0160 I2C3 event interrupt
     .word     IRQ_I2C3_ER+1           @ 0x0164 I2C3 error interrupt
     .word     IRQ_USB_HP+1            @ 0x0168 USB High priority interrupt
     .word     IRQ_USB_LP+1            @ 0x016C USB Low priority interrupt
     .word     IRQ_USB_WakeUp_RMP+1    @ 0x0170 USB wake up from Suspend and EXTI Line 18
     .word     IRQ_TIM20_BRK+1         @ 0x0174 TIM20 Break interrupt
     .word     IRQ_TIM20_UP+1          @ 0x0178 TIM20 Upgrade interrupt
     .word     IRQ_TIM20_TRG_COM+1     @ 0x017C TIM20 Trigger and Commutation interrupt
     .word     IRQ_TIM20_CC+1          @ 0x0180 TIM20 Capture Compare interrupt
     .word     IRQ_FPU+1               @ 0x0184 FPU global interrupt
     .word     0             @ 0x0188 Reserved
     .word     0             @ 0x018C Reserved
     .word     IRQ_SPI4+1              @ 0x0190 SPI4 Global interrupt

@ Заглушки для любых необрабатываемых прерываний

@ Прерывания ядра микроконтроллера

.weak IRQ_NMI
IRQ_NMI:

.weak IRQ_HardFault
IRQ_HardFault:

.weak IRQ_MemFault
IRQ_MemFault:

.weak IRQ_BusFault
IRQ_BusFault:

.weak IRQ_UsageFault
IRQ_UsageFault:

.weak IRQ_SVCall
IRQ_SVCall:

.weak IRQ_DebugMonitor
IRQ_DebugMonitor:

.weak IRQ_PendSV
IRQ_PendSV:

.weak IRQ_SysTick
IRQ_SysTick:

@ прерывания периферии микроконтроллера

.weak IRQ_WWDG
IRQ_WWDG:

.weak IRQ_PVD
IRQ_PVD:

.weak IRQ_TAMP_STAMP
IRQ_TAMP_STAMP:

.weak IRQ_RTC_WKUP
IRQ_RTC_WKUP:

.weak IRQ_FLASH
IRQ_FLASH:

.weak IRQ_RCC
IRQ_RCC:

.weak IRQ_EXTI0
IRQ_EXTI0:

.weak IRQ_EXTI1
IRQ_EXTI1:

.weak IRQ_EXTI2_TS
IRQ_EXTI2_TS:

.weak IRQ_EXTI3
IRQ_EXTI3:

.weak IRQ_EXTI4
IRQ_EXTI4:

.weak DMA1_Channel1
DMA1_Channel1:

.weak DMA1_Channel2
DMA1_Channel2:

.weak DMA1_Channel3
DMA1_Channel3:

.weak DMA1_Channel4
DMA1_Channel4:

.weak DMA1_Channel5
DMA1_Channel5:

.weak DMA1_Channel6
DMA1_Channel6:

.weak DMA1_Channel7
DMA1_Channel7:

.weak IRQ_ADC1_2
IRQ_ADC1_2:

.weak IRQ_USBHP_CAN_TX
IRQ_USBHP_CAN_TX:

.weak IRQ_USBLP_CAN_RX0
IRQ_USBLP_CAN_RX0:

.weak IRQ_CAN_RX1
IRQ_CAN_RX1:

.weak IRQ_CAN_SCE
IRQ_CAN_SCE:

.weak IRQ_EXTI9_5
IRQ_EXTI9_5:

.weak IRQ_TIM1_BRK_TIM15
IRQ_TIM1_BRK_TIM15:

.weak IRQ_TIM1_UP_TIM16
IRQ_TIM1_UP_TIM16:

.weak IRQ_TIM1_TRG_COM_TIM17
IRQ_TIM1_TRG_COM_TIM17:

.weak IRQ_TIM1_CC
IRQ_TIM1_CC:

.weak IRQ_TIM2
IRQ_TIM2:

.weak IRQ_TIM3
IRQ_TIM3:

.weak IRQ_TIM4
IRQ_TIM4:

.weak IRQ_I2C1_EV
IRQ_I2C1_EV:

.weak IRQ_I2C1_ER
IRQ_I2C1_ER:

.weak IRQ_I2C2_EV
IRQ_I2C2_EV:

.weak IRQ_I2C2_ER
IRQ_I2C2_ER:

.weak IRQ_SPI1
IRQ_SPI1:

.weak IRQ_SPI2
IRQ_SPI2:

.weak IRQ_USART1
IRQ_USART1:

.weak IRQ_USART2
IRQ_USART2:

.weak IRQ_USART3
IRQ_USART3:

.weak IRQ_EXTI15_10
IRQ_EXTI15_10:

.weak IRQ_RTC_Alarm
IRQ_RTC_Alarm:

.weak IRQ_USBWakeUp
IRQ_USBWakeUp:

.weak IRQ_TIM8_BRK
IRQ_TIM8_BRK:

.weak IRQ_TIM8_UP
IRQ_TIM8_UP:

.weak IRQ_TIM8_TRG_COM
IRQ_TIM8_TRG_COM:

.weak IRQ_TIM8_CC
IRQ_TIM8_CC:

.weak IRQ_ADC3
IRQ_ADC3:

.weak IRQ_FSMC
IRQ_FSMC:

.weak IRQ_SPI3
IRQ_SPI3:

.weak IRQ_UART4
IRQ_UART4:

.weak IRQ_UART5
IRQ_UART5:

.weak IRQ_TIM6_DAC
IRQ_TIM6_DAC:

.weak IRQ_TIM7
IRQ_TIM7:

.weak IRQ_DMA2_Channel1
IRQ_DMA2_Channel1:

.weak IRQ_DMA2_Channel2
IRQ_DMA2_Channel2:

.weak IRQ_DMA2_Channel3
IRQ_DMA2_Channel3:

.weak IRQ_DMA2_Channel4
IRQ_DMA2_Channel4:

.weak IRQ_DMA2_Channel5
IRQ_DMA2_Channel5:

.weak IRQ_ADC4
IRQ_ADC4:

.weak IRQ_COMP1_2_3
IRQ_COMP1_2_3:

.weak IRQ_COMP4_5_6
IRQ_COMP4_5_6:

.weak IRQ_COMP7
IRQ_COMP7:

.weak IRQ_I2C3_EV
IRQ_I2C3_EV:

.weak IRQ_I2C3_ER
IRQ_I2C3_ER:

.weak IRQ_USB_HP
IRQ_USB_HP:

.weak IRQ_USB_LP
IRQ_USB_LP:

.weak IRQ_USB_WakeUp_RMP
IRQ_USB_WakeUp_RMP:

.weak IRQ_TIM20_BRK
IRQ_TIM20_BRK:

.weak IRQ_TIM20_UP
IRQ_TIM20_UP:

.weak IRQ_TIM20_TRG_COM
IRQ_TIM20_TRG_COM:

.weak IRQ_TIM20_CC
IRQ_TIM20_CC:

.weak IRQ_FPU
IRQ_FPU:

.weak IRQ_SPI4
IRQ_SPI4:

int_vect_terminator:
          B     int_vect_terminator
