Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

CS609 Assignment # 02 Solution Spring 2013

View previous topic View next topic Go down

GMT + 8 Hours CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:07 am

Assignment No. 02
Semester: Spring 2013
System Programming-CS609

Total Marks: 20

Due Date: 17/May/2013

Instructions:
Please read the following instructions carefully before submitting assignment:


You will submit your assignment before or on due date on VU-LMS.
Assignment should be completed by your own efforts it should not be copied from internet, handoutsor books.
You should submit your .doc File via assignment interface at VU-LMS.
Assignment sent via Email will not be replied and accepted/graded in any case.
If the submitted assignment does not open or file is corrupt, it will not be graded.
You will submit solution only in document (.doc or .docx) File.


Objectives:

To understand the use of PPI.


For any query about the assignment, contact at cs609@vu dot edu dot pk
Assignment Questions

Question 1: Marks 08

Answer the following questions precisely. Do not include irrelevant data in your answers. (1 mark for each)
Q.1. Which type of communication is feasible for a large distance?
Q.2. Which signals performs Handshaking and Polling?
Q.3. Where the PPI exists?
Q.4. Which interrupt and its service used to initialize the printer?
Q.5. Why we initialize the printer when it is already in ready state?
Q.6. Which BIOS routine supports the LPT4 and how?
Q.7. If the printer is connected at LPT1, where and what value should you placed?

Question 2: Marks 12

Write a program to print a file “abc.txt” located on D drive. Your program should perform the following checks before printing a character. (12 marks)
i. Printer has not any communication error.
ii. Printer is not busy.
iii. Printer must be selected.
BEST OF LUCK
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:07 am

Q.4. Which interrupt and its service used to initialize the printer?
interrupt INT 17H
service number 01
Q.3. Where the PPI exists?
it exist between CPU and parallel I/O devices ports.(not sure)
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:07 am

Q.1. Which type of communication is feasible for a large distance?
There's basically two options I see: get one of those super long range radio modules, like XBee that's rated for 1 mile distance, or get a cellphone module and communicate over the internet using the cellular network.
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:08 am

Q.1. Which type of communication is feasible for a large distance?
Serail communication.
Q.2. Which signals performs Handshaking and Polling?
r *d (data ready)
strobe signal
Q.3. Where the PPI exists?
PPI act an interface between I/O and CPU.
Q.4. Which interrupt and its service used to initialize the printer?
INt.17H/01H
Q.5. Why we initialize the printer when it is already in ready state?
to check the status of printer. i thnk...not cnfrmed yet
Q.6. Which BIOS routine supports the LPT4 and how?
Bios does not support LPT4. it just support LAPT1, LPT2, LPT3
Q.7. If the printer is connected at LPT1, where and what value should you placed?
At LPT1= DX register conatain value 0.
AH register returns printer status.
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:08 am

Q.1. Which type of communication is feasible for a large distance?
Serial communication. page no 105 (in video lectr it is more elaborated)
Q.2. Which signals performs Handshaking and Polling?
r *d (data ready)
strobe signal
Q.3. Where the PPI exists?
PPI act an interface between I/O and CPU.page no(83) lectr #11
Q.4. Which interrupt and its service used to initialize the printer?
INt.17H/01H page 84
Q.5. Why we initialize the printer when it is already in ready state?
to check the status of printer. i thnk...not cnfrmed yet
Q.6. Which BIOS routine supports the LPT4 and how?
Bios does not support LPT4. it just support LAPT1, LPT2, LPT3(page 91)
Q.7. If the printer is connected at LPT1, where and what value should you placed?
At LPT1= DX register conatain value 0.
AH register returns printer status. page84
baqi ye zaida detail btai hy vedio lectr main
aksar batain book main ni hain yani handshaking ka in lectr main us n ni btai howa jo vedio lectr hain un mainbtai howa hy
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:09 am

For more information about answer # 1. It is not required to write all but just sharing for information. (ref. CS501 Handouts; Page # 239)
Serial Transfer, or serial communication of data between the CPU and the I/O devices, refers to the situation when all the data bits in a "piece of information", (which is a byte or word mostly), are transferred one bit at a time, over a single pair of wires.
Advantages:
• Easy to implement, especially by using UARTs7 or USARTs8.
• Low cost because of less wires.
• Longer distance between transmitter and receiver.
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:09 am

FOr Question # 2: Just for information and explanation, no need for answer. (ref. CS501 Handouts. Alot much written in this about this topic but you dont need to waste your time in reading all. just complete your assignment)
Ready State; HandShaking:It is used when Master and the Slave memory are being used for transferring data from one memory to another.
Strobe Singnal; Polling: It is used with usage of I/O devices. work like INT but not INT.


agar aap Lecture no.11 ke first 15 mint sun lo to i am 100% sure ke aap mian se har koi 2nd question asani se solve ker le ga...... kisi se kuch mangnay ya poochnay ki zaroorat nahi paray gi.....
ya phir book ka page 86 to 88 study ker lo... magar zeyada better hay ke video lecture no.11 sun lo sif 15 mint


why we initialize the printer when it is already in ready state

ANSWER:
kun k ho sakta hy k jab printer on ho to PPI k andar ports pe koi garbage value ho to un ko zeros krny k lye yani 0 s intilize krny k ham intilization servicee use krty hain . (FROM LECTR NO 11.)
ye sir ny kaha hy lectr main guys ap is ko translate khud kr lain this is the answer.
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Victoria333 Sat May 18, 2013 7:10 am

Question No.2 Solution
union REGS regs; FILE *fptr;
void main(void)
{
fptr=fopen(“d:\\abc.txt”,”rb”);
regs.h.ah=1;
regs.x.dx=0;
int86(0x17,®s,®s);
while(!feof(fptr))
{regs.h.ah=2;
regs.x.dx=0;
int86(0x17,®s,®s);
if ((regs.h.ah & 0x80)==0x80)
{ regs.h.ah=0;
regs.h.al=getc(fptr);
int86(0x17,®s,®s);
}}}
Victoria333
Victoria333
Monstars
Monstars

Scorpio Snake
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Woot

Back to top Go down

GMT + 8 Hours Re: CS609 Assignment # 02 Solution Spring 2013

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum