PCHL:
- This instruction loads the contents of HL register pair into the program counter (PC).
- Thus the program control is transferred to the address given in HL register pair.
- No flags are affected.
- It is a one byte instruction.
- Register addressing mode is used.
Example:
If HL = 4000H
PCHL ; This instruction will load PC with 4000H and program control is transferred at 4000H.
RST n:
- This instruction transfers the program control to the specific memory location.
- It is like a CALL instruction but in this instruction, the program control is transferred to a fixed address.
- These fixed addresses are called vector addresses.
- The processor calculates these vector addresses by multiplying RST number i.e. n by 8.
- Just like CALL instruction, before transferring the program control to the vector address, it saves the current contents of program counter on the stack.
- No flags are affected.
- It is a one byte instruction.
- Register indirect addressing mode is used.
Example:
If SP = 4000H
2000H RST 6 ; This instruction will copy the current contents of PC i.e. 2001H on the stack and it will load the PC with vector address 0030H (6 * 8 = 48 in decimal = 0030H).
Comments
Post a Comment