CS609 Assignment # 02 Solution Spring 2013
Page 1 of 1 • Share
CS609 Assignment # 02 Solution Spring 2013
Assignment No. 02
Semester: Spring 2013
System Programming-CS609
Total Marks: 20
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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)
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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.
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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.
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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.
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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.
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Re: CS609 Assignment # 02 Solution Spring 2013
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);
}}}
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- Monstars
-
Posts : 267
Join date : 2013-05-12
Age : 34
Location : Victoria
Similar topics
» CS304 Assignment #3 Solution Spring 2013
» CS403 Assignment # 3 Best Solution - Spring 2013
» CS401 Assignment # 3 Best Solution - Spring 2013
» MCM101 Assignment No.1 Best Solution - Spring 2013
» CS001 Assignment No. 02 Solution Spring 2013
» CS403 Assignment # 3 Best Solution - Spring 2013
» CS401 Assignment # 3 Best Solution - Spring 2013
» MCM101 Assignment No.1 Best Solution - Spring 2013
» CS001 Assignment No. 02 Solution Spring 2013
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Sat May 04, 2024 11:49 am by ali001
» house disrepair claims
Thu May 02, 2024 4:29 pm by Ibad Khan Buledi
» Bounce n Bang: Physics puzzler
Thu May 02, 2024 11:39 am by ali001
» AIChatSY - AIChatbot Assistant
Wed May 01, 2024 10:48 am by ali001
» Storybook Magic App
Tue Apr 30, 2024 7:06 pm by ali001
» Flower Book Match3 Puzzle Game
Tue Apr 30, 2024 12:17 pm by ali001
» Avian Influenza Symptom in Chickens "Bird Flu H5N1 Virus" Vet learning materials, Poultry Farming
Sat Apr 27, 2024 9:57 am by Ibad Khan Buledi
» Aloha Planner - Note-Taker
Thu Apr 11, 2024 4:52 pm by ali001
» Streaming Guide Film TV Series
Tue Apr 09, 2024 9:39 pm by ali001