Metropoli BBS
VIEWER: time39!.asm MODE: TEXT (CP437)
; But du programme : affichage permanent de l'heure à l'ecran.
; ------------------
;
; Une fois le programme mis en memoire (64 octets !!!) : il y reste !!! :)
; La couleur de l'affichage ainsi que la position a l'ecran est parametrable.
;
; Rem : ce prg. s'alloue un bloc de memoire, copie la routine TIMER dedans
;       puis se termine normalement ... (presque !!!)
;
; pour toute remarque/commentaire essayez : 0032-02/374-66-57 (demandez Michel) 
; ou mon E-mail (internet) : mderie@is1.vub.ac.be ... CU SOON IN IRC (#Pendu Sam_) ...
;
; Pour recompiler : ml /AT time39!.asm ...
;
; Valeur par defaut des differents parametres :

Couleur EQU 1Fh         ; Blanc sur fond bleu
VideoBaseAdr EQU 0B800h ; attention pour les cartes hercule : 0B000h !!!
Ligne EQU 1             ; de 1 a 25 ...
Colonne EQU 76          ; de 1 a 80 ... rappel : six caracteres a afficher
Separateur EQU 3Ah ; ':'

Time               SEGMENT
                   ORG 100h
                   ASSUME CS:Time,DS:Time
                   .186 ; !!! fonctionnera sur les XT de l'unif !!!

Start:             JMP Init ; Classique !

NewInt1C PROC
                   PUSHA

                   CLD ; on affiche par addr video croissante
                   MOV AX,VideoBaseAdr ; Cst.
                   MOV ES,AX
                   MOV DI,(Ligne-1)*160+(Colonne-1)*2 ; adr video !!!

                   MOV AL,4
                   OUT 70h,AL
                   IN AL,71h ; heure DEJA EN BCD !!!
                   MOV CH,AL
                   MOV AH,Couleur ; attention reste pendant tout le programme !
                   MOV CL,4 ; attention : il est utilise 2 fois !!!
                   SHR AL,CL
                   OR AL,30h
                   STOSW

                   MOV AL,CH
                   AND AL,0Fh
                   OR AL,30h
                   STOSW

                   MOV AL,Separateur
                   STOSW

                   MOV AL,2
                   OUT 70h,AL
                   IN AL,71h ; minute
                   MOV CH,AL
                   SHR AL,CL
                   OR AL,30h
                   STOSW

                   MOV AL,CH
                   AND AL,0Fh
                   OR AL,30h
                   STOSW

                   POPA

                   DB 0EAh ; opcode d'un jump far,direction l'ancien gestionnaire
Int1COfs           DW ?
Int1CSeg           DW ?

NewInt1C           ENDP

; hey DOS , cut here !!!

Init:              CLI ; foutez moi la paix ...

                   MOV AX,351Ch
                   INT 21h ; get int 1C vector (timer)
                   MOV Int1COfs,BX
                   MOV Int1CSeg,ES

                   MOV AH,9
                   MOV DX,OFFSET Copyright
                   INT 21h ; qui a code ce truc ? 8-)

                   MOV AH,4Ah
                   MOV BX,16+14
                   PUSH DS
                   POP ES
                   INT 21h ; mshrink

                   MOV AH,48h
                   MOV BX,4
                   INT 21h ; demander un bloc de 64 octets

                   MOV ES,AX ; seg retourne par l'int
                   DEC AX

                   MOV SI,OFFSET NewInt1C
                   XOR DI,DI
                   MOV CX,Init-(OFFSET NewInt1C) ; taille de la routine (63 !)
                   CLD
                   REP MOVSB

                   MOV ES,AX
                   MOV WORD PTR ES:[1],0FFFFh ; changer le owner du MCB !!!

                   XOR DX,DX
                   INC AX
                   MOV DS,AX
                   MOV AX,251Ch
                   INT 21h ; detourner le timer

                   STI ; heheh

                   MOV AX,4C00h
                   INT 21h ; fin du prg !!!

Copyright          DB 13,10,'Time! 3.9 - Coded By Sam In 1994 - The Flamoots Production - 64 Bytes In Memory!$'

Time               ENDS
                   END Start
[ RETURN TO DIRECTORY ]