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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
Title chaine
.model small
.stack 100h
.386
.data
msg db 10,13,"donner votre texte : $"
nombredesep dw 0
nbre_mot dw 0
longueurchaine dw 0
recurrent dw 0
var dw 0
bi dw 0
max dw 0
varr dw 0
chaine db 200 dup("$")
tab dw 200 dup("$")
.code
main PROC
separateur2:
mov ax,0
cmp chaine[si],"."
jne herenot1111
mov ax,1
jmp finn
herenot1111:
cmp chaine[si]," "
jne herenot2222
mov ax,1
jmp finn
herenot2222:
cmp chaine[si],","
jne herenot3333
mov ax,1
jmp finn
herenot3333:
cmp chaine[si],":"
jne herenot4444
mov ax,1
jmp finn
herenot4444:
finn:
JMP retourtraittt
caractererecurrent :
mov si,0
mov bx,0
mov max,0
mov di,0
mov varr,0
repeter4:
inc si
JMP test22
retour5:
mov di,0
mov ah,chaine[si]
mov di,ax
jmp separateur2
retourtraittt:
cmp ax,1
JE repeter4
sub di,'a'
mov ax,tab[di]
add ax,1
mov tab[di],ax
JMP repeter4
suite:
mov ax,varr
add ax,1
mov varr,ax
mov ax,tab[bx]
cmp ax,max
jg maxi
jMP suite
maxi:
mov di,'a'
mov ax,tab[bx]
mov max,ax
mov ax,di
ADD ax,bx
mov di,ax
mov ax,di
mov recurrent,ax
mov ax,longueurchaine
SUB ax,nombredesep
mov longueurchaine,ax
mov ax,varr
cmp ax,26
JG fin33
add bx,1
JMP suite
test22:
cmp chaine[si],"#"
JNE retour5
cmp si,1
JG suite
JMP fin33
fin33:
mov dh,recurrent
mov ah,2
int 21h
.exit
main ENDP
END main |
Partager