Write and run an Assembly language program that converts lowercase alphabets in a given input string to uppercase – IGNOU MCA Assignment 2016 – 17

By | October 9, 2016

BACHELOR OF COMPUTER APPLICATIONS

Course Code : BCSL-022
Course Title : Assembly Language Programming Lab
Assignment Number : BCA(2)/L-022/Assignment/16-17
Maximum Marks : 50
Weightage : 25%

Write and run an Assembly language program that converts lowercase alphabets in a given input string to uppercase. The input may consist of uppercase alphabets, special characters and lowercase alphabets. For example, for the input string A@abAYaf, the output will be A@ABAYAF. You may assume that the string is available in the memory and output is stored in a memory array – IGNOU MCA Assignment 2016 – 17

Code:-

DATA SEGMENT
STR DB ‘A@abAYaf$’
MSG1 DB 10,13,’STRING IN MEMORY IS : $’
MSG2 DB 10,13,’CONVERTED STRING IS : $’
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

DISPLAY STR

DISPLAY MSG2

LEA SI,STR

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

CMP [SI],5BH

UPR:    SUB [SI],20H

DONE:   INC SI
LOOP CHECK

DISPLAY STR

MOV AH,4CH
INT 21H
CODE ENDS

END START

DATA SEGMENT
STR DB 'A@abAYaf$'
MSG1 DB 10,13,'STRING IN MEMORY IS : $'
MSG2 DB 10,13,'CONVERTED STRING IS : $'
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
DISPLAY STR
DISPLAY MSG2
LEA SI,STR
MOV CL,8
MOV CH,0
CHECK:
CMP [SI],61H
JB DONE
CMP [SI],5BH
UPR:    SUB [SI],20H
DONE:   INC SI
LOOP CHECK
DISPLAY STR
MOV AH,4CH
INT 21H
CODE ENDS
END START

 

Screen Shots :-

Asm_program_Lower_2_Upper_Memory

Output After Execution :-

Asm_program_Lower_2_Upper_Memory_Out

Note :- To see the variable and its value you have to click vars button in the emulator.