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

i work IAPX88 according to Write a Terminate and Stay Resident program in Assemb

ID: 3611835 • Letter: I

Question

i work IAPX88 according to

Write a Terminate and Stay Resident program in Assemblylanguage to change the background color of DOS-screen after everyten seconds. You will need to hook timer interrupt (real timeinterrupt) for this purpose.

Hint:

Within the interrupt timer routine, you can use timer tickcount to determine the required time (ten seconds) and thencall the clrscr routine. Modify the clrscrroutine such that instead of setting the background color to black,add some value to the attribute byte every time interrupt timerroutine calls it.

Explanation / Answer

; This program

display EQU xxxxh

Screen EQU 0600h

delay1 EQU 10

.code

main PROC

         in  ax, Screen ; get screen status

         pushax            ; save status

        mov     dx,184Fh    ; lowerright corner (24,79)

        mov    bh,7        ; normalattribute

        int      10h         ; callBIOS

        mov    ah,2        ; locate cursor at0,0

        mov     bh, 0x7920 ; ASCII write green asforeground

L2:  out     display,ax ;

           ;create a delay loop between

        mov cx,delay1

L3:   pushcx          

L3a:

         loop L3a

         pop cx

         loop l3

         sub al,1                 ;raise time 1 sec

         jnz L2                  

         pop ax

         exit

main ENDP

END main