1. Write Assembly Language Program to add two numbers (8 bit and 16 bit).
2. Write Assembly Language Program to subtract two numbers (8 bit and 16 bit).
3. Write Assembly Language Program to multiply two numbers (8 bit and 16 bit).
4. Write Assembly Language Program to divide two numbers (8 bit and 16 bit).
5. Write Assembly Language Program to find out sum of five 16 bit numbers.
6. Write Assembly Language Program to add two BCD numbers.
7. Write Assembly Language Program to subtract two BCD numbers.
8. Write Assembly Language Program to multiply two BCD numbers.
9. Write Assembly Language Program to find out smallest number from five numbers.
10. Write Assembly Language Program to find out largest number from five numbers.
11. Write Assembly Language Program to arrange numbers of given array in ascending order.
12. Write Assembly Language Program to arrange numbers of given array in descending order.
13. Write Assembly Language Program to perform block transfer of data
14. Write Assembly Language Program to find out the length of string.
15. Write Assembly Language Program to compare the two strings.
16. Write Assembly Language Program to display string in reverse order.
17. Write Assembly Language Program to convert Decimal to Hexadecimal number.
(Note: program number 1 to 13 and 18 refer from manual.)
Program to Find out Length of String.
.model small
.stack
.data
m1 db 10,13,"enter first string:$"
m2 db 10,13,"enter second string:$"
m3 db 10,13,"equal$"
m4 db 10,13,"not equal$"
b1 db 10 dup(?)
b2 db 10 dup(?)
.code
accept macro
mov ah,01h
int 21h
endm
put macro
mov ah,02h
int 21h
endm
disp macro xx
mov ah,09h
lea dx,xx
int 21h
endm
.startup
disp m1
mov cl,00h
mov ch,00h
lea si,b1
up:accept
.if al==0Dh
jmp last
.else
mov [si],al
inc si
inc cl
jmp up
.endif
last:
disp m2
lea di,b2
up1:accept
.if al==0Dh
jmp last1
.else
mov [di],al
inc di
inc ch
jmp up1
.endif
last1:
cmp cl,ch
jne uneq
mov ch,00h
up2:
lea si,b1
lea di,b2
mov al,[si]
cmp al,[di]
jnz uneq
loop up2
disp m3
.exit
uneq:disp m4
.exit
End
Program to find out reverse of String
.model small
.stack
.data
m1 db 10,13,"enter first string:$"
m2 db 10,13,"reverse string::$"
b1 db 10 dup(?)
b2 db 10 dup(?)
.code
accept macro
mov ah,01h
int 21h
endm
put macro
mov ah,02h
int 21h
endm
disp macro xx
mov ah,09h
lea dx,xx
int 21h
endm
.startup
disp m1
mov bl,00h
lea si,b1
up:accept
.if al==0Dh
jmp last
.else
mov [si],al
inc si
inc bl
jmp up
.endif
last:
mov cl,bl
dec si
lea di,b2
up1:
mov al,[si]
mov [di],al
inc di
dec si
loop up1
disp m2
mov cl,bl
lea di,b2
up2:
mov dl,[di]
put
inc di
loop up2
.exit
end
Program to find out length of string
.model small
.stack
.data
m1 db 10,13,"enter first string:$"
m2 db 10,13,"length of string::$"
b1 db 10 dup(?)
b2 db 10 dup(?)
.code
accept macro
mov ah,01h
int 21h
endm
put macro
mov ah,02h
int 21h
endm
disp macro xx
mov ah,09h
lea dx,xx
int 21h
endm
.startup
disp m1
mov bl,00h
lea si,b1
up:accept
.if al==0Dh
jmp last
.else
mov [si],al
inc si
inc bl
jmp up
.endif
last:
disp m2
.if bl>=00h && bl<=09h
add bl,30h
.else
add bl,37h
.endif
mov dl,bl
put
.exit
end