- Back to Home »
- CS609 Assignment no 2 Spring 2013 Full Solution
Posted by : Anonymous
Saturday, 18 May 2013
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.
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.
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.
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);
}}}
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.
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.
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.
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);
}}}