We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>


Looking For Something at vustudents.ning.com? Click Here to Search

Assignment

 

Question 1                                                                                                                                                                              (05 Marks)

Write Code of following in c.

1-      Connect interval timer to speaker and turned it on

2-      Turn off speaker by clearing least significant bits.

 

Question 2:                                                                                                                                            (10 Marks)

 

Write down a TSR program that disables the input of characters ‘b’ and ‘c’ from keyboard.

Scan codes of  'b' and 'c' are given below:

 ‘b’ = 0x30

‘c’ = 0x2E.

 

 

NOTE: Do not worry about the output and just concentrate on logic. There should be no error in your program. Do not put any query on MDB about this assignment, if you have any query then email at cs609@vu.edu.pk.

 

 

 

 

+ Click Here To Join also Our facebook study Group.

..How to Join Subject Study Groups & Get Helping Material?..


See Your Saved Posts Timeline

Views: 6538

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Attachments:

Replies to This Discussion

Aj to Had Ho Gai

cs609 assignment 2

Attachments:

HAFIZ SHAFAQAT BSCS 7  thanks for sharing 

Note for All Members: You don’t need to go any other site for this assignment/GDB/Online Quiz solution, Because All discussed data of our members in this discussion are going from here to other sites. You can judge this at other sites yourself. So don’t waste your precious time with different links.

CS609 ASSIGNMENT 2 SOLUTION FALL 206

Assignment CS 609

Q.no 1

Write Code of following in c.
1-      Connect interval timer to speaker and turned it on
2-      Turn off speaker by clearing least significant bits.

Solution

//Program loads advisor value of 0x21FF
//Turns ON the speaker and connects it to Interval Timer
#include<BIOS.H>
#include<DOS.H>
void main()
{
outportb (0x43,0xB4);
outportb (0x42,0xFF);
outportb (0x42,0x21);
outportb (0x61,inportb(0x61); |3);
getch();
outportb (0x61,inportb(0x61) & 0xFC);
}


Q.no.2
Write down a TSR program that disables the input of characters ‘b’ and ‘c’ from keyboard.
Scan codes of  'b' and 'c' are given below:
 ‘b’ = 0x30
‘c’ = 0x2E.

Solution
#include<dos.h> 
#include<bios.h>
unsigned char far * scr= (unsigned char far *)0x00400017; //Keyboard status byte
void interrupt (*oldint15) ( );
void interrupt newint15 (unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned intIP,unsignedint flags);
void main ( )
{
oldint15 = getvect (0x15);
setvect (0x15, newint15);
keep (0, 1000);
}
void interrupt newint15( unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP, unsigned int flags)
{
if (_AH == 0x4F) 

if ((_AL == 0x1F) && ((*scr) & 0x0c)) //Check for Alt+Ctrl+S

outport (0x43, 0xB4); 
outport (0x42, 0xFF); 
outport (0x42, 0x21);
outport (0x61, inport(0x61) | 3); //Connect to interval timer and and turn the speaker on
}
if (_AL == 0x18) //Check for character 'O' 

outport (0x61, inport(0x61) & 0xFC); //Turn the speaker off
}
}
else
(*oldint15) ( ); 
}

sir second wala question nhi sahi first wala to ho gya ha please help in 2nd question

Q2 ka solution ?????

CS609 ASSIGNMENT 2 SOLUTION FALL 206

Attachments:

plz c format ma files  upload kr dein ...nhi chl raha borland.

cs609 idea solution assignment 2

Question # Complete Idea Solution:

#include
#include
unsigned char far * scr= (unsigned char far *)0x00400017; //Keyboard status byte
void interrupt (*oldint15) ( );
void interrupt newint15 (unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP,unsigned int flags);
void main ( )
{
oldint15 = getvect (0x15);
setvect (0x15, newint15);
keep (0, 1000);
}
void interrupt newint15( unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP, unsigned int flags)
{
if (_AH == 0x4F)
{
if ((_AL == 0x1F) && ((*scr) & 0x0c))
{
outport (0x43, 0xB4);
outport (0x42, 0xFF);
outport (0x42, 0x21);
outport (0x61, inport(0x61) | 3); //Connect to interval timer and and turn the speaker on
}


if (_AL == 0x18) //Check for character 'O'
{
outport (0x61, inport(0x61) & 0xFC); //Turn the speaker off
}
}
else
(*oldint15) ( );
}


Q1 's Answer is on Page#6

cs609 assignment 2 By HAFIZ SHAFAQAT BSCS 7 

Attachments:

thnx sir

Cs609 idea solution

Question # Complete Idea Solution:

#include
#include
unsigned char far * scr= (unsigned char far *)0x00400017; //Keyboard status byte
void interrupt (*oldint15) ( );
void interrupt newint15 (unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP,unsigned int flags);
void main ( )
{
oldint15 = getvect (0x15);
setvect (0x15, newint15);
keep (0, 1000);
}
void interrupt newint15( unsigned int BP, unsigned int DI, unsigned int SI, unsigned int DS, unsigned int ES, unsigned int DX, unsigned int CX, unsigned int BX, unsigned int AX, unsigned int CS, unsigned int IP, unsigned int flags)
{
if (_AH == 0x4F)
{
if ((_AL == 0x1F) && ((*scr) & 0x0c))
{
outport (0x43, 0xB4);
outport (0x42, 0xFF);
outport (0x42, 0x21);
outport (0x61, inport(0x61) | 3); //Connect to interval timer and and turn the speaker on
}


if (_AL == 0x18) //Check for character 'O'
{
outport (0x61, inport(0x61) & 0xFC); //Turn the speaker off
}
}
else
(*oldint15) ( );
}

RSS

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

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