The original user deleted the question after he got an answer, the following answers will give you the context of his question.
ax=3000h bx=1000h cx=2000h
.386
.model flat, stdcall
option casemap :none
include \MASM32\INCLUDE\windows.inc
include \MASM32\INCLUDE\masm32.inc
include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc
includelib \MASM32\LIB\masm32.lib
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib
.data
form db "AX: %x BX: %x CX %x", 0
.data?
buffer db 512 dup(?)
.code
start:
xor eax, eax
xor ebx, ebx
xor ecx, ecx
MOV AX ,1000H
MOV BX ,2000H
MOV CX ,3000H
PUSH AX
PUSH BX
PUSH CX
POP AX
POP CX
POP BX
invoke wsprintf,ADDR buffer,ADDR form,eax, ebx, ecx
invoke MessageBox,0,ADDR buffer,NULL,MB_ICONASTERISK
invoke ExitProcess,0
end start
(http://i005.radikal.ru/1107/19/cb173263e21b.png)
After loading AX, BX or CX with a value the higher word of EAX, EBX or ECX remains untouched. So, i.e. EAX could be ABCD3000h if the higher word of EAX was ABCDh.
Final values:
AX=3000h
CX=2000h
BX=1000h
Simple rule:
Last IN (Push)
First OUT (Pop)
The order that you POP the 3 registers is the reverse order of the 3 that you pushed. The stack is a last on, first off system with PUSH / POP.
http://www.emu8086.com/ may be it's better try 16 bit assembler first? this program allow see how computer work
(http://i058.radikal.ru/1102/64/eea23a98dc88.gif)
wow thanks ppl. really appreciate it very much! thread closed
:bg
we don't "close threads" unless there is something malicious in them
that way, the topic title, etc may be searched for future reference
not to worry
most everyone in here knows how the stack works
i am surprised that bogdan hasn't noticed this thread :lol
I have, make a point of not doing this again, this is a forum of members, not a paid help desk. :tdown
The thread is now locked.