Which one is better/faster/preferred
1:
mov eax, 5
push eax
mov eax, [someAddress]
push eax
2:
push 5
push [someAddress]
Which one is better/faster/preferred
1:
mov eax, 5
push eax
mov eax, [someAddress]
push eax
2:
push 5
push [someAddress]
#2 is faster because the assembly operation can take a constant, so you avoid the time loading the eax register. Also #2 leaves eax free, which is good if you are holding many values in registers as it can help minimize memory accesses. If you know the values are constants, just use #2.