# ASM program

## ASM program to find sum of cubes of given ‘n’ numbers

Aim: – To write an assembly language program to find sum of cubes of given ‘n’ numbers. 1 2 3 4 5 6 7 8 9 MOV CL, NUM MOV SUM, 00 L1: MOV AL, CL MUL AL MUL CL ADD AL, SUM MOV SUM, AL LOOP L1 END Result: Sum of cubes of first […]

## ASM program to find the sum of squares of given ‘n’ numbers

Aim: – To write an assembly language program to find sum of squares of given ‘n’ numbers. 1 2 3 4 5 6 7 8 MOV CL, NUM MOV SUM, 00 L1: MOV AL, CL MUL AL ADD AL, SUM MOV SUM, AL LOOP L1 END Result: Sum of squares of first ‘n’ natural numbers […]

1 Comment

## ASM program to perform addition of two BCD numbers

Aim: – To write an assembly language program for addition of two BCD numbers. 1 2 3 4 5 6 7 8 MOV AL, A ADD AL, B DAA MOV R, AL MOV AL, 00 ADC AL , 00 MOV R+1, AL END Result: Addition of two BCD numbers is obtained.

## ASM program to divide 32-bit number by a 16-bit number

Aim: – To write an assembly language program for division of 32-bit number by a 16-bit number. 1 2 3 4 5 6 MOV AX, DIVIDEND MOV DX, DIVISOR+2 DIV DIVISOR MOV QUO, AX MOV REM, DX END Result: Division of 32-bit with-bit number is obtained.

## ASM program to divide16-bit number by an 8-bit number

Aim: – To write an assembly language program for division of 16-bit number by an 8-bit number. 1 2 3 4 5 6 MOV AX, DIVIDEND MOV CL, DIVISOR DIV CL MOV QUOTIENT, AL MOV REMAINDER, AH END Result: Division of 16-bit with 8-bit number is obtained.

## ASM program to multiply two 16-bit numbers

Aim: – To write an assembly language program for multiplication of two 16-bit numbers. 1 2 3 4 5 MOV AX, MULTIPLICAND MUL MULTIPLIER MOV PRODUCT, AX MOV PRODUCT+2, DX END Result: Multiplication of two 16-bit numbers is obtained.

1 Comment

## Subtraction of two 16-bit numbers

Aim: – To write an assembly language program for subtraction of two 16-bit numbers. 1 2 3 4 5 6 7 MOV AX, FIRST SUB AX, SECOND MOV DIFF, AX MOV AX, 00 ADC AX, 00 MOV DIFF+2, AX END Result: Subtraction of two 16-bit numbers is obtained.