I'll sort it out, I don't know if I understand it correctly;
/* BASIC INTERRUPT VECTOR TABLE FOR STM8 devices
* Copyright (c) 2007 STMicroelectronics
*/
//typedef void (*)void,; define a type (pointer to function) to get the function entry address pointer of void type function
typedef void @far (*interrupt_handler_t)(void);
//Define a structure type to store {interrupt instruction, interrupt handler name (i.e. interrupt function entry pointer)}
struct interrupt_vector {
unsigned char interrupt_instruction;
interrupt_handler_t interrupt_handler;
};
//Define an empty interrupt function and return directly to the main function after execution
@far @interrupt void NonHandledInterrupt (void)
{
/* in order to detect unexpected events during development,
it is recommended to set a breakpoint on the following instruction
*/
return;
}
//Declare the startup initialization program, the _stext() program is defined elsewhere
extern void _stext(); /* startup routine */
//Define a two-dimensional array to store interrupt instructions and interrupt function entry address pointers in pairs,
//MCU executes 0x82 instruction to "jump" to the corresponding interrupt program entry address according to the second subscript value [2,32]
//The array is stored at the starting address 0x8000 marked by the const key value, that is, _vectab represents the starting address 0x8000
//1, struct interrupt_vector const _vectab[]={}
//2, +seg .const -b 0x8000 -k
//CALL is paired with RET, and this 0x82 instruction is paired with IRET
struct interrupt_vector const _vectab[] = {
//Force _stext to interrupt_handler_t type
{0x82, (interrupt_handler_t)_stext}, /* reset */
{0x82, NonHandledInterrupt}, /* trap */
{0x82, NonHandledInterrupt}, /* irq0 */
{0x82, NonHandledInterrupt}, /* irq1 */
{0x82, NonHandledInterrupt}, /* irq2 */
{0x82, NonHandledInterrupt}, /* irq3 */
{0x82, NonHandledInterrupt}, /* irq4 */
{0x82, NonHandledInterrupt}, /* irq5 */
{0x82, NonHandledInterrupt}, /* irq6 */
{0x82, NonHandledInterrupt}, /* irq7 */
{0x82, NonHandledInterrupt}, /* irq8 */
{0x82, NonHandledInterrupt}, /* irq9 */
{0x82, NonHandledInterrupt}, /* irq10 */
{0x82, NonHandledInterrupt}, /* irq11 */
{0x82, NonHandledInterrupt}, /* irq12 */
{0x82, NonHandledInterrupt}, /* irq13 */
{0x82, NonHandledInterrupt}, /* irq14 */
{0x82, NonHandledInterrupt}, /* irq15 */
{0x82, NonHandledInterrupt}, /* irq16 */
{0x82, NonHandledInterrupt}, /* irq17 */
{0x82, NonHandledInterrupt}, /* irq18 */
{0x82, NonHandledInterrupt}, /* irq19 */
{0x82, NonHandledInterrupt}, /* irq20 */
{0x82, NonHandledInterrupt}, /* irq21 */
{0x82, NonHandledInterrupt}, /* irq22 */
{0x82, NonHandledInterrupt}, /* irq23 */
{0x82, NonHandledInterrupt}, /* irq24 */
{0x82, NonHandledInterrupt}, /* irq25 */
{0x82, NonHandledInterrupt}, /* irq26 */
{0x82, NonHandledInterrupt}, /* irq27 */
{0x82, NonHandledInterrupt}, /* irq28 */
{0x82, NonHandledInterrupt}, /* irq29 */
};
Previous article:stm8s jumps out of the interrupt program c language, STM8 UART receives the interrupt program
Next article:stm8s realizes serial port interrupt connection and interrupt sending functions
Recommended ReadingLatest update time:2024-11-22 21:52
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Why are there always connection points when drawing the wiring of the schematic in KICAD? And the lines are always misplaced. Why is this the case?
- Components Science Popularization: Working Principle Analysis of Thermal Protector
- Who knows the principle of voltage doubling circuit? No transformer or inductor is used, just a few diodes and capacitors...
- EEWORLD University Hall----Application of GaN power devices in 1.4KV multi-level system
- TI's comprehensive overview of RFID applications
- Classification and characteristics of PIC 8-bit microcontrollers (Part 2)
- 6. DMA implementation of USART1 sending and receiving
- Application of CAN bus technology in digital servo system
- Embedded Temperature Measurement System Based on TMS320F2812DSP
- PICO's Wireless REPL