0% found this document useful (0 votes)
34 views

Caal Practical File

This document is a practical record for the course Computer Architecture and Assembly Language. It contains details of 12 experiments performed by the student Sagar Sharma. The experiments include programs to perform arithmetic operations like addition, subtraction, and comparison of numbers. Other programs are for binary and BCD arithmetic, string operations, array operations etc. Each experiment lists the aim, software used, instructions used along with explanation, and program with output. The record is signed by the faculty and student with details of their name, designation, institute and course.

Uploaded by

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

Caal Practical File

This document is a practical record for the course Computer Architecture and Assembly Language. It contains details of 12 experiments performed by the student Sagar Sharma. The experiments include programs to perform arithmetic operations like addition, subtraction, and comparison of numbers. Other programs are for binary and BCD arithmetic, string operations, array operations etc. Each experiment lists the aim, software used, instructions used along with explanation, and program with output. The record is signed by the faculty and student with details of their name, designation, institute and course.

Uploaded by

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

Computer Architecture and Assembly Language

CSIT- 131
Practical Record

Name of Faculty: Dr Nidhi Sindhwani Student Name: Sagar Sharma


Designation: Assistant Professor Roll No: A1004821111
Institute: AIIT Course: BCA -B

AMITY INSTITUTE OF INFORMATION TECHNOLOGY


AMITY UNIVERSITY UTTAR PRADESH, NOIDA
Session: Even Semester
Computer Architecture and Assembly Language
PRACTICAL RECORD

PAPER CODE : CSIT-131


Name of the student : Sagar Sharma
University Roll No. : A1004821111
Course : BCA-B
PRACTICAL DETAILS

Exp. Date of Date of


Experiment Name Remarks
No. Performance Checking

1. Write a program to addition, subtract, and compare two 14-02-2022


numbers.

Part(a): Write a program to add two numbers. 14-02-2022

Part(b): Write a program to subtract two numbers. 14-02-2022

Part(c): Write a program to compare two numbers. 14-02-2022

2. Write a program to find the sum of two BCD numbers 14-02-2022


stored in memory.

3. Write a program to perform binary arithmetic 21-02-2022


operations on two 32-bit numbers.
Part(a): Write a program to add two 32-bit numbers. 21-02-2022
Part(b): Write a program to subtract two 32-bit 21-02-2022
numbers.
Part(c): Write a program to multiply two numbers. 21-02-2022
Part(d): Write a program to perform division 28-02-2022
4. Write a program to add ten numbers and find their 28-02-2022
average.
5. Write a program to display a string message. 07-03-2022
6. Write a program to input a string and a character from 07-03-2022
user and display it on the center of the screen.
7. Write a program to reverse a string. 14-03-2022

8. Write an assembly language program to find whether 14-03-2022


two strings, stored in memory, match or not.
9. Write an assembly language program to find the first 21-03-2022
and last character of string.
10. Write a program to convert upper case string to lower 04-04-2022
case.
11. Write a program to find maximum and minimum in an 11-04-2022
array.
12. Write a program to arrange numbers in ascending and 11-04-2022
descending order.

Date:14/02/2022

Experiment:1
AIM: Write a program to addition, subtract, and compare two numbers.
Part(a)
AIM: Write a program to add two numbers.
Software Used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
1234 is loaded into AX register and 5678 is loaded into BX register.
ADD: This instruction is used to add the data of two registers and stores the output in the
destination register. For Example- Here, output of AX+BX will get stored in AX.
HLT: This instruction is used to halt or to end the program.
Program:
Opcode Operand
MOV AX, 1234H
MOV BX, 5678H
ADD AX, BX
HLT

Result:
Part(b)
AIM: Write a program to Subtract two numbers.
Software Used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
5678 is loaded into AX register and 1234 is loaded into BX register.
SUB: This instruction is used to subtract the data of two registers and stores the output in the
destination register. For Example- Here, output of AX-BX will get stored in AX.
HLT: This instruction is used to halt or to end the program.
Program:
Opcode Operand
MOV AX, 5678H
MOV BX, 1234H
SUB AX, BX
HLT

Result:
Part(C)
AIM: Write a program to compare two numbers.
Software Used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
1234 is loaded into AX register and 1221 is loaded into BX register.
CMP: This instruction is used to compare the data of two registers. For example- Here,
1234 is compared to 1221.
HLT: This instruction is used to halt or to end the program.

Program 1: AX>BX
Opcode Operand
MOV AX, 1234H
MOV BX, 1221H
CMP AX, BX
HLT

Result:

Program 2: AX=BX
Opcode Operand
MOV AX, 1234H
MOV BX, 1234H
CMP AX, BX
HLT
Result:

Program 3: AX<BX
Opcode Operand
MOV AX, 1221H
MOV BX, 1234H
CMP AX, BX
HLT
Result:

