Caal Practical File
Caal Practical File
CSIT- 131
Practical Record
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
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
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.
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
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.
Date:14/03/2022
Experiment:7
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.
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
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
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.
Date:04/04/2022
Experiment:10
AIM: Write an assembly language program to convert upper case string to lower case.
Software used: Emu 8086
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.
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.
Date:11/04/2022
Experiment:11
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.
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.
Date:11/04/2022
Experiment:12
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.
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.
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.
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.