This document provides an assembly language program (ALP) to perform basic arithmetic operations on a microcontroller. The ALP demonstrates how to add, subtract, multiply, and divide numbers by moving data into accumulators and registers and performing the arithmetic operations. It stores the results of the addition, subtraction, multiplication, and division calculations in different registers on the microcontroller. The program provides an example of programming a microcontroller to perform essential numeric calculations.
This document provides an assembly language program (ALP) to perform basic arithmetic operations on a microcontroller. The ALP demonstrates how to add, subtract, multiply, and divide numbers by moving data into accumulators and registers and performing the arithmetic operations. It stores the results of the addition, subtraction, multiplication, and division calculations in different registers on the microcontroller. The program provides an example of programming a microcontroller to perform essential numeric calculations.
This document provides an assembly language program (ALP) to perform basic arithmetic operations on a microcontroller. The ALP demonstrates how to add, subtract, multiply, and divide numbers by moving data into accumulators and registers and performing the arithmetic operations. It stores the results of the addition, subtraction, multiplication, and division calculations in different registers on the microcontroller. The program provides an example of programming a microcontroller to perform essential numeric calculations.
perform arithmetic operation: Addition, Substraction, Multiplication etc . ORG 0000H MOV A,#02H ;Move the data 02h in accumulator ADD A, #03H ;Add the contents of accumulator with 03h MOV RO, A ;Store the result in RO register CLR A ;Clear the contents of accumulator CLR C;Clear the carry flag MOV A, #03H ;Move the data 03h in accumulator MOV B, #04H ;Move the data 04h in accumulator MUL AB ;Multiply the contents of A and B MOV R2, A ;Store the result (LSB) in R2 MOV A, # 95H ;Move the data 95h in accumulator Page no -5b.2 MOV B, #10H ;Move the data 10h in accumulator DIV AB ;Divide the contents of A and B MOV R4, A;Store the quotient in R4 register MOV R5, B ;Store the Remainder in R5 register MOV A, #05H ;Move the data 05h in accumulator SUBB A, #02H;Subtract the contents of accumulator and 02h MOV R1, A;Store the result in R1 register CLR A ;Clear the contents of accumulator MOV R3, B ;Store the result (MSB) in R3 CLR A;Clear the contents of accumulator END;Stop