Mov data between Registers and memory:
Mov Rd,Rs
Rs= Source Register
Rd=destination register
The instruction transfers the content from source register to destination
register.
1. Ex: Mov B ,C
This instruction is used to transfer the data from C register to B register.
2. Mov D, 8500H
This instruction is used to transfer the data from 8500H memory
location to the B register.
MVI: Move immediate Data Instruction:
This instruction is used to load an immediate 8-bit data into a specified
destination register.
Ex: MVI D, 05
The immediate value 05 loads in to register D.
1. Addition of Two Numbers
MVI A, 05H Load first number (5) into accumulator A
MVI B, 03H Load second number (3) into register B
ADD B Add the contents of register B to A
STA 2100H Store result at memory location 2100H
HLT Stop the program
Explanation:
MVI A, 05H: Load the number 5 into the accumulator A.
MVI B, 03H: Load the number 3 into register B.
ADD B: Add the contents of register B (3) to the accumulator A (5).
STA 2100H: Store the result (8) at memory location 2100H.
HLT: End of the program.
2. Increment The number by 1
MVI A, 05H Load number (5) into accumulator A
INR A Increment A by 1
STA 8500H Store result at memory location 2100H
HLT Stop the program
Explanation:
MVI A, 05H: Load the number 5 into the accumulator.
INR A: Increment the value in the accumulator by 1 (result will be 6).
STA 8500H: Store the result at memory location 2100H.
HLT: End of the program.