This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: unsigned int valid : 1; } bits; bits.data0 = a; bits.data1 = bits.data0; bits.data2 = d; bits.valid = 1; Assume that the struct bits is in $s0 and the memory address of a is stored in $s1 Solution: lb $s0, 0($sl) # load the lower 8 bytes of a into bits sll $t0, $s0, 8 # $t0 = bits << 8 or $s0, $s0, $t0 # bits.data1 = bits.data0 lui $s0, 0000 0000 0110 0100 # bits.data2 = d lui $t0, 0000 0001 0000 0000 # load a 1 into the upper bits of $t0 or $s0, $s0, $t0 # bits.valid = 1...
View Full Document
This note was uploaded on 04/15/2008 for the course ENGR 2405 taught by Professor Bittle during the Fall '08 term at North Texas.
- Fall '08