12112229_mpi_lab_file[1]
12112229_mpi_lab_file[1]
SUBMITED
BY:- RAHUL
ROLL NO-
12112229
CS-
C12
Index
S.no PROGRAM
1. Experiment 1
1.1 Write a program to print the alphabets (A-Z)
1.2 Write a program to print the alphabets (a-z)
1.3 Write a program to print the numbers from 0-9
2. Experiment 2
2.1 Write a program to print ASCII table
2.2 Write a program to print AaBbCc………Zz
2.3 Write a program to print AaaBbbCcc………Zzz
2.4 Write a program to print AbCdEf……….z
3. Experiment 3
3.1 Write a program to print the string using 09h function
3.2 Write a program to print the string character wise
3.3 Repeat the program 1 for 16-bit string
3.4 Repeat the program 2 for 16-bit string
4. Experiment 4
4.1 Write a program to convert the given string into reverse form.
4.2 Repeat the program for 16-bit string
5. Experiment 5
5.1 Write a program to check whether the given string is palindrome or not
5.2 Repeat the program for 16-bit string
6. Experiment 6
6.1 Write a program to sum two 8-bit single digit numbers
6.2 Write a program to sum two 16-bit single digit numbers
6.3 Write a program to sum two 8-bit multi digit numbers
6.4 Write a program to subtract two 8-bit single digit numbers
6.5 Write a program to subtract two 8-bit multi digit numbers
6.6 Write a program to multiply two 8-bit single digit numbers
6.7 Write a program to divide two 8-bit single digit numbers
7. Experiment 7
7.1 Write a program to convert single digit decimal number into hexadecimal
8. Experiment 8
8.1 Write a program to find that 8-bit number is positive or negative
9. Experiment 9
9.1 Write a program to find that 8-bit number is even or odd
10. Experiment 10
10.1 Write a program to find the factorial of a given number
11. Experiment 11
11.1 Write a program to print the Fibonacci series up to 233
Experiment 1
Experiment 2
1. Write a program to print ASCII table
Code:
.code
start:
mov cx,256D
mov dl,0
L:
mov ah,02h
int 21h
inc dl
loop L
end start
mov dl,bh
mov ah,02h
int 21h
mov ah,02h
int 21h
inc bh
loop L
end start
mov dl,bh
mov ah,02h
int 21h
inc bh
inc bh
loop L
end start
Experiment 3
mov ah,09h
int 21h
end start
L:
mov dl,[si]
mov ah,02h
int 21h
inc si
cmp [si],'$'
jnz L
end start
3. Repeat the program 1 for 16-bit string
Code:
.data
a dw "Microprocessor$"
.code
start:
mov ax,@data
mov ds,ax
mov dx,offset a
mov ah,09h
int 21h
end start
Experiment 6
.code
start:
mov ax,data
mov ds,ax
mov dx,offset a
mov ah,09h
int 21h
mov ah,01h
int 21h
mov bl,al
mov dx,offset b
mov ah,09h
int 21h
mov ah,01h
int 21h
add al,bl
mov ah,0
aaa
mov bx,ax
add bx,3030h
mov dx,offset c
mov ah,09h
int 21h
mov dl,bh
mov ah,02h
int 21h
mov dl,bl
mov ah,02h
int 21h
end start
2. Write a program to sum two 16-bit single digit numbers
Code:
.data
a db "Enter the first number:$"
b db "Enter the second number:$"
c db "Sum is:$"
.code
start:
mov ax,data
mov ds,ax
mov dx,offset a
mov ah,09h
int 21h
mov ah,01h
int 21h
mov bl,al
mov dx,offset b
mov ah,09h
int 21h
mov ah,01h
int 21h
add al,bl
mov ah,0
aaa
mov bx,ax
add bx,3030h
mov dx,offset c
mov ah,09h
int 21h
mov dl,bh
mov ah,02h
int 21h
mov dl,bl
mov ah,02h
int 21h
end start
Experiment 7
Experiment 8
.CODE
START:
MOV AX, @DATA
MOV DS, AX
MOV DX, OFFSET MSG1
MOV AH, 09H
INT 21H
MOV AH, 01H
INT 21H
MOV BL, AL
MOV AH, 01H
INT 21H
MOV DX, 0H
MOV BX, 02H
DIV BX
CMP DX, 0H
JNZ LABEL
;PRINT EVEN
MOV DX, OFFSET MSG2
MOV AH, 09H
INT 21H
HLT
LABEL:
;ODD
MOV DX, OFFSET MSG3
MOV AH, 09H
INT 21H
END START
Experiment 10
Experiment 11