An Assembly program to convert lower case to upper case – IGNOU MCA Assignment 2014 – 15

By | July 18, 2014

 MASTER OF COMPUTER APPLICATIONS
Course Code : MCSL-017
Course Title : C and Assembly Language Programming
Assignment Number : MCA(1)/L017/Assign/2014-15
Maximum Marks : 100
Weightage : 25%

 

Write a program in assembly language for converting lower case to upper case in a given string of characters.

 

DATA SEGMENT
MSG1 DB 10,13,’ENTER ANY STRING :- $’
MSG2 DB 10,13,’CONVERTED STRING IS : $’

P1 LABEL BYTE
M1 DB 0FFH
L1 DB ?
P11 DB 0FFH DUP (‘$’)
DATA ENDS

DISPLAY MACRO MSG
MOV AH,9
LEA DX,MSG
INT 21H
ENDM

CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX

DISPLAY MSG1

LEA DX,P1
MOV AH,0AH
INT 21H

DISPLAY MSG2

LEA SI,P11

MOV CL,L1
MOV CH,0
CHECK:
CMP [SI],61H
JB DONE

CMP [SI],5BH

UPR: SUB [SI],20H

DONE: INC SI
LOOP CHECK

DISPLAY P11

MOV AH,4CH
INT 21H
CODE ENDS

END START

program code :

  1. DATA SEGMENT
  2. MSG1 DB 10,13,'ENTER ANY STRING :- $'
  3. MSG2 DB 10,13,'CONVERTED STRING IS : $'
  4. P1 LABEL BYTE
  5. M1 DB 0FFH
  6. L1 DB ?
  7. P11 DB 0FFH DUP ('$')
  8. DATA ENDS
  9. DISPLAY MACRO MSG
  10. MOV AH,9
  11. LEA DX,MSG
  12. INT 21H
  13. ENDM
  14. CODE SEGMENT
  15. ASSUME CS:CODE,DS:DATA
  16. START:
  17. MOV AX,DATA
  18. MOV DS,AX
  19. DISPLAY MSG1
  20. LEA DX,P1
  21. MOV AH,0AH
  22. INT 21H
  23. DISPLAY MSG2
  24. LEA SI,P11
  25. MOV CL,L1
  26. MOV CH,0
  27. CHECK:
  28. CMP [SI],61H
  29. JB DONE
  30. CMP [SI],5BH
  31. UPR: SUB [SI],20H
  32. DONE: INC SI
  33. LOOP CHECK
  34. DISPLAY P11
  35. MOV AH,4CH
  36. INT 21H
  37. CODE ENDS
  38. END START

Screen shots :-

Asm_program_Lower_2_Upper

 

After Execution :-

 Asm_program_Lower_2_Upper_Out

 

Leave a Reply