由买买提看人间百态

topics

全部话题 - 话题: byte2
(共0页)
n**d
发帖数: 9764
1
来自主题: Programming版 - structure to integer
struct
{
char unused_bits;
char used_bits;
} abc
short byte2;
I am tring to assign abc to byte2 like this:
byte2 = abc.used_bits;
byte2 << 8;
byte2 = byte2 | abc.unused_bits;
Here we assume used_bits is in the high 8 bits. It is always true no matter
what system and compiler?
H**********5
发帖数: 2012
2
来自主题: JobHunting版 - 两道题,求解,谢谢
1
The memory (Big Endian) contains data as mapped below:
Address Byte0 Byte1 Byte2 Byte3
0 00 00 FF FF
4 55 AA AA 55
Register $s0 equals to 0 initially.
(1)After the instruction: lb $s1, 0($s0) execution, the content of $s1
becomes:
(2)After the instruction: lbu $s1, 0($s0) execution, the content of $s1
becomes:
2
What’s the 2’s complement of 0xffff0001 :
A. 0x7fff ffff
B. 0xffff 7fff
C. 0x0000 ffff
D. 0xffff 0000
E. None above
3
What’s the 2’s complem... 阅读全帖
(共0页)