How do I modify stack memory chunk in assembly?
I thought of one way, which is:
POP EAX
ADD EAX, 5
PUSH EAX
Is there a shorter more efficient way of doing this?
How do I modify stack memory chunk in assembly?
I thought of one way, which is:
POP EAX
ADD EAX, 5
PUSH EAX
Is there a shorter more efficient way of doing this?
You can address the value on the stack directly with a memory operand, as in
add dword [esp], 5
or
add qword [rsp], 5
if you are targeting 64 bit; in 16 bit mode, instead, sp
-based addressing is not available.