Date:14/02/2022
Experiment:2
AIM: Write a program to find the sum of two BCD numbers stored in memory.
Software used: Emu 8086
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
09 is loaded into AX register and 05 is loaded into BX register.
ADD: This instruction is used to add the data of two registers and stores the output in the
destination register. For Example- Here, output of AX+BX will get stored in AX.
DAA: It stands for Decimal adjust after addition. This instruction is used to adjust the carry
of the addition to get the right number in the result.
HLT: This instruction is used to halt or end the program.
Program:
Opcode Operand
MOV AX, 09H
MOV BX, 05H
ADD AX, BX
DAA
HLT
Result:

Date:21/02/2022
Experiment:3
Part(a)
AIM: Write a program to add two 32-bit numbers.
Software used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
1234 is loaded into AX register, 5678 is loaded into BX register, 3412 is loaded into CX
register and 7856 is loaded into DX register.
ADD: This instruction is used to add the data of two registers and stores the output in the
destination register. For Example- Here, output of AX+CX will get stored in AX and
output of BX+DX will get stored in BX.
ADC: It stands for Addition with carry. This instruction is used add the numbers along with
their previous carry.
Program:
Opcode Operand
MOV AX, 1234H
MOV BX, 5678H
MOV CX, 3412H
MOV DX, 7856H
ADD AX, CX
ADC BX, DX
Result:

Part(b)
AIM: Write a program to subtract two 32-bit numbers.
Software used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
3412 is loaded into AX register, 5678 is loaded into BX register, 1201 is loaded into CX
register and 2324 is loaded into DX register.
SUB: This instruction is used to sub the data of two registers and stores the output in the
destination register. For Example- Here, output of AX-CX will get stored in AX and
output of BX-DX will get stored in BX.
SBB: It stands for Subtraction with borrow. This instruction is used subtract the numbers also
considering the borrow taken from the next number.
HLT: This instruction is used to halt or to end the program.
Program:
Opcode Operand
MOV AX, 3412H
MOV BX, 5678H
MOV CX, 1201H
MOV DX, 2324H
SUB AX, CX
SBB BX, DX
HLT
Result:

Part(C)
AIM: Write a program to multiply two 32-bit numbers.
Software used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
08 is loaded into AL register and 02 is loaded into BL register.
MUL: This instruction is used to multiply the data of two registers and stores the output in
the destination register. For Example- Here, output of AL*BL will get stored in AX.
HLT: This instruction is used to halt or to end the program.
Program:
Opcode Operand
MOV AL, 08H
MOV BL, 02H
MUL AL, BL
HLT
Result:

Date:28/02/2022
Part(D)
AIM: Write a program to divide two 32-bit numbers.
Software used: Emu 8086.
Name of the Instruction used and their explanation in brief:
MOV: This instruction is used is used to load the data into the registers. For Example-Here,
4000 is loaded into AX register and 2000 is loaded into BX register.
DIV: This instruction is used to divide the data of two registers and stores the output in the
destination register. For Example- Here, output of AX/BX will get stored in AL.
HLT: This instruction is used to halt or to end the program.
Program:
Opcode Operand
MOV AX, 4000H
MOV BX, 2000H
DIV AX, BX
HLT
Result:

Date:28/02/2022

Experiment:4
AIM: Write a program to add ten numbers and find their average.
Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used is used to load the data into the registers. For Example-Here,
03 is loaded into AL register and 10 is loaded into BL register.
ADD: This instruction is used to add the data of two registers and stores the output in the
destination register. For Example- Here, data of AL will keep on adding until the new
command gets enter and output of the addition will get stored in AL register only.
DIV: This instruction is used to divide the data of two registers and stores the output in the
source register. For Example- Here, AL will get divided by BL and will get stored in BL
register only.
HLT: This instruction is used to halt or to end the program.

Program:
Opcode Operand
MOV AL, 03H
ADD AL, 03H
ADD AL, 04H
ADD AL, 04H
ADD AL, 04H
ADD AL, 04H
ADD AL, 04H
ADD AL, 04H
ADD AL, 01H
ADD AL, 01H
MOV BL, 10H
DIV BL
HLT

Result:
Date:07/03/2022
Experiment:5

AIM: Write a program to display string in message.


Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
Str db: This instruction is used to declare a string in the program.
@data: This instruction is used to initialize the data segment.
09H: This instruction is used to display the string output.

Program and result:

Date:07/03/2022
Experiment:6

AIM: Write a program to display string in message at the centre of the screen.
Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
Str db: This instruction is used to declare a string in the program.
@data: This instruction is used to initialize the data segment.
09H: This instruction is used to display the string output.
02H: This instruction is used to display a character.

Program and result:

Date:14/03/2022
Experiment:7

