⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fptrap.c

📁 这是一个同样来自贝尔实验室的和UNIX有着渊源的操作系统, 其简洁的设计和实现易于我们学习和理解
💻 C
字号:
#include	"u.h"#include	"../port/lib.h"#include	"mem.h"#include	"dat.h"#include	"fns.h"#include	"ureg.h"#include	"io.h"#include	"../port/error.h"char *fpcause[] ={	"invalid operation",	"division by zero",	"overflow",	"underflow",	"inexact operation",	"integer overflow",};char	*fpexcname(Ureg*, ulong, char*);voidfptrap(Ureg *ur){	char buf[ERRMAX];	int i;	ulong reason;	ur->pc &= ~2;	reason = (ulong)ur->a0;	for (i = 1; i < 6; i++)		if (reason & (1<<i)) {			sprint(buf, "fp: %s", fpcause[i-1]);			goto found;		}	sprint(buf, "fp: code 0x%lux", reason);found:	fataltrap(ur, buf);}char*fpexcname(Ureg *ur, ulong fcr31, char *buf){	USED(ur, fcr31, buf);	return buf;}

⌨️ 快捷键说明

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