Re: CS609 Assignment 2 Solution and Discussion
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:
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);
Similarly, give prototype for new functions of i.e
void interrupt newfunc();
Declare a far pointer i.e *scr to hold far address =0xB8000000
Store current vector values of INT 8 through getvect in old().
Set newFunc() fuctions through setvect.
In newFunc() function, give logic to wait for 5 seconds i.e t>=90
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).
Semester: Spring 2020
CS609: System Programming
Graded
Assignment No. 01 Total Marks: 20
Due Date: May 27, 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:
• Basic interrupts
• Invoking interrupts
• Register Values
For any assignment related query, contact at CS609@vu.edu.pk
Problem Statement:
Q: Write C program to switch on any one of the toggle button i.e Caps Lock, Scroll Lock and Num Lock by taking any one input i.e 1,2 and 3 respectively. Using Switch Case Statement, switch on the appropriate toggle button and show message for that button. For example if the user enter 3 then Num Lock should be on and message should be displayed “Num Lock is On”
Store all the following 5 lines of strings in 5 array st1,st2,st3, st4, st5 and through interrupt 65H print proper message i.e
Which toggle button you want to switch on:
Press 1 for Caps Lock
Press 2 for Scroll Lock
Press 3 for Num Lock
Press Key(1/2/3):
Instructions:
Include all header files and declare 5 string arrays for messages.
You should save interrupt 65H vector in a pointer to vector variable name oldint65 through getvect instruction.
Call any new function i.e newint65( ) through setvect instruction.
Then use scanf to take input in an integer variable i.e scanf(“%d”, &i)
Place service number in AH register. Interrupt 65H will check its value and will perform relevant function.
Interrupt 65H function must check for Service Number using Switch Statement.
Use keep() function to make this program TSR.
Note: Your assignment solution will be in this Word file (.doc or .docx)containing code of C
Best of Luck!
Solution:
Total Marks 5
Starting Date Monday, January 27, 2020
Closing Date Tuesday, January 28, 2020
Status Open
Question Title File Organization
Question Description
GDB CS609_Fall 2019
Defragmentation for file organization is time consuming job and system looks halted to some extent during this process. Do you think that overall performance of the system will be degraded ultimately? Put your comments in 3 to 5 lines in either case (Yes/No).
Font: Times New Roman Size: 11
Semester: Fall 2019
CS609: System Programming
Graded
Assignment No. 02 Total Marks: 20
Due Date: Dec 02, 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 of System 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 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
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:
You should include all related header files first of all then declare interrupt pointer to hold Timer i.e void interrupt (*oldTimer)(void);
Similarly, give prototype for new functions of newtimer() i.e void interrupt newTimer();
Declare a far pointer i.e *scr to hold far address =0xB8000000;
Store current vector values of INT 8 through getvect in oldTimer.
Set newTimer fuctions through setvect.
In newTimer() function, give logic to print ‘*’ on the screen i.e *(scr+i)=0x2A;
Write code to wait for 7 seconds i.e t>=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
*(scr+i)=ox20;
*(scr+i+1)=ox07;
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!
Semester: Fall 2019
CS609: System Programming
Graded
Assignment No. 03 Total Marks: 20
Due Date: Jan 09, 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:
• Typematic Rate
• Keyboard typing delay
For any assignment related query, contact at CS609@vu.edu.pk
Problem Statement:
Q: Write a C program that will change the typematic rate of keyboard with delay of 1/4 second and typematic rate of 3 characters per second by using the following information.
[image: AOBdUrh.png]
Solution:
Best of Luck!
Semester: Fall 2019
CS609: System Programming
Graded
Assignment No. 01 Total Marks: 20
Due Date: Nov 11, 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 of System Programming concepts including:
• How can interrupts be generated
• What are Interrupts
• Interrupt functions writing
• BIOS data area.
• TSR program
• Calling interrupt functions
For any assignment related query, contact at
Problem Statement:
You are required to write a C program using interrupt 21H to print 3 string arrays i.e “Virtual University of Pakistan”, your own Student Name and father name. Your program should intercept the timer interrupt to call a function name “ScrollLock” to switch on the ScrollLock on the keyboard when the timer interrupt 8h occurs.
Instructions:
Declare 3 character strings st1,st2,st3 having Values, Virtual University of Pakistan, your own Student Name and Father Name respectively.
In this program, you will implement interrupt 21H to print the character string values on the top.
Place service number 0x09 in AH register and String in DX to print strings.
You should save interrupt 8H vector in a pointer to vector variable name old through getvect() instruction.
Call any new function called i.e ScrollLock( ) through setvect instruction.
Use keep() function to make this program TSR.
Note: Your assignment file should be a single Word file (.doc or .docx)
Please post your current Quiz and Help the Students.
Quiz No.2 Total Questions : 10
Please read the following instructions carefully!
Quiz will be based upon Multiple Choice Questions (MCQs).
You have to attempt the quiz online. You can start attempting the quiz any time within given date(s) of a particular subject by clicking the link for Quiz in VULMS.
Each question has a fixed time of 90 seconds. So you have to save your answer before 90 seconds. But due to unstable internet speeds, it is recommended that you should save your answer within 60 seconds. While attempting a question, keep an eye on the remaining time.
Attempting quiz is unidirectional. Once you move forward to the next question, you can not go back to the previous one. Therefore before moving to the next question, make sure that you have selected the best option.
DO NOT press Back Button / Backspace Button while attempting a question, otherwise you will lose that question.
DO NOT refresh the page unnecessarily, specially when following messages appear
Saving…
Question Timeout: Now loading next question…
Javascript MUST be enabled in your browser; otherwise you will not be able to attempt the quiz.
If for any reason, you lose access to internet (like power failure or disconnection of internet), you will be able to attempt the quiz again from the question next to the last shown question. But remember that you have to complete the quiz before expiry of the deadline.
If any student failed to attempt the quiz in given time then no re-take or offline quiz will be held.
Start Quiz
GDB CS609_Spring 2019
Dear Students,
A Graded Discussion has been updated for your course CS101.
Topic: By increasing the surface area of hard disk there is an increase of data storage. Do you think whether any negative impact of increasing surface area as well? Put your comments in 3 to 5 lines in either case (Yes/No).
Font: Times New Roman Size: 11
Please visit your GDB interface in your LMS to put your comments on the dates 06 August 2019 and 07 August 2019 only.

