exception.c

来自「AT91所有开发板的资料 AT91所有开发板的资料」· C语言 代码 · 共 47 行

C
47
字号
/***************************************************************************   Copyright ARM Limited 1999 - 2000.  All rights reserved.****************************************************************************	$Id: exception.c,v 1.4 2000/01/12 16:08:01 mquinn Exp $****************************************************************************/#include "uhal.h"extern void print_header(void);extern void print_end(void);char *test_name = "Exception Test for lib C\n";char *test_ver = "Program Version 1.0\n";int main(int argc, int *argv[]){    int result;    infoType platformInfo;    print_header();    uHALr_printf("*** Division by zero exception test for lib C ***\n\n");    uHALr_GetPlatformInfo(&platformInfo);    uHALr_printf("platform Id : 0x%08X\n", platformInfo.platformId);    uHALr_printf("memory Size : 0x%08X\n", platformInfo.memSize);    uHALr_printf("cpu ID      : 0x%08X\n\n", platformInfo.cpuId);#if USE_C_LIBRARY == 0    result = 1;    uHALr_printf("Sorry, this image has not been built to use the C library\n");#else    // Deliberatly cause a divide-by-zero exception.    result = 1 / 0;#endif    print_end();    return (OK);}// End of file - exception.c

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?