Sunteți pe pagina 1din 50

MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

Course Code: MCS-012


Course Title: Computer Organisation And Assembly Language Programming
Assignment Number: MCS-012/Assignment/17-18
Last Date of Submission: 15th Oct, 2017 (for Jul-2017 batch)
: 15th April, 2018(for Jan-2018 batch)

KHOJI.NET
Page 1

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 2

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 3

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 4

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 5

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 6

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 7

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 8

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 9

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 10

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 11

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 12

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 13

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 14

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 15

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 16

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 17

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 18

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 19

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 20

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 21

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 22

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 23

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 24

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 25

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 26

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 27

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 28

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 29

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 30

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 31

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 32

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 33

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 34

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 35

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 36

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 37

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 38

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 39

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 40

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 41

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA
Ans. 4(a).
Each string instruction may require a source operand, a destination operand or both.
For 32-bit segments, string instructions use ESI and EDI registers to point to the source
and destination operands, respectively.

For 16-bit segments, however, the SI and the DI registers are used to point to the
source and destination, respectively.

There are five basic instructions for processing strings. They are

KHOJI.NET
MOVS This instruction moves 1 Byte, Word or Doubleword of data from
memory location to another.

LODS This instruction loads from memory. If the operand is of one byte, it is
loaded into the AL register, if the operand is one word, it is loaded into the AX
register and a doubleword is loaded into the EAX register.

STOS This instruction stores data from register (AL, AX, or EAX) to memory.

CMPS This instruction compares two data items in memory. Data could be of a
byte size, word or doubleword.

SCAS This instruction compares the contents of a register (AL, AX or EAX)


with the contents of an item in memory.

Each of the above instruction has a byte, word, and doubleword version, and string
instructions can be repeated by using a repetition prefix.

These instructions use the ES:DI and DS:SI pair of registers, where DI and SI registers
contain valid offset addresses that refers to bytes stored in memory. SI is normally
associated with DS (data segment) and DI is always associated with ES (extra
segment).
Page 42
DATA SEGMENTSTR DB AXYBCSDEF$
SUBSTR DB BCS$
LEN1 DB 0
LEN2 DB 0
MSG1 DB 10,13,STRING IS : $
MSG2 DB 10,13,SUBSTRING IS : $
MSG3 DB 10,13,SUBSTRING IS FOUND AT POSITION : $

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA
POS DB -1
RTN DB -1$
DATA ENDS

DISPLAY MACRO MSG


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

KHOJI.NET
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX

DISPLAY MSG1
DISPLAY STR
DISPLAY MSG2
DISPLAY SUBSTR

LEA SI,STR
NXT1:
CMP [SI],$
JE DONE1
INC LEN1
INC SI
JMP NXT1
DONE1:
LEA DI,SUBSTR
NXT2:
CMP [DI],$
JE DONE2
INC LEN2
INC DI
JMP NXT2
DONE2:
DISPLAY MSG3
Page 43
LEA SI,STR
MOV AL,LEN1
SUB AL,LEN2
MOV CL,AL
MOV CH,0
FIRST:
INC POS

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA
MOV AL,[SI]
CMP AL,SUBSTR[0]
JE CMPR
INC SI
LOOP FIRST

CMPR: INC SI
MOV AL,[SI]
CMP AL,SUBSTR[1]
JNE NOTEQUAL

KHOJI.NET
INC SI
MOV AL,[SI]
CMP AL,SUBSTR[2]
JE EQUAL

NOTEQUAL:
MOV POS,-1
DISPLAY RTN
JMP EXIT

EQUAL:
MOV DL,POS
ADD DL,30H
MOV AH,2
INT 21H

EXIT: MOV AH,4CH


INT 21H

CODE ENDS

END START

Ans.4(b)
DATA SEGMENT
PACKEDBCD DB 52H
BINARY DB ? Page 44
DATA ENDS
CODE SEGMENT
ASSUME DS:DATA CS:CODE
START:
MOV AX,DATA
MOV DS,AX

MOV AH,0
MOV AL,PACKEDBCD

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA
MOV BL,AL

AND AL,0F0H
AND BL,0FH

MOV CL,04H
ROL AL,CL

MOV CL,10
MUL CL

KHOJI.NET
ADD AL,BL

MOV AH,AL
MOV BINARY,AH

MOV AH,4CH
INT 21H
CODE ENDS
END START

Screen shots :-

Page 45

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA
Before Execution :-

KHOJI.NET
After Execution :-

Ans.4(c)

(i). 8086 has a concept of Memory Segmentation. It is a method where the whole memory is
segmented (divided) into smaller parts called segments. These segments are
Code Segment (CS)
Stack Segment (SS)
Data Segment (DS)
Extra Segment (ES)
Each Segment has a corresponding 16-bit Segment Register which holds the Base Address
(starting Address) of the Segment. At any given time, 8086 can address 16-bit x 64KB = 256 KB
Page 46
of memory chunk out of 1MB.

8086 has 20bit address line. So the maximum value of address that can be addressed by 8086 is
2^20 = 1MB. So 8086 can address the locations ranging between 00000 H to FFFFF H. This
1MB memory is divided into 16 logical segments, each with a memory of 64KB.

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA
To locate any adress in the memory bank, it needs the Physical address of that memory location.
It cannot get the 20-bit Physical adress using the 8086 Address Line or 16-bit Segment Registers
alone.

In order to access memory location, you cannot pass 20-bit address directly to the processor. You
need to tell the 16-bit address with respect to the segment. This 16-bit address with respect to the
part (segment of 64KB) of the memory bank is called the offset.

So, Physical Address = Base Address + Offset.

KHOJI.NET
Suppose the Data Segment holds the Base Aaddress as 1000h and the data you need is present in
the 0020h memory location (Offset) of the Data Segment. The calculation of the actual address is
done as follows.

1. Left shift the 16-bit address present in the segment register by 4-bits
0001 0000 0000 0000 (0000)
2. Add the 16-bit offset address to this shifted base address

0001 0000 0000 0000 0000


+ 0000 0000 0010 0000
--------------------------------------
0001 0000 0000 0010 0000

So the actual address turns out to be 10020h.

At any point of time we can change the base address of the segment registers and use the
memory locations in those segments using the offset.

Page 47

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 48

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

KHOJI.NET
Page 49

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet


MCS-012 SOLVED ASSIGNMENT FOR BCA/MCA

Now you can earn with us, sell your solved assignments with us and get 35% commission on
every sale of your assignment.

KHOJI.NET
No Paytm or any wallet, payment will be made directly to your bank account.

Commission will be given on each sale of your assignment.

You dont have to do anything just send us your solved assignment, sit back and receive your
commission in your bank.

Only latest assignments are accepted for sale.

Only those assignments which are not available on our site are accepted.

Interested?

Need more info?

Email us: response@khoji.net

Or send message on our facebook page: https://www.facebook.com/khojinet

Page 50

LIKE OUR FACEBOOK PAGE FOR UPDATES facebook.com/khojinet

S-ar putea să vă placă și