为什么这是一个无效的操作数?
我正在编写的编译器生成了以下 ASM 文件:
; This code has been generated by the 7Basic
; compiler <http://launchpad.net/7basic>
; Uninitialized data
SECTION .bss
v_0 resb 4
v_4 resb 4
v_8 resb 4
; Code
SECTION .text
push 1
pop eax
mov v_0, eax
push 2
pop eax
mov v_4, eax
mov eax, v_0
push eax
mov eax, v_4
push eax
pop ebx
pop eax
imul eax,ebx
push eax
pop eax
mov v_8, eax
当我尝试编译它时,出现以下错误:
test.asm:16: 错误:操作码和操作数的组合无效
test.asm:19:错误:操作码和操作数的组合无效
test.asm:29: 错误:操作码和操作数的组合无效
这确实没有意义,因为根据 NASM 文档,我可以:
MOV mem_offs,reg_eax 386
为什么我不能执行此操作?
I have the following ASM file generated by a compiler I'm writing:
; This code has been generated by the 7Basic
; compiler <http://launchpad.net/7basic>
; Uninitialized data
SECTION .bss
v_0 resb 4
v_4 resb 4
v_8 resb 4
; Code
SECTION .text
push 1
pop eax
mov v_0, eax
push 2
pop eax
mov v_4, eax
mov eax, v_0
push eax
mov eax, v_4
push eax
pop ebx
pop eax
imul eax,ebx
push eax
pop eax
mov v_8, eax
When I try to compile it, I get the following errors:
test.asm:16: error: invalid combination of opcode and operands
test.asm:19: error: invalid combination of opcode and operands
test.asm:29: error: invalid combination of opcode and operands
This really doesn't make sense because according to the NASM docs, I'm allowed to:
MOV mem_offs, reg_eax 386
Why can't I perform this operation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要方括号来取消引用指针:
You need square brackets to dereference the pointers: