Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我真的迷路了,因为无论我如何尝试这段代码,我都会得到操作码和操作数错误的无效组合。我已经在 .bss 中声明了一个缓冲区,但我无法将值从寄存器移动到该位置,而且我不知道为什么。
numArgs: resb 4 mov dword numArgs, [esp+4]
显然我只是想检索给定的命令行参数的数量。如果有更简单的方法可以做到这一点,我会全力以赴,但我特别关心为什么我不能将值移动到内存缓冲区中。
你不能像那样将记忆移到记忆中。你必须做
mov eax,[esp+4] mov [numArgs],eax
或者:
push dword [esp+4] pop dword [numArgs]