x86寄存器结构图
实现代码
typedef struct{
union{
union{
uint32_t _32;
uint16_t _16;
uint8_t _8[2];
}gpr[8];
struct{
uint32_t eax,ecx,edx,ebx,esp,ebp,esi,edi;
};
};
}reg;
Plus
在 C 语言中,可以在结构体中声明某个联合体(或结构体)而不用指出它的名字,如此之后就可以像使用结构体成员一样直接使用其中联合体(或结构体)的成员。
https://blog.youkuaiyun.com/u012308586/article/details/105728995