Instruction type SPHL in 8085 Microprocessor

Microprocessor8085

In 8085 Instruction set, SPHL is an instruction with the help of which Stack Pointer will get initialized with the contents of register pair HL. It is an indirect way of initializing the stack pointer. But it is not a very common and regularly usable instruction as well. It occupies only 1-Byte in memory, compared to the other instruction LXI SP instruction, which is 3-Bytes long used for initializing SP on the other hand. Due to this advantage, SPHL can be useful when SP is required to get initialized to a specific value a number of times in a program.

Mnemonics, Operand Opcode(in HEX) Bytes
SPHL F9 1

As an example, let us consider, that initial contents of HL and SP register pairs are AABBH and CCDDH. Then after execution of instruction SPHL, HL and SP both will become AABBH. The result of execution of this instruction has been depicted in the following tracing table −

Before After

(HL)

AABBH AABBH

(SP)

CCDDH AABBH

Address Hex Codes Mnemonic Comment
2006 F9 SPHL Initializing SP register with HL register pair content

The timing diagram against this instruction SPHL execution is as follows −

SPHL

Summary − So this instruction SPHL requires 1-Byte, 1-Machine Cycle (Opcode Fetch) and 6 T-States for execution as shown in the timing diagram.

raja
Published on 05-Dec-2018 10:42:10
Advertisements