pusha macro ;macro to push
pushf ;all registers
push ax
push bx
push cx
push dx
push si
push di
push ds
push es
endm
popa ;macro to pop
pop es ;all program
pop ds
pop di
pop si
pop dx
pop cx
pop bx
pop ax
popf
endm
captureint macro intno,saveint,subroutine ;macro to make
cli ;prog resident
mov ah,35h ;to get vector
mov al,intno ;address
int 21h
mov word ptr saveint,bx
mov word ptr saveint+2,es
mov ah,25h ;to set vector
mov al,intno ;vector address
lea dx,subroutine
int 21h
endm
.model tiny
.code
org 0100h ;origin
begin:jmp init
oldint5 dd ?
saveint8 dd ?
saveint9 dd ?
str1 db "A",06,"I",07,"T","06"
count db 0
keyboard:
pusha
mov cs:count,0 ;always initialise count to zero
mov ah,05h ;BIOS call to activate
mov al,00h ;the original page(00) instead
int 10h ;of screensaver page(01)
popa
jmp cs:saveint9
timer:
pusha
cmp cs:count,126 ;compare count with 126 (7sec delay)
jbe exit8
mov ah,05h ;BIOS call to activate
mov al,01h ;screen saver page(01)
int 10h
mov ax,cs
mov ds,ax
mov ax,0b900h ;address of screensaver page (page1)
mov es,ax
lea si,str1
mov di,1980 ; offset to display message
mov cx,6 ;string length
rep movsb ;string displayed byte by byte
jmp next
exit8: inc cs:count
next: popa
jmp cs:saveint8
init: cli ;clear interrupt
captureint 8,saveint8,timer ;to get &set vector
captureint 9,saveint9,keyboard ;address of timer&keyboard
mov ah,31h ;to make program resident
lea dx,init
sti ;set interrupt
int 21h
i have tried to search on google about it and fixed some mistakes i have only this mistake now "INT 21H, AH=031H - Not supported yet"