SPHL:
- This instruction copies the contents of HL register pair to the stack pointer (SP).
- It means that the stack pointer will now point to the memory location whose address was given in the HL register pair.
- No flags are affected.
- It is a one byte instruction.
- Register addressing mode is used.
Example:
If HL = 2030H, then
SPHL ; This instruction will copy 2030H into SP. So SP will point to the memory location 2030H.
XTHL:
- This instruction exchanges the contents of the memory location pointed by stack pointer with the contents of the L register and the contents of the next memory location with the contents of H register.
- This instruction does not alter the contents of the stack pointer.
- No flags are affected.
- It is a one byte instruction.
- Register Indirect addressing mode is used.
Example:
If HL = 5601H, SP = 2000H, (2000H) = 30H and (2001H) = 20H, then
Comments
Post a Comment