traps.c
来自「这个文件是西门子16位单片机从c166上的一些应用程序的源代码」· C语言 代码 · 共 60 行
C
60 行
/***********************************************************************/
/* This file is part of the C166 Compiler package */
/* Copyright KEIL ELEKTRONIK GmbH 1996 */
/***********************************************************************/
/* */
/* TRAPS.C: TRAP Handler for 166/167 hardware traps */
/* */
/* To translate this file use C166 with the following invocation: */
/* */
/* C166 TRAPS.C */
/* */
/* To link the modified TRAPS.OBJ file to your application use the */
/* following L166 invocation: */
/* */
/* L166 <your object file list>, TRAPS.OBJ <controls> */
/* */
/***********************************************************************/
/*
* Non-Maskable Interrupt
*/
#ifndef MCB167
static void NMI_trap (void) interrupt 0x02 {
/* add your code here */
while (1) { ; } /* end-less loop */
}
#endif
/*
* Stack Overflow Interrupt
*/
static void STKOF_trap (void) interrupt 0x04 {
/* add your code here */
while (1) { ; } /* end-less loop */
}
/*
* Stack Underflow Interrupt
*/
static void STKUF_trap (void) interrupt 0x06 {
/* add your code here */
while (1) { ; } /* end-less loop */
}
/*
* Class B Hardware Trap:
* -> Undefined Opcode
* -> Protected Instruction Fault
* -> Illegal Word Operand Access
* -> Illegal Instruction Access
* -> Illegal External Bus Access
*/
static void Class_B_trap (void) interrupt 0x0A {
/* add your code here */
while (1) { ; } /* end-less loop */
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?