Professional Documents
Culture Documents
List of Experiments
List of Experiments
List Of Experiments
CYCLE-1:
1.
2.
3.
4.
5. Arithmetic Operation:
a. Multiword addition
b. Multiword Subtraction
c. Multiplication of two 16-bit numbers
d. 32bit/16 division
6. Signed operation:
a. Multiplication
b. Division
7. ASCII Arithmetic:
a. AAA
b. AAS
c. AAM
d. AAD
e. DAA
f. DAS
8. Logic Operations:
a. Shift right
b. Shift left
c. Rotate Right without carry
d. Rotate left without carry
e. Rotate Right with carry
f. Rotate left with carry
g. Packed to unpacked
h. Unpacked to packed
i. BCD to ASCII
j. ASCII to BCD
9. String Operation:
a. String Comparison
b. Moving the block of string from one segment to another segment.
c. Sorting of string in ascending order
d. Sorting of string in descending order
e. Length of string
f. Reverse of string
1. Arithmetic Operations
a) Multi Word addition
ASM code:
. Model small
. Stack
. Data
. Code
Mov AX, 0000h
Mov BX, 0000h
ADD AX, BX
Mov AX, 5678h
Mov BX, 1234h
ADC AX, BX
Mov DX, AX
INT 21h
END
INPUT 1: 56780000h
INPUT 2: 12340000h
OUTPUT: 68AD0000h
CX: 0000
DX: 68AD
RESULT:
Thus the program for addition of two double words has been executed successfully by
using TASM & result is verified.
3. Signed Operation
a. Multiplication of two signed numbers
ASM code:
. Model small
. Stack
. Data
. Code
Mov AX, 8000h
Mov BX, 2000h
IMUL BX
INT 21H
END
INPUT 1:8000h
INPUT 2: 2000h
OUTPUT:
AX 0000h
DX F000h
RESULT:
Thus the program for multiplication of two signed numbers has been executed
successfully by using TASM & result is verified.
b) AAS
ASM code:
. Model small
. Stack
. Data
. Code
Mov AL, 37h
Mov BL, 35h
SUB AL, BL
AAS
Int 21h
End
INPUT 1: 37h
INPUT 2: 35h
OUTPUT:
AX0002h
RESULT:
Thus the program for AAS has been executed successfully by using TASM &
result is verified.
c) AAM
ASM code:
. Model small
. Stack
. Data
. Code
Mov AL, 06h
Mov BL, 09h
MUL BL
AAM
Int 21h
End
INPUT 1: 09h
INPUT 2: 06h
OUTPUT:
AX0504h(un packed BCD)
RESULT:
Thus the program for AAM has been executed successfully by using TASM &
result is verified.
d) AAD
ASM code:
. Model small
. Stack
. Data
. Code
Mov AX, 1264h
Mov BL, 04h
DIV BL
AAD
Int 21h
End
INPUT 1: 1264h
INPUT 2: 04h
OUTPUT:
AX0499
RESULT:
Thus the program for AAD has been executed successfully by using TASM &
result is verified.
e) DAA
ASM code:
. Model small
. Stack
. Data
. Code
Mov AL, 59h
Mov BL, 0935h
ADD AL, BL
DAA
Int 21h
End
INPUT 1: 59h
INPUT 2: 35h
OUTPUT:
AX0094h
RESULT:
Thus the program for DAA has been executed successfully by using TASM &
result is verified.
f) DAS
ASM code:
. Model small
. Stack
. Data
. Code
Mov AL, 75h
Mov BL, 46h
SUBAL, BL
DAS
Int 21h
End
INPUT 1: 75h
INPUT 2: 46h
OUTPUT:
AL29h
RESULT:
Thus the program for DAS has been executed successfully by using TASM &
result is verified.
Logic Operation
Shift Right
ASM code:
. Model small
. Stack
. Data
. Code
Mov al, 46h
Mov cl, 04h
Shr al, cl
Int 21h
End
Input:
Al46
Cl04
Output:
04h
RESULT:
Thus the program for Shift right operation has been executed successfully by
using TASM & result is verified.
Shift Left
ASM code:
. Model small
. Stack
. Data
. Code
Mov al, 46h
Mov cl, 04h
Shl al, cl
Int 21h
End
Input:
Al46
Cl04
Output:
60h
RESULT:
Thus the program for Shift left operation has been executed successfully by
using TASM & result is verified.
ASCII to BCD
ASM Code:
. Model small
. Stack
. Data
. Code
Mov ax, 3638h
Mov bx, 3030h
Mov cl, 04h
Shl al, cl
Ror ax, cl
INT 21H
END
Input:
AX3638h(Unpacked BCD)
Output:
AX0068(packed BCD)
RESULT:
Thus the program for conversion of ASCII to BCD value has been executed
successfully by using TASM & result is verified.
BCD to ASCII
ASM Code:
. Model small
. Stack
. Data
. Code
Mov AL, 57h
Mov CL, 04h
SHL AL, CL
ROR AL. 04H
XOR AL, 30H
MOV BL, AL
MOV AL, 57H
MOV CL, 04H
SHR AL, CL
XOR AL, 30H
MOV BH. AL
INT 21H
END
Input:
AL (BCD)
Output:
BX (ASCII)
RESULT:
Thus the program for conversion of BCD TO ASCII value has been executed
successfully by using TASM & result is
STRING OPERATIONS
Strings Comparison:
ASM CODE:
. Model small
. Stack
. Data
Strg1 db lab,$
Strg 2 db lab, $
Res db strg are equal,$
Res db strg are not equal,$
Count equ 03h
. Code
Mov ax, @data
Mov ds, ax
Mov es, ax
Lea si, strg1
Lea di, strg2
Cld
Rep cmpsb
Jnz loop1
Mov ah, 09h
Lea dx, res
Int 21h
Jmp a1
Loop1: mov ah, 09h
Lea dx, re1
Int 21h
A1: mov ah, 4ch
Int 21h
End
Input:
Strg1
Strg2
Output:
Result:
Thus the program of string comparison is executed successfully and the result is
verified.
BIOS FUNCTION
(a) Set video mode:
ASM CODE:
. Model small
. Stack
. Data
. Code
Mov ah, 00h
Mov al, 01h
Int 10h
End
Input:
Ah00h; Set video mode
Al01h; mode has been set for 25*40
Output:
The output screen has been changed for 25*40
Result:
Thus the program to set video mode is executed successfully by TASM &
result is verified.
ASM Code:
. Model Small
. Stack
. Data
. Code
Mov ah, 01h
Int 21h
End
Input:
Ah01h
Output:
The character a is display along with ASCII value AX=0061.
Result:
Thus the program for keyboard input with echo using TASM software is executed
successfully.
2) Display a String:
Program:
. Model Small
. Stack
. Data
Stg db display a string,$
. Code
Mov ax, @data
Mov ds, ax
Mov ah, 09h
Lea dx, stg
Int 21h
End
Input:
Display a string is given as input.
Output:
Display a string is obtained as output.
Result:
Thus the program to display a string was successfully executed and output is verified.
3) Input a character:
Program:
. Model small
. Stack
. Data
. Code
Mov ah, 01h
Int 21h
End
Input:
Ah01h
A is entered as input.
Output:
The character a is displayed along with ASCII value i.e. AX=0161
Result:
Thus the program to input a character was executed successfully and the result is
verified
Modular Program
1) Fibonacci series:
Aim: Write a program to generate fibonnaci series.
Apparatus: System with TASM software.
Program:
. Model small
. Stack
. Data
. Code
Mov ax, @data
Mov ds, ax
Mov cl, 05h
Mov al, 00h
Mov bl, 01h
Mov si, 0000h
Mov [si], al
Inc si
Mov [si], bl
Up: add al, bl
Inc si
Mov [si], al
Xchg al, bl
Loop up
Int 21h
End
Input:
Cl 05h
Output:
Result:
Thus the program to find the fibonacci series is executed successfully using
TASM software and output is verified.
Mov [bx], ax
Lea bx, stg3+2
Xor ax, ax
Mov al, Min
Call num
Mov al, [`bx], ax
Lea bx, stg4+2
Xor ax, ax
Mov al, Sec
Call num
Mov [bx], ax
Mov ah, 00
Mov al, 03
Mov ah, 02
Mov BH, 00
Mov DH, 05
Mov dl, 32
Lea dx, stg1
Mov ah, 09h
Int 21h]
Jmp begin
Main endp
Num proc
Mov ah, 00
Mov dl, 10
Div dl
Or ax, 3030h
Ret
Num endp
End
Result:
Thus the display the time output is display.
Cycle-2
8279- keyboard display: