In: Electrical Engineering
LDR, POP, STR, PUSH, MOV
What is the difference between them?
1. LDR (Load directly to Register) - This instruction is used to load (copy) content of a memory location into a register. In doing so contents of the memory location are not altered. For Example in 8085 we use LDA 2200H, this instruction will load (copy) the content of location 2200H into Accumulator Register.
2. POP - This instruction is used to pop out the 16 bit data that is present on the top of stack or location pointed by Stack Pointer. After execution Stack Pointer is incremented by 2. For Example POP H will pop off the stack to HL register pair.
[L] <- [SP] { "<-" denotes Arrow }
[H} <- [SP]+1
[S] <- [SP]+2
3. STR - Store (copy) the content of register to a memory location. For example STA 2200H will copy the content of Accumulator Register in memory location 2200H.
4. PUSH - This instruction is used to push 16 bit data on the top of stack or location pointed by Stack Pointer. After execution Stack Pointer is decremented by 2. For example PUSH H will push the content of HL pair on Stack.
[SP]-1 <- [L]
[SP]-2 <- [H]
[SP] <- [SP]-2
5. MOV - There are three types of MOV first one is responsible for register to register data transfer, second one for memory location to register data transfer and the third one for register to memory location. In all these three content of the original location remains unaltered.
The memory location is the location pointed by HL pair.
MOV Rd,Rs - This instruction will copy the content of source register to destination register.
MOV Rd,M - This instruction will copy the content of memory location pointed by HL pair to destination register.
MOV M,Rs - This instruction will copy the content of source register to memory location pointed by HL pair.