Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

8085 assembly instructions MOV, LDA and STA

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 and
  • MOV 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?

like image 467
Lu Ka Avatar asked Nov 24 '16 20:11

Lu Ka


People also ask

What is LDA and STA instruction?

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.

What is STA instruction?

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.

What does LDA mean in assembly?

"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.


1 Answers

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.

like image 153
Weather Vane Avatar answered Sep 21 '22 14:09

Weather Vane