将C翻译为装配

Nik*_*ntz 0 c assembly mips

在我的课程笔记中,我有这个信息:

C:

thisthread.id = 4711;
Run Code Online (Sandbox Code Playgroud)

汇编程序:

.text
.align 2
movia r8,thisthread
movi r9,4711
stw r9,4(r8) # id after sp that takes 4 bytes
Run Code Online (Sandbox Code Playgroud)

但是不是sp取4位吗?我认为偏移量是以位为单位指定的,而不是以字节为单位.我错了吗?

dus*_*uff 7

你误会了.偏移量确实以字节为单位.