在我的类(class)笔记中,我得到了以下信息:
C:
thisthread.id = 4711;
汇编程序:
.text
.align 2
movia r8,thisthread
movi r9,4711
stw r9,4(r8) # id after sp that takes 4 bytes
但是 sp 不是需要 4 位吗?我认为偏移量是以位为单位指定的,而不是以字节为单位。我错了吗?
最佳答案
你错了。偏移量确实以字节为单位。
关于c - 将 C 语言翻译成汇编语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12257572/