<?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">Re: <a href="/topic/683/cs609-assignment-2-solution-and-discussion">CS609 Assignment 2 Solution and Discussion</a></p>
<pre><code>Semester: Spring 2020
</code></pre>
<p dir="auto">CS609: System Programming<br />
Graded<br />
Assignment No. 02	Total Marks: 20</p>
<p dir="auto">Due Date: June 11, 2020</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:<br />
•	How can interrupts be generated<br />
•	What are Interrupts<br />
•	Interrupt functions writing<br />
•	BIOS data area.<br />
•	TSR program<br />
•	Calling interrupt function</p>
<p dir="auto">For any assignment related query, contact at <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 />
Q: Write down a program in C which will display any long string on the screen and after passing 5 seconds, if no key is pressed then the string should be changed by replacing all character of ‘y’  on the screen (video text memory) by ‘z’. For example: String on Screen is : “Hey young man, you have a lovely watch”. It should be changed to “Hez zoung man, zou have a lovelz watch”.</p>
<p dir="auto">[Hint: Video text memory area starts from location B800:0000. You have to traverse whole text memory area by using for loop, and then use simple if statements, to replace y with z.</p>
<p dir="auto">Instructions:</p>
<ol>
<li>You should include all related header files first of all then declare string array to store string to be displayed and declare interrupt pointer to hold old interrupt i.e<br />
char str1[80]={“ “Hey young man, you have a lovely watch”$”}<br />
void interrupt (*old)(void);</li>
<li>Similarly, give prototype for new functions of i.e<br />
void interrupt newfunc();</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 old().</li>
<li>Set newFunc() fuctions through setvect.</li>
<li>In newFunc() function, give logic to wait for 5 seconds i.e t&gt;=90</li>
<li>Replace y character to z i.e<br />
for ( int j = 0; j &lt; 4000; j += 2) {<br />
if(*(scr + j) == 0x79’) // small y ASCII code.<br />
*(scr + j) = 0x7A;// small z ASCII code.</li>
</ol>
<p dir="auto">Sample Code:</p>
<pre><code>#include &lt;stdio.h&gt;
#include &lt;BIOS.H&gt;
#include &lt;DOS.H&gt;
int t=0;
char str1[…..Hey young boy you have a lovely watch$”}; 
void interrupt (*old)(void);
char far *……..)0xb8000000; // code to access video text memory area
void interrupt newFunc();
void main( )
{
          clrscr();
         // Display string on screen by calling int21h.
           old=getvect(…….);
	setvect(0x08,newFunction); 
}
void interrupt newFunction( )
{ 
If (t&gt;=90 )
// write for loop here
// write body of for loop}
//if part
…..
(*old)();    
}
</code></pre>
<p dir="auto">Note: Your assignment file should be a single Word file (.doc or .docx).</p>
]]></description><link>https://community.secnto.com//topic/1846/cs609-assignment-2-solution-and-discussion</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 21:40:49 GMT</lastBuildDate><atom:link href="https://community.secnto.com//topic/1846.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 Jun 2020 09:14:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CS609 Assignment 2 Solution and Discussion on Sun, 07 Jun 2020 07:36:49 GMT]]></title><description><![CDATA[<p dir="auto"><a href="https://youtu.be/DSkQVScDH5s" target="_blank" rel="noopener noreferrer nofollow ugc">https://youtu.be/DSkQVScDH5s</a></p>
]]></description><link>https://community.secnto.com//post/5170</link><guid isPermaLink="true">https://community.secnto.com//post/5170</guid><dc:creator><![CDATA[Ganza Nadi]]></dc:creator><pubDate>Sun, 07 Jun 2020 07:36:49 GMT</pubDate></item></channel></rss>