AIM: Write a program to reverse a string.


Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
Str db: This instruction is used to declare a string in the program.
@data: This instruction is used to initialize the data segment.
LOOP: Used to loop a ground of instructions until the condition satisfies.
INC: Used to increment the provided byte/word by 1.
INT: Used to interrupt the program during execution and calling service specified.
POP: Used to decrement the SP register and copies a value from the top of the stack.
PUSH: Used to retrieve the value from the top of the stack and stores it into the destination,
then increments the SP register.

Program and result:

Date:14/03/2022
Experiment:8

AIM: Write an assembly language program to find whether two strings stored in memory
match or not.
Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
Str db: This instruction is used to declare a string in the program.
@data: This instruction is used to initialize the data segment.
CLD: Clears the declaration flag.
INT: Used to interrupt the program during execution and calling service specified.
LEA: Used to load the address of operand into the provided register.
REPE: Repeat if equal.
CMPSB: Used to compare a byte in one string with a byte in another string.
JMP: Used to jump to the provided address to proceed to the next instruction.
JZ: Jump if zero.
Program and result:

Date:21/03/2022
Experiment:9

AIM: Write an assembly language program to find the first and last character of the string.
Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
Str db: This instruction is used to declare a string in the program.
@data: This instruction is used to initialize the data segment.
LENSTR: Length of string.
INT: Used to interrupt the program during execution and calling service.
LEA: Used to load the address of operand into the provided register.

Program and result:

Date:04/04/2022
Experiment:10

AIM: Write an assembly language program to convert upper case string to lower case.
Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
ADD: Used to add the provided byte to byte/word to word.
INC: Used to increment the provided byte/word by 1.
INT: Used to interrupt the program during execution and calling service specified.
LOOP: Used to loop a group of instruction until the conditions satisfies.

Program and result:

PROGRAM TO CONVERT UPPER CASE STRING TO LOWER CASE STRING:


Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
SUB: Used to subtract the byte from byte/word from word.
INC: Used to increment the provided byte/word by 1.
INT: Used to interrupt the program during execution and calling service specified.
LOOP: Used to loop a group of instruction until the conditions satisfies.

Program and result:

Date:11/04/2022
Experiment:11

AIM: Write a program to find maximum in an array.


Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
XOR: Used to perform XOR operation over each bit in a byte/word with the corresponding
bit in another byte/word.
CMP: It is used to compare two operands. It is generally used in conditional execution. It
basically subtracts one operand from the other for comparing.
JNB: Used to jump if above/not below instruction satisfies.
LOOP: Used to loop a group of instructions until the condition satisfies.
HLT: This instruction is used to halt or to end the program.

Program and result:

PROGRAM TO FIND MINIMUM IN AN ARRAY:


Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
XOR: Used to perform XOR operation over each bit in a byte/word with the corresponding
bit in another byte/word.
CMP: It is used to compare two operands. It is generally used in conditional execution. It
basically subtracts one operand from the other for comparing.
JB: Used to jump if below/equal/not above instruction satisfies.
LOOP: Used to loop a group of instructions until the condition satisfies.
HLT: This instruction is used to halt or to end the program.

Program and result:

Date:11/04/2022
Experiment:12

AIM: Write a program to arrange numbers in ascending order.


Software used: Emu 8086

Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
CMP: It is used to compare two operands. It is generally used in conditional execution. It
basically subtracts one operand from the other for comparing.
JC: Used to jump if carry flag CF=1.
JZ: Used to jump if equal/zero flag ZF=1.
DEC: Used to decrement the provided byte/word by 1.
JNZ: Used to jump if not equal/zero flag ZF=1.
HLT: This instruction is used to halt or to end the program.

Program and result:

PROGRAM TO ARRANGE NUMBERS IN DESCENDING ORDER:


Name of the Instruction used and their explanation in brief:

MOV: This instruction is used to load the data into the register.
CMP: It is used to compare two operands. It is generally used in conditional execution. It
basically subtracts one operand from the other for comparing.
JNC: Used to jump if no carry flag CF=0.
JZ: Used to jump if equal/zero flag ZF=1.
DEC: Used to decrement the provided byte/word by 1.
JNZ: Used to jump if not equal/zero flag ZF=1.
HLT: This instruction is used to halt or to end the program.

Program and result:

PROGRAM TO FIND SUBSTRING FROM A GIVEN STRING


Name of the Instruction used and their explanation in brief:
LEA: Used to load the address of operand into the provided register

INT: This instruction is used to interrupt the program during execution and calling service

Specified.

MOV: This instruction is used to load the data from source register into destination register.

CMP: Used to compare 2 provided byte/word.

JE: Used to jump if equal flag, ZF = 1

INC: This instruction is used to increment the provided byte/word by 1.

JMP: Used to jump to the provided address to proceed to the next instruction.

LOOP: This instruction is used to loop a group of instructions until the condition satisfies.

JNE: Used to jump if not equal flag ZF = 0.

ADD: Used to add the provided byte to byte/word to word.

END: This instruction is used to end the program.

Program and Result

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy