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.

CS609 System Programming Assignment No 02 Spring 2021 Solution / Discussion

Views: 541

Replies to This Discussion

Share the Assignment Questions & Discuss Here.... 

Stay touched with this discussion, Solution idea will be uploaded as soon as possible in replies here before the due date.

Solution of Assignment 2 of CS609 Spring 2021 of System Programming 

Cs609 Assignment 2 Solution 2021

 

Question

Solution

Code

Mov 0x178, al;

Outb al,0x20;

Outb al, 0xA0;

 

Mov 0x80,al;

Outb al, 0x21;

Add 0x70, al;

Outb al,0xAl;

 

In al, 0x21

Or al, 2;

Out 0x21, al;

 

In al, 0x21Al

Or al,2          ;

Out  0xAl, al;

Mov ax, 0x4c00;

Int0x21

 

Question 2

Solution

AH=30H

Printer Status=?

 

The Status of  the  printer can be described in the manner to check if the printer can perform printing or not .in this  AH is 30.it means the  5th  bit of the status  byte is 1 which tells that  the printer is out of paper and printer  could not be accessed.

 

 

Spring 2021

CS609: System Programming Assignment No. 02

Total Marks: 15

 

Due Date:

3rd June 2021

 

 

 

 

 

 

QUESTION 1: Cascading Two PICs in Master-Slave Formation                        (10 MARKS)

 

 

 

 Answer:

Step 1: Send ICWI to both master and slave PICs at their respective ports.

mov 0x378,al                            ; We can only output %a1 to I/O ports, not immediate values

outb a1, 0x20                            ; Send $0x378 to the master PIC

outb al, 0xAO                            ; send $ 0x378 to the slave PIC

 

Step 2: Set base address of first interrupt as 80h for master PIC and 70h for slave PIC

mov 0x80, al

outb al,0x21                              ; Set the master PIC’s base offset to 80

add 0x70,al

outb al, OxAI                              ; Set the slave PIC’s base offset to 70

 

Step 3: Send information to both Master and Slave PICs that they are connected via IRQ 2 line.

In al 0x21                                    ; read interrupt mask register

or al, 2                                         ; set bit for IRQ 2

out 0x21, al                                ; writeiback mask register mov ax, Ox4c00 ; terminate

program int Ox21

 

 _____________________________________________________________________________

Question 2: Reading Status of a Printer     

                                                              (5 MARKS)

______________________________________________________________________________

Answer:

AH = 30H

Printer status =?

The status of the printer can be described in the manner to check if the printer can perform printing or not. In this case AH is 30H, it means the 51 bit of the status byte is 1 which tells that the printer is out of paper and printer could not be accessed.

 

 

 

 

---BEST OF LUCK---

 

 

 

RSS

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

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