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 8086 assessment solution on 23rd March 2009, 12:06 pm

Formatted

avatar
Administrator
Write an assembly language program for 8086 to
read a string, count the number of lowercase characters, uppercase
characters, digits and other characters present in the string and
display in the following format in a clear screen-

Entered String- We have to pay 13% VAT.
Uppercase Characters- 4
Lowercase Characters- 10
Digits- 2
Others- 7

Code:

.MODEL SMALL
.STACK 100H
.DATA
    MAX DB 99
    USR DB ?
    INPUT DB 99 DUP('$'),'$'
    PROMPT1 DB 'ENTER A STRING',13,10,'$'
    PROMPT2 DB 13,10,'ENTERED STRING-','$'
    PROMPT3 DB 13,10,'UPPERCASE CHARACTERS-','$'
    PROMPT4 DB 13,10,'LOWERCASE CHARACTERS-','$'
    PROMPT5 DB 13,10,'DIGITS-','$'
    PROMPT6 DB 13,10,'OTHERS-','$'
    TEMP DB 2 DUP(?)
    UPPER DB 0,0,'$'
    LOWER DB 0,0,'$'
    DIGIT DB 0,0,'$'
    OTHER DB 0,0,'$'
.CODE
    MAIN PROC FAR
        MOV AX,@DATA
        MOV DS,AX
        LEA DX,PROMPT1
        CALL DISPLAY
        LEA DX,MAX
        CALL STRINGINPUT
        CALL COUNT
        LEA SI,UPPER
        CALL CONVERT
        LEA SI,LOWER
        CALL CONVERT
        LEA SI,DIGIT
        CALL CONVERT
        LEA SI,OTHER
        CALL CONVERT
        CALL CLEARSCREEN
        CALL MESSAGE       
        MOV AX,4C00H
        INT 21H
    MAIN ENDP

DISPLAY PROC NEAR
        MOV AH,09H
        INT 21H
        RET
DISPLAY ENDP 

STRINGINPUT PROC NEAR
        MOV AH,0AH
        INT 21H
        RET
STRINGINPUT ENDP 

CLEARSCREEN PROC NEAR
        MOV AX,0602H
        MOV CX,0000H
        MOV DX,184FH
        INT 10H 
        INT 10H 
        RET
CLEARSCREEN ENDP

COUNT PROC NEAR
        MOV CH,0
        MOV CL,USR
        LEA SI,INPUT
        UP:MOV DL,[SI]
          CMP DL,'0'
          JB DOWN1
          CMP DL,'9'
          JA DOWN1
          ADD DIGIT,1
          JMP BELOW
        DOWN1:CMP DL,'A'
            JB DOWN2
            CMP DL,'Z'
            JA DOWN2
            ADD UPPER,1
            JMP BELOW
        DOWN2:CMP DL,'a'
            JB DOWN3
            CMP DL,'z'
            JA DOWN3
            ADD LOWER,1
            JMP BELOW
        DOWN3:ADD OTHER,1
        BELOW:INC SI
            LOOP UP
            RET
COUNT ENDP

MESSAGE PROC NEAR 
        LEA DX,PROMPT2
        CALL DISPLAY 
        LEA DX,INPUT
        CALL DISPLAY
        LEA DX,PROMPT3
        CALL DISPLAY
        LEA DX,UPPER
        CALL DISPLAY 
        LEA DX,PROMPT4
        CALL DISPLAY
        LEA DX,LOWER
        CALL DISPLAY
        LEA DX,PROMPT5
        CALL DISPLAY
        LEA DX,DIGIT
        CALL DISPLAY
        LEA DX,PROMPT6
        CALL DISPLAY
        LEA DX,OTHER
        CALL DISPLAY
        RET
MESSAGE ENDP 

CONVERT PROC NEAR
  MOV DI,0
        MOV BL,0
        MOV AH,00
        MOV AL,[SI]
        MOV CX,10
        AG:MOV AH,0
        DIV CL
        ADD AH,30H
        ADD BL,1 
        MOV TEMP[DI],AH
        INC DI
        CMP AL,0
        JA AG 
        MOV CH,0
        MOV CL,BL
        DEC DI
        RE:MOV AH,TEMP[DI]
        MOV [SI],AH
        DEC DI
        ADD SI,1
        LOOP RE
    RET
        CONVERT ENDP 

END MAIN



Last edited by Formatted on 24th March 2009, 12:08 am; edited 1 time in total


_________________
REGISTER AND LOG-IN TO PARTICIPATE
START POSTING YOUR IDEAS AND THOUGHTS AND BUILD THE COMMUNITY OF EXPERTS.
View user profile http://kantipur.friendhood.net

2 Re: 8086 assessment solution on 23rd March 2009, 12:41 pm

tihor

avatar
Administrator
program ta thikai cha ki. tara complex bhayena ra nabujne haru ko lagi. ali simple garera lekhe kaso hola. hami le ta just concept dine po ho ta. complex code lekhepachi ta na bujne harule concept nai paudaina ni.

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