1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| ;------------------------------------------------------------------------AFFICHAGE CHA�NE DE CARATERE---------------------------------------------------------------------------
print:
mov ah, 0Eh ;Code d'instruction �criture d'un caract�re
xor bx, bx ;RAZ (param�tres inutiles)
print1:
mov al, [si] ;Déplace caractère à afficher dans AL
or al, al ;Test de fin de variable (si AL = 0)
jz STOP ;Si AL = 0 nouvelle ligne
int 10h ;INT gestion affichage
inc si ;Caractère suivant
jmp print ;Boucle affichage
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
;-------------------------------------------------------------------------GESTION CLAVIER-----------------------------------------------------------------------------------------------------
scan:
mov ah, 01h ;Teste buffer clavier
scan1:
int 16h ;INT gestion clavier
jz scan1 ;Boucle si aucune touche pr�s�e
xor ax, ax ;RAZ du code d'instruction
int 16h ;INT gestion clavier
cmp al, 13 ;Test retour chariot
je STOPSCAN ;Fin de la fonction si retour chariot
mov [si], al ;Met le caract�re �crit dans si
mov ah, 0Eh ;Code d'instruction �criture d'un caract�re
int 10h ;INT gestion affichage
inc si ;Passe à l'octet suivant de la variable
jmp scan ;Boucle
STOPSCAN: ;Sortie de fonction
mov ah, 03h ;
int 10h ;
inc dh ;Nouvelle ligne
xor dl, dl ;
mov ah, 02h ;
int 10h ;
mov [si], dl ;Fin de variable 0 à la fin dl = 0
ret
;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
STOP:
ret |
Partager