Hello,
In the book I am readng it states the following
about this function in relation to the STACK:
-----------------------------------------
mov ax, 100
push ax ; sp2
mov bx, 200
push bx ; sp3
The push instruction performs two steps:
1. 2 (not 1) is subtracted from sp
2. The specified register value is copied to
------------------------------------------
Now my question is why does it subtract two?
Is it because items on the STACK occupy 2-byte
words, or am I completely off track!? Thankful for any
help.
// SuperCali
In the book I am readng it states the following
about this function in relation to the STACK:
-----------------------------------------
mov ax, 100
push ax ; sp2
mov bx, 200
push bx ; sp3
The push instruction performs two steps:
1. 2 (not 1) is subtracted from sp
2. The specified register value is copied to
------------------------------------------
Now my question is why does it subtract two?
Is it because items on the STACK occupy 2-byte
words, or am I completely off track!? Thankful for any
help.
// SuperCali
Push ax
two is subtracted from the stack pointer because you are pushing a word value which is two bytes long.
if you were to ' PUSh ah' then 1 would be subtracted
likewise if it were 'push eax' four would be subtracted since eax is 4 bytes long
two is subtracted from the stack pointer because you are pushing a word value which is two bytes long.
if you were to ' PUSh ah' then 1 would be subtracted
likewise if it were 'push eax' four would be subtracted since eax is 4 bytes long
Thanks for clearing that up for me.
// SuperCali
// SuperCali