Sunday , 24 November 2024

CS609 Assignment no 05 Fall 2012 Solution has been uploaded

Assignment No. 05
Semester: Fall 2012

CS609: System Programming

Total Marks: 20

 Due Date: EXPIRED

Assignment                                                                  

 

Read carefully the C-language program in your course handouts (page 127-129). In this program, you are told how to set various serial port parameters. Based on the knowledge you gain here, answer the following by writing appropriate C-language instruction with single line comments to achieve stated task.


 

S.No. Task C-Language Instruction with single line comments
1 Write a single line of code to set the com pointer variable to COM port 3.  

 

2 Write a single line of code to set the size of Word Length to     8-bits to be used in serial communication for data transmission.  
3 Write a single line of code to set the size of Stop bits equals 3 in serial port communication.  

 

 

4 Write a single line of code to turn ON the parity bit and use Even parity.  

 

 

5 In the following piece of code, the Baud rate being used is 1200. Modify it in a way such that we shall have Baud Rate of 2400.

 

outportb ((*com)+3,inport((*com)+3)|0x80);

outportb ( (*com),0x60);

outportb( (*com) +1, 0x00);

 

 

Submission

You are required to submit a single MS word file through LMS containing:

  • Answers the questions in the same Tabular format.
 

 

 IDEA Solution

S.No. Task C-Language Instruction with single line comments
1 Write a single line of code to set the com pointer variable to COM port 3. Outportb((* com)+3)

 

 

2 Write a single line of code to set the size of Word Length to     8-bits to be used in serial communication for data transmission.  

Outportb((*com)+3),0x03);

 

3 Write a single line of code to set the size of Stop bits equals 3 in serial port communication. In serial communication we can’t sets stop bit to3. Only stop bit can be  sets to 1 , 1.5 or2  through out
 4 Write a single line of code to turn ON the parity bit and use Even parity. Outportb((*com)+3,0×18);

 

 


 

 

5 In the following piece of code, the Baud rate being used is 1200. Modify it in a way such that we shall have Baud Rate of 2400.

 

outportb ((*com)+3,inport((*com)+3)|0x80);

outportb ( (*com),0x60);

outportb( (*com) +1, 0x00);

 

Outportb((*com)+3,import((*com)+3)|0x80);

Outportb((*com),0x03);

Outportb((*com)+1,0×00);

 

Check Also

CS609 today solved Papers by Muhammad Zeeshan & Aamer Abbas

Quiz Start Time: 06:58 PM Time Left 34 sec(s) Question # 1 of 10 ( …

Leave a Reply

Your email address will not be published. Required fields are marked *

*