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

Write a Terminate andStay Resident program in Assembly language to change thebac

ID: 3612049 • Letter: W

Question

Write a Terminate andStay Resident program in Assembly language to change thebackground color of DOS-screen after every ten seconds. You willneed to hook timer interrupt (real time interrupt) for thispurpose.

Hint:

Within the interrupt timer routine, you can use timer tick count to determine therequired time (ten seconds) and then call the clrscr routine. Modify theclrscr routine suchthat instead of setting the background color to black, add somevalue to the attribute byte every time interrupt timer routinecalls 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    ;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

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