Hi I have been looking online all over and my book just doesn't explain enough regarding how the load instructions work for Sparc assembly.
ldsb - load signed byte
ldub - load unsigned byte
ldsh - load signed half word
Lduh - load unsigned half word
Ld - load word
Ldd - load double
I also know a byte is 8 bits and that is 2 hex digits, half is 16 bits, and word is 32 bits.
So looking at this example with the solutions below can someone explain how to arrive to do that answer. The first column is Address(decimal) and the second column is Data(hex)
300. 78
301. 56
302. 34
303. 12
304. 9a
305. 00
306. 'H'
307. 'e'
308. 'l'
309. 'l'
310. 'o'
Ex. ld[%o1], %o0 %o1 = 0x12345678
Ex2. Ldub[%o0+7], %o2 %o2 = 'e'
Ex3. Ldsh[%o0+3], %o3 Error
Ex4. Ldsh[%o0+4], %o4 %o4 = 0x9a
Ex5. Ldsb[%o0+4], %o5 %o5 = ffffff9a
I just need help explaining why so I can understand this concept. Thanks