Thursday, May 13, 2010

Stack programming tutorial

Question
Based on the following instruction, state the final value of AX,BX dan CX. Then draw the stack produce at 'PUSH CX' instruction. [Assume SS:5000h ; SP:0305h ]

 MODEL SMALL
.STACK
.STARTUP

MOV AX, 1000H
MOV BX, 2000H
MOV CX, 3000H

PUSH AX
PUSH BX
PUSH CX

POP AX
POP CX
POP BX

.EXIT
END

Answer

Final value:
AX=3000h
BX=2000h
CX=1000h

Address Data
50301    3000h
50303    2000h
50305    1000h

No comments:

Post a Comment

Popular Posts

Latest Post from my Other Blog