Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.

Semester: Fall 2019

CS609: System Programming

Graded

Assignment No. 02

Total Marks: 20

 

Due Date:Dec02, 2019

 

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 ofSystem Programming concepts including:

 

·         How can interrupts be generated

·         What are Interrupts

·         Interrupt functions writing

·         TSR program

·         Calling interrupt functions

 

 

 

 

 

 

For any assignment related query, contact at

cs609@vu.edu.pk

 

Problem Statement:

You are required to write C programwhich will display one ‘*’ characteron the screen on each CPU timer interrupt 8 in a way that each * character is displayed after the previous *. i.e

********************************************

 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 *********

This process should be continued again and again until you press any key from the keyboard.

Instructions:

1)     You should include all related header files first of all then declare interrupt pointer to hold Timer i.e void interrupt (*oldTimer)(void);

2)     Similarly, give prototype for new functions of newtimer()i.e void interrupt newTimer();

3)     Declare a far pointer i.e *scr to hold far address =0xB8000000;

4)     Store current vector values of INT 8 through getvect in oldTimer.

5)     Set newTimer fuctions through setvect.

6)     In newTimer() function, give logic to print ‘*’ on the screen i.e *(scr+i)=0x2A;

7)     Write code to wait for 7 seconds i.e t>=126and through loop write blank spaces on the screen by  setting keyboard status with black background i.e no character on screen i.e

*(scr+i)=ox20;

*(scr+i+1)=ox07;

8)     When any key is pressed from the keyboard, the program should stop.

Note:Your assignment should Word file (.doc or .docx) containing your code.

 

Best of Luck!

 

Views: 1998

Attachments:

Replies to This Discussion

CS609_Assignmnet_2_Solution

below link 

CS609_Assignmnet_2_Solution.txt

Tariq bhai sahi solution upload kro please

Please right solution upload kro. 

void interrupt (*oldTimer)(void);
void interrupt (*oldKey)(void);
void interrupt newTimer();
void interrupt newKey();
char far *scr = (char *far) 0xB8000000;
int i, t=0, m=0;
void main()
{
clrscr();
oldTimer = getvect(8);
oldKey =getvect(9);
setvect(8,newTimer);
setvect(9,newKey);
getch();
}

void interrupt newTimer()
{
t++;
if (t<=126) { for(i=0;i<=t;i+=2) { *(scr+i)=0x2A; } } if(t>=126)
{
for(i=0;i<=4000;i+=2) { *(scr+i)=0x20; *(scr+i+1)=0x07; } t=0; m=1; } (*oldTimer)(); } void interrupt newKey() { if (m==1) { m=0; exit(0); } (*oldKey)(); }

CS609 Assignment No 02 Solution:

#include<stdio.h>
#include<stdlib.h>
#include<DOS.H>
#include<BIOS.H>
#include<conio.h>
void interrupt (*oldTimer)(void);
void interrupt (*oldKey(void);
void interuupt newTimer();
void interrupt (newKey(void);
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>=126) && (m==0))
{
for (i=0;i<4000;i++)
*(scr+i)=0x2A;
for(i=0;i<=4000;i+=2)
{
*(scr+i)=0x20;
*(scr+i+1)=0x07;
}
t=0;
m=1;
}
(*oldTimer)();
}
void interrupt newLKey()
{
if (m==1)
{
m=0;
exit(0);
}
(*oldKey)();
}

RSS

Looking For Something? Search Below

Latest Activity

Profile IconAqsa Noor, Noman Ali and Anum Mughal joined Virtual University of Pakistan
6 minutes ago
Sara replied to MEHMOOD QADIR's discussion Research Paper
11 hours ago
Sara replied to MEHMOOD QADIR's discussion Research Paper
11 hours ago
Simona replied to MEHMOOD QADIR's discussion Research Paper
11 hours ago
Simona replied to Sara's discussion write my dissertation cheap
11 hours ago
Sara posted a discussion
12 hours ago
Fakhir replied to иαвєєℓ αнмє∂'s discussion Kya hal hain ning awam?
20 hours ago
Nida Arshad Javaid Ch posted photos
22 hours ago

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

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