Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct R{
- unsigned int opcode: 6;
- unsigned int rs: 5;
- unsigned int rt: 5;
- unsigned int rd: 5;
- unsigned int shamt: 5;
- unsigned int funct: 6;
- };
- struct R test = {32,0,11,21,19,0}
- FILE *fp = fopen("./result", "rb");
- fwrite(&test,sizeof(test),1,result);
- 00000000: 00100000 01011000 01110101 00000010
- 00000000: 00100000 10100000 01110011 00000001
- struct R{
- char opcode[6];
- char rs[5];
- char rt[5];
- char rd[5];
- char shamt[5];
- char funct[6];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement