+ Link For Assignments, GDBs & Online Quizzes Solution |
+ Link For Past Papers, Solved MCQs, Short Notes & More |
CS609 System Programming Assignment No 02 Spring 2020 Solution & Discussion Due Date: 11-06-2020
Semester: Spring 2020
CS609: System Programming
Graded
Assignment No. 02 Total Marks: 20
Due Date: June 11, 2020
Instructions:
Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:
The assignment is submitted after due date.
The submitted assignment does not open or file is corrupt.
You have not followed steps described in Detailed Instructions of the problem statement.
Assignment is copied (partial or full) from any source (websites, forums, students, etc.) Strict action will be taken in this regard.
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.
Objectives:
The objective of this assignment is to provide hands-on experience of System Programming concepts including:
• How can interrupts be generated
• What are Interrupts
• Interrupt functions writing
• BIOS data area.
• TSR program
• Calling interrupt function
For any assignment related query, contact at CS609@vu.edu.pk
Problem Statement:
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”.
[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.
Instructions:
Sample Code:
#include <stdio.h>
|
|
#include <BIOS.H>
|
|
#include <DOS.H>
|
|
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>=90 )
|
|
// write for loop here
|
|
// write body of for loop}
|
|
//if part
|
|
…..
|
|
(*old)();
|
|
}
|
Note: Your assignment file should be a single Word file (.doc or .docx).
Tags:
+ 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)
The link of solution file is given below and in this video use of interrupt vector and learn about the video memory and its far address and how to traverse the video memory.
Solution file: https://drive.google.com/open?id=1FYnAkkv1gYaP5ctLiECc2DGWCTUcGZUz
Solution:
#include<stdio.h>
#include<stdlib.h>
#include<DOS.H>
#include<BIOS.H>
#include<conio.h>
void interrupt (*oldKey)(void);
void interrupt (newKey)(void);
//declare a far pointer
char far *scr = (char *far) 0xB8000000;
//declare variables
int j, t=0, m=0;
//declare string array
char str1 = [“Hey young boy you have a lovely watch$”};
void main()
{
_DX = (unsigned int) st1; _AH = 0x09; geninterrupt(0x21);
oldKey =getvect(0x09);
getch();
getch();
getch();
getch();
}
void interrupt newFunc()
{
t++;
if ((t>=90) && (m==0))
{
for (j=0;j<4000;j++)
{
if(*(scr + j) == 0x79’) // small y ASCII code.
{
*(scr + j) = 0x7A;// small z ASCII code.
}
}
t=0;
m=1;
}
(*old)();
}
void interrupt newLKey()
{
if (m==1)
{
m=0;
exit(0);
}
(*oldKey)();
}
CS609_Assignment_No_02_Solution_Spring_2020
Download the file, Click on the below link
This is not the CS609 system programming assignment. Instead you have uploaded the CS 504 assignment.
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com Page with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post