Condition et enregistrement

ciberrique Messages postés 589 Date d'inscription lundi 25 août 2003 Statut Membre Dernière intervention 18 juillet 2010 - 14 nov. 2004 à 15:48
ciberrique Messages postés 589 Date d'inscription lundi 25 août 2003 Statut Membre Dernière intervention 18 juillet 2010 - 14 nov. 2004 à 17:38
Salut, voila je n'ai aucune connaissance en asm.

Je voudrais effectuer une comparaison entre deux chaines de caracteres, une des chaines près configurer et l'autre soit recupérer de visual basic soit d'un fichier texte
Si a = b
alors
c = "a"

et ainsi de suite, il y a environ 26 comparaisons comme celles ci.

Ensuite je voudrais pouvoir enregistrer le resultat dans un fichier ou alors l'envoyer directement dans visual basic.

Je vous remerci pour votre aide.

4 réponses

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
14 nov. 2004 à 17:08
1) Sans connaitre ASM sera difficile.
2) Avec un cahier des charges aussi imprecis sera encore plus difficile.

ciao...
BruNews, MVP VC++
0
ciberrique Messages postés 589 Date d'inscription lundi 25 août 2003 Statut Membre Dernière intervention 18 juillet 2010 1
14 nov. 2004 à 17:19
Oki alors je m'explique :

J'ai un fichier texte, et une série de comparaison en vb :

If entré(i) = "0" Then
sortie = sortie & "a"
GoTo Trouver
End If
If entré(i) = "00" Then
sortie = sortie & "b"
GoTo Trouver
End If
If entré(i) = "000" Then
sortie = sortie & "c"
GoTo Trouver
End If
If entré(i) = "0000" Then
sortie = sortie & "d"
GoTo Trouver
End If
If entré(i) = "00000" Then
sortie = sortie & "e"
GoTo Trouver
End If
If entré(i) = "000000" Then
sortie = sortie & "f"
GoTo Trouver
End If
If entré(i) = "0000000" Then
sortie = sortie & "g"
GoTo Trouver
End If
If entré(i) = "00000000" Then
sortie = sortie & "h"
GoTo Trouver
End If
If entré(i) = "000000000" Then
sortie = sortie & "i"
GoTo Trouver
End If
If entré(i) = "0000000000" Then
sortie = sortie & "j"
GoTo Trouver
End If
If entré(i) = "00000000000" Then
sortie = sortie & "k"
GoTo Trouver
End If
If entré(i) = "000000000000" Then
sortie = sortie & "l"
GoTo Trouver
End If
If entré(i) = "0000000000000" Then
sortie = sortie & "m"
GoTo Trouver
End If

If entré(i) = "1" Then
sortie = sortie & "n"
GoTo Trouver
End If
If entré(i) = "11" Then
sortie = sortie & "o"
GoTo Trouver
End If
If entré(i) = "111" Then
sortie = sortie & "p"
GoTo Trouver
End If
If entré(i) = "1111" Then
sortie = sortie & "q"
GoTo Trouver
End If
If entré(i) = "11111" Then
sortie = sortie & "r"
GoTo Trouver
End If
If entré(i) = "111111" Then
sortie = sortie & "s"
GoTo Trouver
End If
If entré(i) = "1111111" Then
sortie = sortie & "t"
GoTo Trouver
End If
If entré(i) = "11111111" Then
sortie = sortie & "u"
GoTo Trouver
End If
If entré(i) = "111111111" Then
sortie = sortie & "v"
GoTo Trouver
End If
If entré(i) = "1111111111" Then
sortie = sortie & "w"
GoTo Trouver
End If
If entré(i) = "11111111111" Then
sortie = sortie & "x"
GoTo Trouver
End If
If entré(i) = "111111111111" Then
sortie = sortie & "y"
GoTo Trouver
End If
If entré(i) = "1111111111111" Then
sortie = sortie & "z"
GoTo Trouver
End If

que je veux transposer en asm.
En faite entré(i) correspond à une ligne du fichier texte donc la comparaison s'effectue pour la premiere ligne puis la deuxieme ....

Ensuite sortie correspond au fichier de sortie ou on met tout les resultat à la suite .....

Est ce suffisant ou pas ??

Merci...
0
BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
14 nov. 2004 à 17:36
donc une fonction avec un param pointeur chaine et retourne un entier.
Dans la func, tu mets pointeur en registre:

mov edx, [esp+4]

analyse:
mov al, [edx] ; al contient valeur octet
; comparaisons etc...

plus loin: inc edx

enfin si tu ne connais pas ASM, je ne vois pas ou on va aller ni ce que tu ferais de la routine. VB ne prend pas l'ASM inline.

ciao...
BruNews, MVP VC++
0
ciberrique Messages postés 589 Date d'inscription lundi 25 août 2003 Statut Membre Dernière intervention 18 juillet 2010 1
14 nov. 2004 à 17:38
Je te remerci pour ton aide, je vais maintenant me penché plus fortement sur l'asm..

Et oui je suis trés mauvais en orthographe, donc excusez moi.
0
Rejoignez-nous