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

CS609 System Programming Assignment No 02 Spring 2020 Solution & Discussion Due Date: 11-06-2020

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:

  1. 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
    char str1[80]={“ “Hey young man, you have a lovely watch”$”}
    void interrupt (*old)(void);
  2. Similarly, give prototype for new functions of i.e
    void interrupt newfunc();
  3. Declare a far pointer i.e *scr to hold far address =0xB8000000
  4. Store current vector values of INT 8 through getvect in old().
  5. Set newFunc() fuctions through setvect.
  6. In newFunc() function, give logic to wait for 5 seconds i.e t>=90
  7. Replace y character to z i.e
    for ( int j = 0; j < 4000; j += 2) {
    if(*(scr + j) == 0x79’) // small y ASCII code.
    *(scr + j) = 0x7A;// small z ASCII code.

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).


+ 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: 945

Replies to This Discussion

Learn CS609 System Programming with Washi - Solution of Assignment 2 Spring 2020

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 all related header files

 

#include<stdio.h>

#include<stdlib.h>

#include<DOS.H>

#include<BIOS.H>

#include<conio.h>

 

 

  • declare interrupt pointer to hold old void interrupt (*old)(void);

void interrupt (*oldKey)(void);

 

 

  • prototype for new functions of newFunc() void interuupt newFunc();

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()

{

 

  • Display string on screen by calling int21h. clrscr(); //to clear the screen contents

 

_DX = (unsigned int) st1; _AH = 0x09; geninterrupt(0x21);

 

  • Store current vector values of INT 8 through getvect in old() old = getvect(0x08);

 

oldKey =getvect(0x09);

 

  • Set newFunc() fuctions through setvect setvect(0x08,newFunc); setvect(0x09,newKey);

 

getch();

getch();

getch();

getch();

}

void interrupt newFunc()

{

t++;

 

  • wait for 5 seconds

 

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)();

}

 

  • Any key is pressed from the keyboard, the program stop

 

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

CS609_Assignment_No_02_Solution_Spring_2020

This is not the CS609 system programming assignment. Instead you have uploaded the CS 504 assignment.

CS609 Assignment 2 Solution

link below 

CS609 Assignment 2 Solution

RSS

Latest Activity

+ ! ! JS ! ! + liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
1 hour ago
Hafiza Tehreem Fatima posted a discussion
1 hour ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
1 hour ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MTH633 Group Theory Assignment 01 Fall 2020 Solution / Discussion in the group MTH633 Group Theory
1 hour ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC401 Cultural Anthropology Assignment 01 Fall 2020 Solution / Discussion in the group SOC401 Cultural Anthropology
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC401 Cultural Anthropology Assignment 01 Fall 2020 Solution / Discussion in the group SOC401 Cultural Anthropology
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion SOC401 Cultural Anthropology Assignment 01 Fall 2020 Solution / Discussion in the group SOC401 Cultural Anthropology
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion ECO406 Assignment 01 Fall 2020 Solution / Discussion Due Date: 04-12-2020 in the group ECO406 Mathematical Economics
2 hours ago
+M.Tariq Malik liked +M.Tariq Malik's discussion MCM520 Contemporary Mass Media Assignment 01 Fall 2020 Solution / Discussion
2 hours ago
+M.Tariq Malik added a discussion to the group MCM520 Contemporary Mass Media
2 hours ago
Profile IconMalik Ali Raza, Zohaib Anjum, Arooj Shahid and 12 more joined Virtual University of Pakistan
2 hours ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
2 hours ago
+M.Tariq Malik replied to Muhammad Azeem's discussion BNK603 Consumer Banking Assignment No 01 Solution & Discussion FALL 2020 in the group BNK603 Consumer Banking
2 hours ago
+M.Tariq Malik liked Muhammad Azeem's discussion BNK603 Consumer Banking Assignment No 01 Solution & Discussion FALL 2020
2 hours ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion CS302 Assignment 01 Fall 2020 Solution / Discussion in the group CS302 Digital Logic Design
2 hours ago

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

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

.