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.
哪个更好/更快/首选
1:
mov eax, 5
push eax
mov eax, [someAddress]
2:
push 5
push [someAddress]
#2 更快,因为汇编操作可以采用常数,因此您避免了加载 eax 寄存器的时间。#2也使eax空闲,如果您在寄存器中保存许多值,这很好,因为它可以帮助最小化内存访问。如果您知道这些值是常量,只需使用#2。