<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[CS609 Assignment 2 Solution and Discussion]]></title><description><![CDATA[<p dir="auto">Semester: Fall 2019<br />
CS609: System Programming<br />
Graded<br />
Assignment No. 02	Total Marks: 20</p>
<p dir="auto">Due Date: Dec 02, 2019</p>
<p dir="auto">Instructions:</p>
<p dir="auto">Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:</p>
<p dir="auto">	The assignment is submitted after due date.<br />
	The submitted assignment does not open or file is corrupt.<br />
	You have not followed steps described in Detailed Instructions of the problem statement.<br />
	Assignment is copied (partial or full) from any source (websites, forums, students, etc.) Strict action will be taken in this regard.</p>
<p dir="auto">Note: You have to upload only .doc or .docx file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks.</p>
<p dir="auto">Objectives:</p>
<p dir="auto">The objective of this assignment is to provide hands-on experience of System Programming concepts including:</p>
<p dir="auto">•	How can interrupts be generated<br />
•	What are Interrupts<br />
•	Interrupt functions writing<br />
•	TSR program<br />
•	Calling interrupt functions</p>
<p dir="auto">For any assignment related query, contact at<br />
<a href="mailto:cs609@vu.edu.pk" target="_blank" rel="noopener noreferrer nofollow ugc">cs609@vu.edu.pk</a></p>
<p dir="auto">Problem Statement:<br />
You are required to write C program which will display one ‘*’ character on the screen on each CPU timer interrupt 8 in a way that each * character is displayed after the previous *. i.e</p>
<hr />
<p dir="auto">On elapse of 7 seconds then the screen characters should be removed and again the * character should be started printing on the screen in similar way i.e   *********<br />
This process should be continued again and again until you press any key from the keyboard.<br />
Instructions:</p>
<ol>
<li>You should include all related header files first of all then declare interrupt pointer to hold Timer i.e void interrupt (*oldTimer)(void);</li>
<li>Similarly, give prototype for new functions of newtimer() i.e void interrupt newTimer();</li>
<li>Declare a far pointer i.e *scr to hold far address =0xB8000000;</li>
<li>Store current vector values of INT 8 through getvect in oldTimer.</li>
<li>Set newTimer fuctions through setvect.</li>
<li>In newTimer() function, give logic to print ‘*’ on the screen i.e *(scr+i)=0x2A;</li>
<li>Write code to wait for 7 seconds i.e t&gt;=126 and through loop write blank spaces on the screen by  setting keyboard status with black background i.e no character on screen i.e<br />
*(scr+i)=ox20;<br />
*(scr+i+1)=ox07;</li>
<li>When any key is pressed from the keyboard, the program should stop.<br />
Note: Your assignment should Word file (.doc or .docx) containing your code.</li>
</ol>
<p dir="auto">Best of Luck!</p>
]]></description><link>https://community.secnto.com//topic/683/cs609-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 20:55:14 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/683.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Nov 2019 08:08:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS609 Assignment 2 Solution and Discussion on Tue, 07 Jan 2020 12:17:58 GMT]]></title><description><![CDATA[<p dir="auto"><strong>Solution:</strong></p>
<pre><code>// Header Files
#include&lt;stdio.h&gt;
#include&lt;conio.h&gt;
#include&lt;BIOS.H&gt;
#inlcude&lt;DOS.H&gt;
void interrupt (*oldTimer)(*void); // To store current Timer vector
void interrupt newTimer();     //New Timer Function
char far *scr= (char far *)0xB8000000; //Screen segment
int in, t=0;
void main()
{
  clrscr();
  oldTimer=getvect(8);
  setvect(8,newTimer);
  getch();
}
void interrupt newTimer();
{
*(scr+t)=0x2A;
t++;
if(t&gt;=126) 
{
for(i=0;i&lt;4000;i+=2)
  {
      *(scr+i)=0x20;            // Blank screen
      *(scr+i+1)=0x07;
   }
    t=0;
}
(*oldTimer)();
}
}

</code></pre>
]]></description><link>https://community.secnto.com//post/2496</link><guid isPermaLink="true">https://community.secnto.com//post/2496</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Tue, 07 Jan 2020 12:17:58 GMT</pubDate></item><item><title><![CDATA[Reply to CS609 Assignment 2 Solution and Discussion on Sun, 01 Dec 2019 09:00:31 GMT]]></title><description><![CDATA[<pre><code>#include &lt;dos.h&gt;
void interrupt (*oldTimer)( ); //corrected
void interrupt (*oldKey)( ); //corrected
void interrupt newTimer ( );
void interrupt newKey ( );
char far *scr = (char far* ) 0xB8000000;
int i, t = 0, m = 0;
char charscr [4000];
void main( )
{
oldTimer = getvect(8);
oldKey = getvect (9);
setvect (8,newTimer);
setvect (9,newKey);
getch();
getch();
getch();
getch();
}
void interrupt newTimer ( )
{
t++;
if ((t &gt;= 182) &amp;&amp; (m == 0))
{
for (i =0; i &lt; 4000; i ++)
charscr [i] = *(scr + i);
for (i =0; i &lt;=4000; i +=2)
{
*(scr + i) = 0x20;
*(scr + i + 1) = 0x07;
}
t = 0; m = 1;
}
(*oldTimer) ( );
}
void interrupt newKey ( )
{
int w;
if (m == 1)
{
for (w =0; w &lt; 4000; w ++)
*(scr + w) = charscr [w];
m = 0;
}
(*oldKey) ( );
}
</code></pre>
]]></description><link>https://community.secnto.com//post/2070</link><guid isPermaLink="true">https://community.secnto.com//post/2070</guid><dc:creator><![CDATA[zareen]]></dc:creator><pubDate>Sun, 01 Dec 2019 09:00:31 GMT</pubDate></item></channel></rss>