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

Q. Write a Terminate and Stay Resident program inAssembly language to change the

ID: 3612001 • Letter: Q

Question

Q. Write a Terminate and Stay Resident program inAssembly language to change the background color of DOS-screenafter every ten seconds. You will need to hook timer interrupt(real time interrupt) 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.

Microsoft Word document containing:

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    ;lower right 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

I hope this will helps you!!!!!!!!