具体题目如下:/* * getByte - Extract byte n from word x* Bytes numbered from 0 (LSB) to 3 (MSB)* Examples:getByte(0x12345678,1) = 0x56* Legal ops:& ^ | + >* Max ops:6*/int getByte(int x,int n) {return 2;}

来源:学生作业帮助网 编辑:作业帮 时间:2024/10/05 21:56:44
具体题目如下:/* * getByte - Extract byte n from word x* Bytes numbered from 0 (LSB) to 3 (MSB)* Examples:getByte(0x12345678,1) = 0x56* Legal ops:& ^ | + >* Max ops:6*/int getByte(int x,int n) {return 2;}
xRN@2mE[+ wroRhR |.4JdFYč~M[p/8mn:s9w3啘Y0>ƫ,ݳQe5V`iA.%Qj$R!U1rP8 ~x3Qr,!uP0@BY|t !@R@b]IF{䱿 T |kE>}9 6笋9$lB^vaL\5,;$*aݶyukVKܑԯiyu6;~gN;R`ȭn Asx}c c6>l[o?Vd^\Ȥ:U%A(Ta '.׋-

具体题目如下:/* * getByte - Extract byte n from word x* Bytes numbered from 0 (LSB) to 3 (MSB)* Examples:getByte(0x12345678,1) = 0x56* Legal ops:& ^ | + >* Max ops:6*/int getByte(int x,int n) {return 2;}
具体题目如下:
/*
* getByte - Extract byte n from word x
* Bytes numbered from 0 (LSB) to 3 (MSB)
* Examples:getByte(0x12345678,1) = 0x56
* Legal ops:& ^ | + >
* Max ops:6
*/
int getByte(int x,int n) {
return 2;
}

具体题目如下:/* * getByte - Extract byte n from word x* Bytes numbered from 0 (LSB) to 3 (MSB)* Examples:getByte(0x12345678,1) = 0x56* Legal ops:& ^ | + >* Max ops:6*/int getByte(int x,int n) {return 2;}
从词x中取出第n(0~3)字节.
示例:从0x12345678中取出第1字节.
其中78是第0字节,56是第一字节,34是第二字节,12是第三字节,因为要求第一字节,所以取出0x56.
答案:
int getByte(int x,int n){return((x (8* n));}