I get the point of MOV
, STA
and LDA
instructions, but what I don't understand is why are there three different instructions for two different processes?
STA
is for copying data from accumulator to memory location,LDA
is for copying data from memory location to accumulator andMOV
is for copying data between registers plus registers and memory.So, what I can do with STA
and LDA
instructions can be done with MOV
instruction too, right?
STA is for copying data from accumulator to memory location, LDA is for copying data from memory location to accumulator and. MOV is for copying data between registers plus registers and memory.
In 8085 Instruction set, STA is a mnemonic that stands for STore Accumulator contents in memory. In this instruction,Accumulator8-bit content will be stored to a memory location whose 16-bit address is indicated in the instruction as a16. This instruction uses absolute addressing for specifying the destination.
"LDA" is the mnemonic for the opcode (load accumulator A) and "21" is the operand (an address given in base 10). The manner of specification of the target address is called the addressing mode of the machine language instruction. A program for translating assembly language programs is called an. assembler.
The instructions LDA
and STA
move data between memory and A
. The instruction MOV
either moves data between registers, or between a register and a memory location specified by HL
.
LDA
and STA
are used when the address can be resolved at assembly/link time.
MOV
is used when the memory address is computed at run time, and is placed in HL
. For example, when you are iterating through an array.
You have discovered direct and indirect memory addressing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With