Semester: Spring 2019
CS609: System Programming
Graded
Assignment No. 01
Total Marks: 20
Due Date: May 13, 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 of System 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 writ C program using interrupt 65H to print your own Student ID, Name or your Study Program depending upon the number input i.e 1,2,3 respectively. When the user enters 1 it will print your own Student ID, if 2 then print your own Name and finally, if the user enters 3, it will print your Study Program.
Instructions:
Declare 3 character strings st1,st2,st3 having Student ID, Name and Study Program
You should save interrupt 65H vector in a pointer to vector variable name oldint65 through getvect instruction.
Call any new function i.e newint65( ) through setvect instruction.
Through printf instruction, show message “What you want to print: Press 1,2,3= ” i.e
printf(“What you want to print: Press 1,2,3= ”);
Then use scanf to take input input in an integer variable i.e scanf(“%d”, &i)
In this program, you will implement interrupt 65H which is currently not used by operating system.
Place service number in AH register. Interrupt 65H will check its value and will perform relevant function.
Interrupt 65H function must check for Service Number using Switch Statement. In Case of Service Number 1, it should print Student ID i.e BC123456 and in case of Service Number is 2, it should print your own full name i.e Ali Ahmad. Similarly your study program i.e BS/MCS etc should be printed in case of number 3.
Use keep() function to make this program TSR.
Note: Your assignment solution will be in this Word file (.doc or .docx) containing code of C only as given in sample solution:
Best of Luck!
Sample Solution:
//Header Files
#include<stdio.H>
#include<BIOS.H>
#include<DOS.H>
#include<conio.H>
void interrupt (*oldint 65)(); //To store current interrupt
char str1[80]={“BC123456$”} // Write your own particulars
char str2[80]={“Ali Ahmad$”}
char str3[80]={“Degree Program: BS$”}
int i;
void interrupt newint65(void); //NewInt prototype
void main()
{
// Keep vector of current INT
//setting to newint65
clrscr();
printf(“What you want to print: Press 1,2,3=>”);
scanf(“%d”,&i);
_AH=i;
getch();
}
void interrupt newint65()
{
switch(i)
{
case 1:
//Service Number
// Register for output.
break;
}
case 2:
break;
}
case 3:
break;
}
default: { }
}
PPI / MPI - What are the real differences?
-
Please explain?
-
All protocols are RS485 based, so that’s why both could be done on single port, the other thing is that MPI is a derivate of DP, PPI is a simpler MPI protocol and made for Point-to-Point communication.
hope that will be helped, if you have still any questions, don’t hesitate to ask me.
-
PPI Stands for?
-
@zaasmi Programmable Peripheral Interface (PPI)


