/* @(#)sparc.h 1.1 92/07/30 SMI */
/*
* opcodes of the call instructions
*/
/*
* offset (in bytes) of the code from the entry address of a routine.
* (see asgnsamples for use and explanation.)
*/
#define OFFSET_OF_CODE 0 /* there is no mask on a SPARC */
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
/*
* address at which text begins N_TXTADDR is defined in a.out.h
*/
#define TORIGIN ((unsigned long) N_TXTADDR(xbuf))
/*
* Macros for manipulating instruction fields. These use the
* structures defined below
*/
#define OP(x) (((union instruct *) (x))->f_1.op)
#define DISP30(x) (((union instruct *) (x))->f_1.disp30)
#define OP3(x) (((union instruct *) (x))->f_3c.op3)
#define RD(x) (((union instruct *) (x))->f_3c.rd)
#define IMMED(x) (((union instruct *) (x))->f_3c.i)
#define SIMM13(x) (((((union instruct *) (x))->f_3d.simm13) << 19) >> 19)
#define RS1(x) (((union instruct *) (x))->f_3c.rs1)
#define RS2(x) (((union instruct *) (x))->f_3c.rs2)
/*
* a few values for operand and register fields
*/
#define CALL 0x1
#define FMT3_0x10 0x2
#define JMPL 0x38
#define R_G0 0x0
#define R_O7 0xF
#define R_I7 0x1F
/*
* A macro for converting from instructp to the appropriate address in
* the program
*/
#define PC_VAL(x) ((x) - (unsigned long) textspace + TORIGIN)
/*
* structures for decoding instructions
*/
struct f_1 {
unsigned long op:2,
disp30:30
};
struct f_2a {
unsigned long op:2,
rd:5,
op2:3,
imm22:22
};
struct f_2b {
unsigned long op:2,
a:1,
cond:4,
op2:3,
disp22:22
};
struct f_3a {
unsigned long op:2,
ign1:1,
cond:4,
op3:6,
rs1:5,
i:1,
ign2:8,
rs2:5
};
struct f_3b {
unsigned long op:2,
ign1:1,
cond:4,
op3:6,
rs1:5,
i:1,
simm13:13
};
struct f_3c {
unsigned long op:2,
rd:5,
op3:6,
rs1:5,
i:1,
asi:8,
rs2:5
};
struct f_3d {
unsigned long op:2,
rd:5,
op3:6,
rs1:5,
i:1,
simm13:13
};
struct f_3e {
unsigned long op:2,
rd:5,
op3:6,
rs1:5,
opf:9,
rs2:5
};
union instruct {
struct f_1 f_1;
struct f_2a f_2a;
struct f_2b f_2b;
struct f_3a f_3a;
struct f_3b f_3b;
struct f_3c f_3c;
struct f_3d f_3d;
struct f_3e f_3e;
};
sparc.rar_The Fields_sparc
版权申诉
160 浏览量
2022-09-24
07:19:59
上传
评论
收藏 908B RAR 举报
寒泊
- 粉丝: 74
- 资源: 1万+
最新资源
- pta题库答案c语言之排序4统计工龄.zip
- pta题库答案c语言之树结构7堆中的路径.zip
- pta题库答案c语言之树结构3TreeTraversalsAgain.zip
- pta题库答案c语言之树结构2ListLeaves.zip
- pta题库答案c语言之树结构1树的同构.zip
- 基于C++实现民航飞行与地图简易管理系统可执行程序+说明+详细注释.zip
- pta题库答案c语言之复杂度1最大子列和问题.zip
- 三维装箱问题(Three-Dimensional Bin Packing Problem,3D-BPP)是一个经典的组合优化问题
- 以下是一些关于Linux线程同步的基本概念和方法.txt
- 以下是一个简化的示例,它使用pygame库来模拟烟花动画的框架.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