CS609 Assignment 3 Solution and Discussion
-
Semester: Fall 2019
CS609: System Programming
Graded
Assignment No. 03 Total Marks: 20Due 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 delayFor any assignment related query, contact at [email protected]
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.
Solution:
Best of Luck!
-
#include <dos.h> #include <conio.h> char st [80]; int SendKbdRate(unsigned char data , int maxtry) { unsigned char ch; do { do { ch=inport(0x64); }while (ch&0x02); outport(0x60,data); do { ch = inport(0x64); }while (ch&0x01); if (ch==0xfa) { puts("success\n"); break; } maxtry = maxtry - 1; } while (maxtry != 0); if (maxtry==0) return 1; else } return 0; void main () { //clrscr(); SendKbdRate(0xf3,3); SendKbdRate(0x68,3); gets(st); }