100% found this document useful (1 vote)
4K views1 page

Sap 3: Push, Pop, Call Instruction

DOWLOAD HERE: http://adf.ly/aJVg0 ====== PUSH INSTRUCTION POP INSTRUCTION CALL INSTRUCTION CENG03
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
100% found this document useful (1 vote)
4K views1 page

Sap 3: Push, Pop, Call Instruction

DOWLOAD HERE: http://adf.ly/aJVg0 ====== PUSH INSTRUCTION POP INSTRUCTION CALL INSTRUCTION CENG03
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 1

PUSH INSTRUCTION

Note: The contents of the accumulator and the flag register are known as the Program Status Word (PSW). Format: PSW = AF A = content of the accumulator F = content of the flag register Note: Push instructions allow us to save data in a stack. PUSH B where: B = BC PUSH D D = DE PUSH H H = HL PUSH PSW PSW = Program Status Word Note: When a push instruction is executed the following things happen: 1. The stack pointer is decremented to get a new value of SP-1 2. The high byte in the specified register pair is stored in MSP-1 3. The stack pointer is decremented again to get SP-2 4. The low byte in the specified register pair is stored in MSP-2 Example 1: BC = 5612H SP = 2100H PUSH B

POP INSTRUCTIONS
POP B POP D POP H POP PSW Example 1: POP PSW POP H SP = 2OFAH AF = 9A25H HL = 5678H where: B stands for BC D stands for DE H stands for HL PSW for Program Status Word

CALL AND RET


Note: The main purpose of the SAP3 stack is to save return addresses automatically when using calls. When a call address is executed, the contents of the program counter are pushed onto the stack. Then the starting address of the subroutine is loaded into the program counter. In this way, the next instruction fetched is the first instruction of the subroutine. On the completion of the subroutine, a RET instruction POPS the return address off the stack into the program counter. PUSH PSW PUSH D PUSH H Example: ADDRESS 2000H 3000H 2006H 20FFH 8050H 8059H RET INSTRUCTION LXI SP, 2100H CALL 8050H MVI A, 0EH HLT

Example 2: SP = 2100H AF = 5678H DE = 5678H HL = 9A25H

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy