Instruction type STAX rp in 8085 Microprocessor

Microprocessor8085

In 8085 Instruction set, STAX is a mnemonic that stands for SToreAccumulator contents in memory pointed by eXtended register denoted as “rp”.Hererp stands for register pair. This instruction uses register indirect addressing for specifying the destination. So using this instruction, the current content of Accumulator will be written to the memory location as pointed by 16-bit address as stored in the register pair. It occupies only 1-Byte in memory.

Mnemonics, Operand Opcode(in HEX) Bytes
STAX B 02 1
STAX D 12 1

STAX B is an example instruction of this type. It is a 1-Byte instruction. Let us suppose that the initial content of BC register pair is 4050H and Accumulators initial content is ABH. At memory location 4050H, it is having initial content of CDH. So after execution of the instruction STAX B, the initial content of 4050H i.e. CDH will get updated with the value ABH. Here is the training table for this instruction execution.

Before After
(BC) 4050H 4050H
(A) ABH ABH
(4050h) CDH ABH

Address Hex Codes Mnemonic Comment
2006 02 STAX B Content of the memory location pointer by BC register pair <- A

Another instruction of this type is STAX D. Note that STAX H is not available in 8085 instruction set. This is because, STAX H is the same as MOV M, A in its functionality.

Also note that there are no instructions in 8085 like STBX rp, STCX rp, etc. As Accumulator is the most important 8-bit register, whose contents can be stored in memory in more ways than any other 8-bit register.

Here is the timing diagram of STAX B instruction −

STAX

Summary − So this instruction STAX B requires 1-Byte, 2-Machine Cycles (Opcode Fetch, Memory Write) and 7 T-States for execution as shown in the timing diagram.

raja
Updated on 30-Jul-2019 22:30:23

Advertisements