CS609 System Programming Assignment No 02 Spring 2021 Solution / 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.
CS609 Solution file
Cs609 Assignment 2 Solution 2021
Mov 0x178, al;
Outb al, 0xA0;
Outb al, 0x21;
Add 0x70, al;
In al, 0x21
Or al, 2;
Out 0x21, al;
In al, 0x21Al
Or al,2 ;
Out 0xAl, al;
Mov ax, 0x4c00;
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.
CS609: System Programming Assignment No. 02
Total Marks: 15
3rd June 2021
QUESTION 1: Cascading Two PICs in Master-Slave Formation (10 MARKS)
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
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
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---