In my course notes, I’ve got this info:
C:
thisthread.id = 4711;
Assembler:
.text
.align 2
movia r8,thisthread
movi r9,4711
stw r9,4(r8) # id after sp that takes 4 bytes
But doesn’t sp take 4 bits instead? I thought the offset was specified in bits, not in bytes. Am I mistaken?
You are mistaken. The offset is indeed in bytes.