Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

: Thefollowing code reads port 0x21 (interrupt mask register) of PIC(Programmabl

ID: 3612305 • Letter: #

Question

: Thefollowing code reads port 0x21 (interrupt mask register) of PIC(Programmable Interrupt Controller), sets the 2nd bit that ismapped to IRQ1 and writes it back to port 0x21. As a resultkeyboard interrupt will be disabled as IRQ1 is used bykeyboard.                                 

; disable keyboard interrupt in PIC maskregister

01       [org 0x0100]

02                   in al, 0x21                ; read interrupt mask register

03                   or al, 2                      ; set bit for IRQ1

04                   out 0x21, al            ; write back mask register

05                   mov ax, 0x4c00      ;terminate program

06                   int 0x21

             I.     set bits for IRQ1, IRQ3 and IRQ4

          II.     clear bit for IRQ5

        III.     clear bits for IRQ2, IRQ5, IRQ6 and IRQ7

Explanation / Answer

                              IN AL, 21H                   ; Read interrupt mask register
                              OR AL , 1                      ; set bit 1

                              OUT 20H, AL               ; modify the interrupt mask register

Set bit to disable IRQ6

               

                               IN AL, 21H                   ; Read interrupt mask register
                               OR AL , 10000000B      ; set bit 6

                               OUT 21H, AL               ; modify the interrupt mask register

                               

Set bit to disable IRQ5      

                             IN AL, 21H                   ; Read interrupt mask register
                              OR AL , 5                      ; set bit 1

                              OUT 21H, AL               ; modify the interrupt mask register

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote