We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More

Looking for Something at Site? Search Below

Assignment No. 2 Semester: Fall 2015 System Programming-CS609 Total Marks: 20 Due Date: june 11, 2015

Instructions

Please read the following instructions carefully before submitting assignment:

It should be clear that your assignment will not get any credit if:

 

  • Assignment is submitted after due date.
  • Submitted assignment does not open or file is corrupt.
  • Assignment is copied (From internet/ to from students).

 

Assignment Submission Instructions

Zip file containing A2.c and A2.doc files

 

Assignment

 

 

[Marks = 20]

 

Write a C program to generate encoded text and print it using COM PORTS. When a key is pressed from keyboard, get its ASCII Code, add 1 in its ASCII Code value and use it as output of UART to direct the output to the lower part of the output screen.

 

Hint: Make sure to ON Self Test mode.

 

Sample output screen is as under;

 

 

Important Instructions:

 

ü  You have to submit your A2.c file containing your code and A2.doc file containing code of A2.c as text. Zip both files and upload on LMS page of CS609.

ü  Your assignment is checked for plagiarism, if found to be copied from internet or from / to students, it will award as zero straight away.

ü  15 Marks are for written code while 5 marks are for output format specified in sample output screen.


+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


Views: 11384

Replies to This Discussion

bhai log ur IIn ki bhan log kaha ho aa jaaaoo solution ka liye

koi to kuch idea dy... kesy bany gi assigment... A2.c or A2.doc ya kon c files hy?

You have to save written code in tubro c compiler with extension .c and name it as A2.   

solution plz

koi Allah ka bnda solutn snd kr dy

code nai hai 

trying for code

void sendchar (char ch, int pno)
{
_DX = pno;
_AH = 1;
_AL = ch;
geninterrupt (0x14);
}
unsigned int getcomstatus (int pno)
{
unsigned int temp;
_DX = pno;
_AH = 03;
geninterrupt (0x14);
*((char*)(&temp)) = _AL;
*(((char*)(&temp)) + 1) = _AH;
return temp;
}
the sendchar() function sends a character to the COM port using BIOS service whose
number is passed as parameter. And the getcomstatus() function retrieves the status of the
COM port whose number has been specified and returns the modem and line status in an
unsigned int.
void main()
{
while(1) {
i = getcomstatus (0);
if (((*(((char*)(&i)) + 1)&0x20) == 0x20) && (kbhit()))
{
ch1 = getche();
sendchar (ch1, 0);
}i
f ((*(((char*)(&i)) +1) & 0x01) == 0x01) {
ch2 = receivechar (0);
putch (ch2);
}i
f ((ch1 == 27) || (ch2 ==27))
break;
}
}
Let’s suppose two UARTs are interconnected using a NULL modem
In the main () function there is a while loop which retrieves the status of the COM port.
Once the status has been retrieved it checks if a byte can be transmitted, if a key has been
pressed and its is clear to send a byte the code within the if statement sends the input byte
to the COM port using sendchar() function.
The second if statement checks if a byte can be read from the COM port. If the Data
ready bit is set then it receives a byte from the data port and displays it on the screen.
Moreover there is another check to end the program. The program looks for an escape
character ASCII = 27 either in input or in output. If this is the case then it simply breaks
the loop.

kya koi bata sakta hai k yeh code thek hai yeh nai handout se lia hai dekha b hai confirm karna hai page 125 and 126 hai

Saria khan this code is use for communication between two computer. so dont waste your time on it.

Lagta ha solution mil e gia ha

 

I got same typ of output bt this out put iz not matching with assignment'z out put. 

RSS

Today Top Members 

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.