Hi everybody.
I found a file : display time....
i modify it, the aim make a noise, or a red screen
In version "No TSR" it is ok, but computer must wait.
In version TSR, it is not ok.
I try on cession DOS of Windows XP
Below, the code i used
If somebody have an idea to make it fonctionnal
Best regards
Almas
Note : in UPPER CASES the original code
in lower cases, at left of screen, my lines
; Example, i type "time 11:10:45" then file 1111
; 15 seconds after, i would have a red screen !
Time SEGMENT
ORG 100h
ASSUME CS:Time,DS:Time
Start: JMP short Init
MoveIt: PUSH DS
PUSH ES
PUSH SI
PUSH DI
MOV SI,CS
MOV DS,SI
MOV ES,SI
MOV SI,(OFFSET NewInt1C) + 2 + 5
XOR DI,DI
CLD
MOV CX,Attente-(OFFSET NewInt1C)
REP MOVSB
MOV AX,251Ch
XOR DX,DX
INT 21h
POP DI
POP SI
POP ES
POP DS
NewInt1C PROC
DEC BYTE PTR CS:Attente
JZ MoveIt
PUSH AX
PUSH BX
PUSH CX
PUSH DX ; lors de l'int 1A, DL = DaylightBROL ..=> DL=
buffer
PUSH ES
PUSH DI
CLD ; on affiche par addr video croissante (cnf CST)
MOV ES,AX
MOV AH,2
INT 1Ah ; get RTC value (HH-MM-SS in BCD !!!)
MOV BX,CX ; CX = count
MOV AL,BH ; heures
MOV CL,4 ; attention : il est utilise 3 fois !!!
SHR AL,CL ; clear lower nibble
OR AL,30h
mov ah,al
MOV AL,BH
AND AL,0Fh ; keep lower nibble
OR AL,30h
cmp ax, [offset heure]
jne again
MOV AL,BL ; minutes
SHR AL,CL
OR AL,30h
mov ah,al ;
MOV AL,BL
AND AL,0Fh
OR AL,30h
cmp ax, [offset minute]
jne again
mov ax,1000h
mov bx,0400h ; make red back ground
int 10h
again:
POP DI
POP ES
POP DX
POP CX
POP BX
POP AX
DB 0EAh ; opcode d'un jump far,direction l'ancien gestionnaire
Int1COfs DW ?
Int1CSeg DW ?
heure dw: ,0 ; hour
minute dw: ,0
NewInt1C ENDP
Attente DB 5 ; 5/18 sec d'attente !!! wait 1/4 of second
; hey DOS , cut here !!!
Init:
mov si,82h ; suppose i type " file.com 1111 " (hour=11 minute=11)
lodsw
mov [offset heure], ax
lodsw
mov [offset minute], ax
CLI ; let me work
MOV AX,351Ch
INT 21h ; get int 1C vector (timer)
MOV Int1COfs,BX
MOV Int1CSeg,ES
MOV AX,251Ch
MOV DX,OFFSET NewInt1C
INT 21h ; timer
PUSH CS
POP ES
MOV ES,WORD PTR ES:2Ch ; seg de l'envir contenu dans
PSP
MOV AH,49h
INT 21h ; free environnement memory !!!
STI ;
MOV AX,3100h
lea dx, init
shr dx, 4
inc dx ; MOV DX,8 ; Cut PSP !!!
INT 21h ; rester resident
; Copyright DB 13,10,'Time! 3.4 - Coded By Sam In 1994 - The Flamoots $'
Time ENDS
END Start


|