Assignment No. 8

Write a TSR program in 8086 ALP to implement Screen Saver. Screen Saver should get activated if the keyboard is idle for 7 seconds. Access the video RAM directly in your routine.

MESS MACRO MSG
MOV AH,09H
MOV DX,OFFSET MSG
INT 21H
ENDM

.MODEL SMALL
.STACK 100H
.DATA
MSG1 DB 10,13,”THE TIME IS=$”
TIME DB “00:00:00$”
.CODE
MOV AX,@DATA
MOV DS,AX
MESS MSG1
MOV BX,OFFSET TIME
CALL GETTIME
MOV AH,09H
MOV DX,OFFSET TIME
INT 21H
MOV AH,4CH
INT 21H

GETTIME PROC NEAR
MOV AH,2CH
INT 21H
MOV AL,CH
CALL CONVERT
MOV [BX],AX
MOV AL,CL
CALL CONVERT
MOV [BX+3],AX
MOV AL,DH
CALL CONVERT
MOV [BX+6],AX
RET
GETTIME ENDP

CONVERT PROC NEAR
MOV AH,0
MOV DL,10
DIV DL
OR AX,3030H
RET
CONVERT ENDP
END

————————————————-OUTPUT————————————————-

Microsoft Windows [Version 6.2.9200]
(c) 2012 Microsoft Corporation. All rights reserved.

C:\Users\Dhokane>d:

D:\>tasm MYTIME.ASM
Turbo Assembler  Version 2.0  Copyright (c) 1988, 1990 Borland International

Assembling file:   MYTIME.ASM
Error messages:    None
Warning messages:  None
Passes:            1
Remaining memory:  476k

D:\>tlink MYTIME.obj
Turbo Link  Version 3.0 Copyright (c) 1987, 1990 Borland International

D:\>MYTIME

THE TIME IS=10:52:48
D:\>

Share Button

Leave a Reply

Your email address will not be published. Required fields are marked *