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

These are assembly language questions please help me out inthese Question_1: The

ID: 3612208 • Letter: T

Question

These are assembly language questions please help me out inthese

Question_1: The following codereads port 0x21 (interrupt mask register) of PIC (ProgrammableInterrupt Controller), sets the 2nd bit that is mapped to IRQ1 andwrites it back to port 0x21. As a result keyboard interrupt will bedisabled as IRQ1 is used by keyboard.  

; disable keyboard interrupt in PIC mask register

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          ; terminateprogram

06                   int 0x21

Modify instruction_03 for the following:

             I.      set bit for IRQ0

           II.      set bit for IRQ6

         III.      set bits for IRQ1, IRQ3 andIRQ4

         IV.      clear bit for IRQ5

           V.      clear bits for IRQ2, IRQ5, IRQ6and IRQ7

Question_2: Suggest a reason forthefollowing:                                                              

             I.      We should disable interrupts whilehooking interrupt 8h, i.e. while placing its segment and offset inthe interrupt vector table.

           II.      We need not do this for interrupt80h.

Explanation / Answer

Question 1: 1. Set bit to disable IRQ0                               IN AL, 21H                   ; Read interruptmaskregister
                              OR AL , 1                      ; set bit 1                               OUT 20H , AL               ; modify the interrupt mask register 2. Set bit to disable IRQ6                                                IN AL, 21H                   ; Read interruptmaskregister
                               OR AL , 10000000B      ; set bit 6                                OUT 21H , AL               ; modify the interrupt maskregister 2. Set bit to disable IRQ6                                                IN AL, 21H                   ; Read interruptmaskregister
                               OR AL , 10000000B      ; set bit 6                                OUT 21H , AL               ; modify the interrupt maskregister 2. Set bit to disable IRQ6                                                IN AL, 21H                   ; Read interruptmaskregister
                               OR AL , 10000000B      ; set bit 6                                OUT 21H , AL               ; modify the interrupt maskregister                                 4.   Set bit to disableIRQ5                                    IN AL, 21H                   ; Read interruptmaskregister
                              OR AL , 5                      ; set bit 1                               OUT 21H , AL               ; modify the interrupt maskregister Question 2: Inorder to hook any interrupt we need to disable remaininginterrupts.But comming to interrupt 80h as it is a defaultinterrupt handler has the irritating behavior of switching the RealTime Clock interrupt off after a time-out expires i.e doesn't needoffset in the interrupt vector table . Hope this will helpyou..
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