Friday, 31 December 2010

Read the following lines of code. It will read the mask register from port 0x21 and then set the 1st bit in the register. As soon as it is written back to port 0x21; IRQ 0 which is derived by a timer device will be disabled

Question#2

Read the following lines of code. It will read the mask register from port 0x21 and then

set the 2nd bit in the register. As soon as it is written back to port 0x21; Keyboard will be

disabled that is connected to IRQ1.

in al, 0x21 ; read interrupt mask register

or al, 2 ; set bit for IRQ1

out 0x21, al ; write back mask register

Take out line 2 i.e.

or al, 2

modify it to solve the following parts

1. set bit to disable IRQ7

Sol:

or al, 128



2. set bit to disable IRQ0

Sol:

or al, 1

3. set bit to disable IRQ5

Sol:

or al, 32

4. enable IRQ1, IRQ2, IRQ7 and disable the rest.

Sol:

and al, 0 // first enable all to get desired result

or al, 121 // disable IRQ0, IRQ3, IRQ4, IRQ5, IRQ6

5. enable all IRQs

Sol:

and al, 0


Question#1


Rea


Question#2

Read the following lines of code. It will read the mask register from port 0x21 and then

set the 2nd bit in the register. As soon as it is written back to port 0x21; Keyboard will be

disabled that is connected to IRQ1.

in al, 0x21 ; read interrupt mask register

or al, 2 ; set bit for IRQ1

out 0x21, al ; write back mask register

Take out line 2 i.e.

or al, 2

modify it to solve the following parts

1. set bit to disable IRQ7

Sol:

or al, 128

2. set bit to disable IRQ0

Sol:

or al, 1

3. set bit to disable IRQ5

Sol:

or al, 32

4. enable IRQ1, IRQ2, IRQ7 and disable the rest.

Sol:

and al, 0 // first enable all to get desired result

or al, 121 // disable IRQ0, IRQ3, IRQ4, IRQ5, IRQ6

5. enable all IRQs

Sol:

and al, 0

d the following lines of code. It will read the mask register from port 0x21 and then


set the 2nd bit in the register. As soon as it is written back to port 0x21; Keyboard will be


disabled that is connected to IRQ1.


in al, 0x21 ; read interrupt mask register


or al, 2 ; set bit for IRQ1


out 0x21, al ; write back mask register


Take out line 2 i.e.


or al, 2


modify it to solve the following parts


1. set bit to disable IRQ7


Sol:


or al, 128


2. set bit to disable IRQ0


Sol:


or al, 1


3. set bit to disable IRQ5


Sol:


or al, 32


4. enable IRQ1, IRQ2, IRQ7 and disable the rest.


Sol:


and al, 0 // first enable all to get desired result


or al, 121 // disable IRQ0, IRQ3, IRQ4, IRQ5, IRQ6


5. enable all IRQs


Sol:


and al, 0



0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More