Accueil > > > JEU DOS POUR APPRENDRE LES TOUCHES DU CLAVIER.
JEU DOS POUR APPRENDRE LES TOUCHES DU CLAVIER.
Information sur la source
Description
Ce programme vous aide à manipuler les interuptions du système. 1- Vous montre une technique en mode texte - comme si on est en mode graphique - pour effacer l'écran. 2- Programme vos propres routines d'intérruptions - ici routine clavier. 3- Sauvegarer l'ancien routines, et la réstorée à la fin du programme. 4- Comment faire la gestion de l'écran. 5- Une téchnique pour faire une animation des caractères. une tombée. et un éclattement. le programme est écrit pour MASM 2.0, et n'includ aucun *.inc trés simple à comprendre.
Source
-
- TOUCH_ESC EQU 129
- TOUCH_FIN EQU 1
- CAPACITE EQU 2*80*25
- ECRAN EQU 0B800H
-
- pile segment stack
- db 32 dup (0)
- pile ends
-
- extra segment
- extra ends
-
- data segment
-
- AUSSI DB 0
- BOOM DB "\|/-\***"
- UNO db "AZERTYUIOP"
- DUE db "QSDFGHJKLM"
- TRE db "WXCVBN"
- TOUMOT db 0
- scoor db 0
- GAME db 13,10,"************ GAME OVER *************|",13,10
- DB " Votre scoor est : $"
- effac db 13,13,13,10," Mon 1Sr jeux",13,10
- db " Aprendre les touches du clavier",13,10
- db " jeux.asm (c) by Madani-2001 $"
- MES_END db " POITS . c'est BON ", 13,10," Merci FIN "
- DB " . Veulez-vous quiter ? (Y/N) $"
- LETTRE DB "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIKLMNOPQRSTUVWXYZ"
- DB "ABCDEFGHIJKLMNOPQRSTUVWYZABCDFGHIJKLMNOPQSTUVWXYZ"
- MOT db ?
- Temps dw 310
- v_al db ?
- v_dl db ?
- colon db ?
- page_cours db ?
- touche db 0
- clavier db 1
- touch_ascii equ this dword
- cent db 30h
- dixenes db 30h
- unit db 30h
- finish db "$"
-
- INT9_PTR equ this dword
- int9_ofs dw 0
- int9_seg dw 0
-
- data ends
-
-
- code segment
- assume cs:code, ds:data, ss:pile, es:extra
- PRINC PROC FAR
- mov ax, data
- mov ds, ax
- mov ax, ECRAN
- mov es, ax
-
- lEA DX, effac
- mov ah, 9
- int 21h
- mov ah,1
- int 21h
-
- mov ah, 0fh
- int 10h
- mov page_cours, bh
-
- xor di, di
- mov al, 20h
- mov ah, 74h
- mov cx, CAPACITE
- cld
- aayyy: STOSW
- xor dx, dx
- azert: dec dx
- jnz azert
- dec cx
- dec cx
- jnz aayyy
-
- lea dx, effac
- mov ah, 9
- int 21h
- mov ax, 3509h
- int 21h
- mov int9_ofs, bx
- mov int9_seg, es
-
- mov bx, 09Ffh
- grd1: mov cx, 0ffffh
- ptt1: loop ptt1
- dec bx
- jnz grd1
-
- mov ax, ECRAN
- mov es, ax
- xor di, di
- mov al, 20h
- mov ah, 074h
- mov cx, CAPACITE
- cld
- rep STOSW
-
- push ds
- push cs
- pop ds
- mov dx, offset int09h
- mov ax, 2509h
- int 21h
- pop ds
-
- AFFICHAGE:
- cmp clavier, 0
- je t_fin1
- ; ****************************************
- mov ah, 2ch
- int 21h
- mov al, dl
- cmp dl, 79
- ja corige
- SUITE:
- mov Si, offset LETTRE
- XOR AH, AH
- ADD SI, AX
- MOV al, [SI]
- mov mot, al
- mov colon, dl
-
- jmp ssaut
- t_fin1: jmp fin1
- corige: push ax
- mov al, dl
- xor ah, ah
- mov dl, 80
- div dl
- mov dl, ah
- pop ax
- jmp suite
- ssaut:
-
- xor dh, dh
- encor: mov bh, page_cours
- mov dl, colon
- mov ah, 02
- int 10h
-
- mov ah, 2
- mov dl, MOT
- int 21h
-
- mov dl, colon
- mov ah, 2
- int 10h
-
-
- mov bx, Temps
- popop: mov cx, 0ffffh
- azqs: loop azqs
- dec bx
- jnz popop
-
- mov dl, 20h
- mov ah, 2
- int 21h
-
- jmp temrre
- encor0: jmp encor
- temrre:
- ; ------------------------------------------------
- push si
- push bx
- mov bl, touche
- cmp bl, 144
- jb faute
- cmp bl, 153
- ja suite0
- sub bl, 144
- xor bh, bh
- lea si, uno
- add si, bx
- mov bl, [SI]
- mov toumot, bl
- faute:jmp sortie
- suite0:cmp bl, 158
- jb faute
- cmp bl, 167
- ja suite2
- sub bl, 158
- xor bh, bh
- lea si, due
- add si, bx
- mov bl, [SI]
- MOV TOUMOT, BL
- sortie:jmp sortie2
- suite2:cmp bl, 172
- jb faute
- cmp bl, 177
- ja faute
- sub bl, 172
- xor bh, bh
- lea si, tre
- add si, bx
- mov bl, [SI]
- mov toumot, bl
-
- sortie2: pop bx
- pop si
- ; -------------------------------------------
- mov bl, toumot
- cmp bl, mot
- je bravo
-
- AHMED:
- inc dh
- cmp dh, 25
- jne encor0
- jmp GamOvr
- ; *****************************************
-
- bravo: mov al, scoor
- inc al
- mov scoor, al
-
- mov CX, 8
- lea di, BOOM
- ECLAT:
- mov dl, colon
- mov ah, 2
- int 10h
- PUSH CX
- mov bx, 80
- ppp: mov cx, 0ffffh
- aqs: loop aqs
- dec bx
- jnz ppp
- POP CX
- mov ah, 2
- mov DL, [DI]
- int 21h
- inc di
- LOOP ECLAT
-
- mov dl, colon
- mov ah, 2
- int 10h
-
- mov dl, 20h
- mov ah, 2
- int 21h
-
- mov bx, temps
- DEC BX
- mov temps, bx
- jmp AFFICHAGE
-
- GamOvr:
-
- lEA DX, GAME
- mov ah, 9
- int 21h
-
- mov bx, 999
- popo1p: mov cx, 0ffffh
- azq1s: loop azq1s
- dec bx
- jnz popo1p
-
- fin1:
- mov dl, scoor
- mov al, dl
- xor ah, ah
- mov dl, 10
- div dl
- add ah, 30h
- mov unit, ah
- xor ah, ah
- mov dl, 10
- div dl
- add ah, 30h
- mov dixenes, ah
- add al,30h
- mov cent, al
- lea dx, touch_ascii
- mov ah, 9
- int 21h
-
-
-
- fin: push ds
- cli
- mov ax, 2509h
- mov dx, int9_ofs
- mov ds, int9_seg
- int 21h
- pop ds
-
- lea dx, mes_end
- mov ah, 9
- int 21h
-
- mov ax, 4c00h
- int 21h
-
- PRINC ENDP
-
-
- INT09H PROC FAR
- push ax
- in al, 60h
- mov ds:touche, al
- cmp al, TOUCH_FIN
- jne i9_end0
- mov ds:clavier, 0
- jmp i9_end
- i9_end0: cmp al,TOUCH_ESC
- JNE i9_end
- mov ds:clavier, 0
- i9_end: pop ax
- jmp [int9_ptr]
- INT09H ENDP
-
-
-
- CODE ENDS
- END PRINC
TOUCH_ESC EQU 129
TOUCH_FIN EQU 1
CAPACITE EQU 2*80*25
ECRAN EQU 0B800H
pile segment stack
db 32 dup (0)
pile ends
extra segment
extra ends
data segment
AUSSI DB 0
BOOM DB "\|/-\***"
UNO db "AZERTYUIOP"
DUE db "QSDFGHJKLM"
TRE db "WXCVBN"
TOUMOT db 0
scoor db 0
GAME db 13,10,"************ GAME OVER *************|",13,10
DB " Votre scoor est : $"
effac db 13,13,13,10," Mon 1Sr jeux",13,10
db " Aprendre les touches du clavier",13,10
db " jeux.asm (c) by Madani-2001 $"
MES_END db " POITS . c'est BON ", 13,10," Merci FIN "
DB " . Veulez-vous quiter ? (Y/N) $"
LETTRE DB "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIKLMNOPQRSTUVWXYZ"
DB "ABCDEFGHIJKLMNOPQRSTUVWYZABCDFGHIJKLMNOPQSTUVWXYZ"
MOT db ?
Temps dw 310
v_al db ?
v_dl db ?
colon db ?
page_cours db ?
touche db 0
clavier db 1
touch_ascii equ this dword
cent db 30h
dixenes db 30h
unit db 30h
finish db "$"
INT9_PTR equ this dword
int9_ofs dw 0
int9_seg dw 0
data ends
code segment
assume cs:code, ds:data, ss:pile, es:extra
PRINC PROC FAR
mov ax, data
mov ds, ax
mov ax, ECRAN
mov es, ax
lEA DX, effac
mov ah, 9
int 21h
mov ah,1
int 21h
mov ah, 0fh
int 10h
mov page_cours, bh
xor di, di
mov al, 20h
mov ah, 74h
mov cx, CAPACITE
cld
aayyy: STOSW
xor dx, dx
azert: dec dx
jnz azert
dec cx
dec cx
jnz aayyy
lea dx, effac
mov ah, 9
int 21h
mov ax, 3509h
int 21h
mov int9_ofs, bx
mov int9_seg, es
mov bx, 09Ffh
grd1: mov cx, 0ffffh
ptt1: loop ptt1
dec bx
jnz grd1
mov ax, ECRAN
mov es, ax
xor di, di
mov al, 20h
mov ah, 074h
mov cx, CAPACITE
cld
rep STOSW
push ds
push cs
pop ds
mov dx, offset int09h
mov ax, 2509h
int 21h
pop ds
AFFICHAGE:
cmp clavier, 0
je t_fin1
; ****************************************
mov ah, 2ch
int 21h
mov al, dl
cmp dl, 79
ja corige
SUITE:
mov Si, offset LETTRE
XOR AH, AH
ADD SI, AX
MOV al, [SI]
mov mot, al
mov colon, dl
jmp ssaut
t_fin1: jmp fin1
corige: push ax
mov al, dl
xor ah, ah
mov dl, 80
div dl
mov dl, ah
pop ax
jmp suite
ssaut:
xor dh, dh
encor: mov bh, page_cours
mov dl, colon
mov ah, 02
int 10h
mov ah, 2
mov dl, MOT
int 21h
mov dl, colon
mov ah, 2
int 10h
mov bx, Temps
popop: mov cx, 0ffffh
azqs: loop azqs
dec bx
jnz popop
mov dl, 20h
mov ah, 2
int 21h
jmp temrre
encor0: jmp encor
temrre:
; ------------------------------------------------
push si
push bx
mov bl, touche
cmp bl, 144
jb faute
cmp bl, 153
ja suite0
sub bl, 144
xor bh, bh
lea si, uno
add si, bx
mov bl, [SI]
mov toumot, bl
faute:jmp sortie
suite0:cmp bl, 158
jb faute
cmp bl, 167
ja suite2
sub bl, 158
xor bh, bh
lea si, due
add si, bx
mov bl, [SI]
MOV TOUMOT, BL
sortie:jmp sortie2
suite2:cmp bl, 172
jb faute
cmp bl, 177
ja faute
sub bl, 172
xor bh, bh
lea si, tre
add si, bx
mov bl, [SI]
mov toumot, bl
sortie2: pop bx
pop si
; -------------------------------------------
mov bl, toumot
cmp bl, mot
je bravo
AHMED:
inc dh
cmp dh, 25
jne encor0
jmp GamOvr
; *****************************************
bravo: mov al, scoor
inc al
mov scoor, al
mov CX, 8
lea di, BOOM
ECLAT:
mov dl, colon
mov ah, 2
int 10h
PUSH CX
mov bx, 80
ppp: mov cx, 0ffffh
aqs: loop aqs
dec bx
jnz ppp
POP CX
mov ah, 2
mov DL, [DI]
int 21h
inc di
LOOP ECLAT
mov dl, colon
mov ah, 2
int 10h
mov dl, 20h
mov ah, 2
int 21h
mov bx, temps
DEC BX
mov temps, bx
jmp AFFICHAGE
GamOvr:
lEA DX, GAME
mov ah, 9
int 21h
mov bx, 999
popo1p: mov cx, 0ffffh
azq1s: loop azq1s
dec bx
jnz popo1p
fin1:
mov dl, scoor
mov al, dl
xor ah, ah
mov dl, 10
div dl
add ah, 30h
mov unit, ah
xor ah, ah
mov dl, 10
div dl
add ah, 30h
mov dixenes, ah
add al,30h
mov cent, al
lea dx, touch_ascii
mov ah, 9
int 21h
fin: push ds
cli
mov ax, 2509h
mov dx, int9_ofs
mov ds, int9_seg
int 21h
pop ds
lea dx, mes_end
mov ah, 9
int 21h
mov ax, 4c00h
int 21h
PRINC ENDP
INT09H PROC FAR
push ax
in al, 60h
mov ds:touche, al
cmp al, TOUCH_FIN
jne i9_end0
mov ds:clavier, 0
jmp i9_end
i9_end0: cmp al,TOUCH_ESC
JNE i9_end
mov ds:clavier, 0
i9_end: pop ax
jmp [int9_ptr]
INT09H ENDP
CODE ENDS
END PRINC
Conclusion
C'est un programme DOS ........ Pour compiler ce programme il faut : 1- avoire les deux executables : TASM.EXE , et TLINK.EXE. 2- executez la commande : TASM Nom_Fichier.asm TLINK Nom_fichier.OBJ
/* Le fichioer *.OBJ est le résultat du TASM.EXE sur le *.asm */ /* Le fichier *.exe est le résultats du TLINK.exe sur le *.obj */
3- Ce programme ne s'éxecute que sous le mode MS-DOS.
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010TECHDAYS PARIS 2010 : PLAN DE MIGRATION VERS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Arnault Nouvel et Antoine Dongois Le processus à prendre : Apprendre (découvrir la plateforme) Préparer (documenter l'historique et choisir la méthode de MAJ) Test (Test de MAJ) Implémenter (Effectuer la MAJ) Valid...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : PIC 16F84RE : PIC 16F84 par pont
Cliquez pour lire la suite par pont RE : PIC 16F84RE : PIC 16F84 par belounis
Cliquez pour lire la suite par belounis RE : PIC 16F84RE : PIC 16F84 par pont
Cliquez pour lire la suite par pont
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|