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
| .model small
.stack 200h
.data
chaine db 10,13,"je veux tester seulement$"
msg5 db 10,13, "le nombre de separateur est:$"
.code
start:
mov ax,@data
mov ds, ax
xor CX, CX \\initialisation du compteur de sep
lea si,chaine \\on pointe si
boucle:
mov [si],al
cmp al," " \\comparaison avec un espace (comme essaie)
jz separateur
cmp al,'$' \\verifier si c'est la fin de la chaine
jz fin
jmp incrementation
fin:
mov ah,9
lea dx,msg5
int 21h
mov ah,2 \\affichage du nbre de separateurs
mov dx,cx
int 21h
incrementation:
inc si
jmp boucle
separateur:
inc cx
jmp incrementation
end start |
Partager