0% found this document useful (0 votes)
3 views2 pages

CA-sample Program

The document explains how to move data between registers and memory using the MOV and MVI instructions in assembly language. It provides examples of transferring data between registers, loading immediate values, and performing basic arithmetic operations like addition and incrementing a number. Additionally, it details the steps for storing results in specific memory locations and ending the program.

Uploaded by

sivareddyk72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

CA-sample Program

The document explains how to move data between registers and memory using the MOV and MVI instructions in assembly language. It provides examples of transferring data between registers, loading immediate values, and performing basic arithmetic operations like addition and incrementing a number. Additionally, it details the steps for storing results in specific memory locations and ending the program.

Uploaded by

sivareddyk72
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

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.

You might also like