Assignment Help, Cloud Based ERP System, Microsoft NAV Certification
WELCOME !!

Please Register, ask for assignment solutions & post the solutions if you know any.

LETS START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.

Assignment Help, Cloud Based ERP System, Microsoft NAV Certification

Stock Market, Online Tutoring, Cloud Based ERP System, Microsoft Dynamics Reporting, Microsoft Nav Certification


You are not connected. Please login or register

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Assesment question for 8086 on 21st March 2009, 5:16 pm

tihor

avatar
Administrator
Q> Write an assembly language program to read string, count no.
uppercase character,lowercase character, digits and other character
present in the string in a clear screen

Entered string-We pay 13% VAT.
Uppercase character-4
Lowercase character-10
Digits-2
Others-7



title dispaly
.model small
.stack 64h
.data
maxchar db 50h
actchar db ?
arr db 50h dup (?)
count db 4h dup (0)
temp db 3h dup (?)

request db 'enter a string',0ah,0dh,'$'
enter db 'entered string-','$'
upper db 0ah,0dh,'Upper Characters-','$'
lower db 0ah,0dh,'Lower characters-','$'
digits db 0ah,0dh,'Digits-','$'
others db 0ah,0dh,'Others-','$'
.code

display proc

mov si,00h
mov dh,0ah
mov ah,00h
mov al,count[di]
Rediv:div dh
add ah,30h
mov temp[si],ah
inc si
mov ah,00h
cmp al,00h
jne Rediv

mov ah,02h
Nxt:dec si
mov dl,temp[si]
INT 21H
cmp si,00h
jne Nxt

ret
display endp


main proc
mov ax,@data
mov ds,ax

mov ah,09h
lea dx,request
int 21h

mov ah,0ah
lea dx,maxchar
int 21h

mov ch,00h
mov cl,actchar
mov di,00

start:cmp arr[di],'a'
jb upp
cmp arr[di],'z'
jbe sma
inc count[3]
jmp skip
sma: inc count[1]
jmp skip

upp: cmp arr[di],'A'
jb dig
cmp arr[di],'Z'
jbe upp1
inc count[3]
jmp skip
upp1: inc count[0]
jmp skip

dig: cmp arr[di],'0'
jb oth
cmp arr[di],'9'
jbe dig1
oth: inc count[3]
jmp skip
dig1: inc count[2]

skip: inc di
loop start
mov arr[di],'$'

mov ax,0600h
mov bh,07h
mov cx,0000h
mov dx,184Fh
int 10h

mov ah,02h
mov bh,00h
mov dx,00h
int 10h


mov ah,09h
lea dx,enter
int 21h
lea dx,arr
int 21h

lea dx,upper
int 21h
mov di,00
call display

mov ah,09h
lea dx,lower
int 21h
mov di,01
call display

mov ah,09h
lea dx,digits
int 21h
mov di,02
call display

mov ah,09h
lea dx,others
int 21h
mov di,03
call display

mov ax,4c00h
int 21h
main endp
end main

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum