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 を使用してください。