Professional Documents
Culture Documents
com
Course Code
: MCSL-017
Course Title
Assignment Number
: MCA(1)/L017/Assign/2014-15
Maximum Marks
: 100
Weightage
: 25%
Last Dates for Submission : 15th October, 2014 (For July 2014 Session)
15th April, 2015 (For January 2015 Session)
This assignment has two sections. Answer all questions in each section. Each Section is of 20
marks. Your Lab Records will carry 40 Marks. Rest 20 marks are for viva voce. You may use
illustrations and diagrams to enhance the explanations. Please go through the guidelines
regarding assignments given in the programme guide for the format of presentation.
Section 1: C Programming Lab
Question 1:
Write an interactive program in C language to create an application similar to NOTEPAD. Write a
program, mynotepad.c, which reads words from any file having extension .txt and displays each
word on a line by itself. A word is defined as any sequence of characters separated by a blank, a tab,
or a newline. Note that this definition for a word considers punctuation as part of the word. This
program should have features like cut, copy, paste, write and search. The application should be
designed user-friendly.
Note: You must execute the program and submit the program logic, sample input and output along
with the necessary documentation for this question.Assumptions can be made wherever necessary.
Solution : Coming Soon
Section 2: Assembly Language Programming Lab
Question 1:
a) Write a program in assembly language for converting lower case to upper case in a given
string of characters.
Solution :
DATA SEGMENT
MSG1 DB 10,13,ENTER ANY STRING :- $
MSG2 DB 10,13,CONVERTED STRING IS : $
P1 LABEL BYTE
M1 DB 0FFH
www.ignousolvedassignments.com
L1 DB ?
P11 DB 0FFH DUP ($)
DATA ENDS
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
www.ignousolvedassignments.com
DISPLAY P11
MOV AH,4CH
INT 21H
CODE ENDS
END START
b) Develop and execute an assembly language program to read an array of numbers and
find the minimal and maximal elements.
Solution:
DATA SEGMENT
ARR DB 5,3,7,1,9,2,6,8,4
LEN DW $-ARR
MIN DB ?
MAX DB ?
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX,DATA
MOV DS,AX
www.ignousolvedassignments.com
LEA SI,ARR
MOV AL,ARR[SI]
MOV MIN,AL
MOV MAX,AL
MOV CX,LEN
REPEAT:
MOV AL,ARR[SI]
CMP MIN,AL
JL CHECKMAX
MOV MIN,AL
CHECKMAX:
CMP MAX,AL
JG DONE
MOV MAX,AL
DONE:
INC SI
LOOP REPEAT
MOV AH,4CH
INT 21H
CODE ENDS
END START
Before Execution :-
www.ignousolvedassignments.com
ignou.nisecomputers.com
After Execution :-
www.ignousolvedassignments.com
c)
Solution:
DATA SEGMENT
STR DB GANGADHAR$
MSG1 DB 10,13,THE STRING IN THE MEMORY IS : $
MSG2 DB 10,13,LENGTH OF THE STRING IS :- $
LEN DB 0H
DATA ENDS
www.ignousolvedassignments.com
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
DISPLAY MSG1
DISPLAY STR
LEA SI,STR
NEXT:
CMP [SI],$
JE DONE
INC LEN
INC SI
JMP NEXT
DONE:
DISPLAY MSG2
MOV AL,LEN
ADD AL,30H
MOV DL,AL
MOV AH,2
INT 21H
www.ignousolvedassignments.com
MOV AH,4CH
INT 21H
CODE ENDS
END START
After Execution :-
DATA SEGMENT
MSG1 DB 10,13,RANDOM NUMBERS ARE : $
MSG2 DB 10,13, $
www.ignousolvedassignments.com
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX,DATA
MOV DS,AX
LEA DX,MSG1
MOV AH,9
INT 21H
LEA DX,MSG2
MOV AH,9
INT 21H
NXT:
MOV AH,2CH ; Set time function
INT 21H
CALL HEX2DEC
LEA DX,RES
MOV AH,9
INT 21H
www.ignousolvedassignments.com
LEA DX,MSG2
MOV AH,9
INT 21H
JMP NXT
MOV AH,4CH
INT 21H
CODE ENDS
ADD AL,30H
MOV [SI],AL
LOOP2: POP AX
INC SI
MOV [SI],AL
LOOP LOOP2
RET
HEX2DEC ENDP
END START
www.ignousolvedassignments.com
After Execution :-