In: Computer Science
ANSWER NUMBER 2 ONLY THANK YOU! :)
1) (a)There are 3 forms of Program Memory Addressing Modes: Direct,
Relative and Indirect. Explain/Illustrate what happens to CS and IP
registers if the JMP THERE instruction is stored at memory address
10000H (CS=1000H, IP=0000H) and the address of THERE is:
(A) 10020H
(B) 30000H
(b) Determine whether the JMP THERE instructions are SHORT, NEAR or
FAR jump. Explain your answer.
2) (a) Illustrate the PUSH BX instruction if BX =1234H and SS:SP = 1000:0002. (b) Illustrate POP CX if it is the subsequent instruction that accessed the Stack memory.
As you have mentioned you want question no 2 only
(a) Illustrate the PUSH BX instruction if BX =1234H and SS:SP = 1000:0002. (b) Illustrate POP CX if it is the subsequent instruction that accessed the Stack memory.
Stack is an area of memory for keeping temporary data. Stack is used by CALL instruction to keep return address for procedure, RET instruction gets this value from the stack and returns to that offset.
there are two instructions that work with the stack:
PUSH - stores 16 bit value in the stack.
POP - gets 16 bit value from the stack.
PUSH and POP work with 16 bit values only.
The stack uses LIFO (Last In First Out) algorithm
Here BX is the register so PUSH BX // store value of AX in stack
POP CX // set CX to original value of BX i.e 1234H
The exchange happens because stack uses LIFO (Last In First Out) algorithm
The stack memory area is set by SS (Stack Segment) register, and SP (Stack Pointer) register. Generally operating system sets values of these registers on program start
PUSH source" instruction does the following:
The current address pointed by SS:SP is called the top of the stack