Delphi: Generation de code
Code:
1 2 3 4 5
|
if a[1]=x then exit
if a[1]=y then exit
if a[1]=z then exit
if a[2]=x then exit |
J'ai regarde le code il fait
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
Mov al,[a+1]
cmp al ,[x]
jz sortie
Mov al,[a+1]
cmp al ,[x]
jz sortie
Mov al,[a+1]
cmp al ,[x]
jz sortie
Mov al,[a+2]
cmp al ,[x]
jz sortie |
J'ai reecris en utilisanrt AX
Code:
1 2 3 4 5 6 7 8 9 10
|
Mov ax,[a+1]
cmp al ,[x]
jz sortie
cmp al ,[x]
jz sortie
cmp al ,[x]
jz sortie
cmp ah ,[x]
jz sortie |
Le code est plus court, évite des chargements d'al je pensais gagne
Or il n'y a pas photo: le code le plus court se traine lamentablement (2 ou trois fois)
Je n'arrive pas a comprendre pourquoi (j'ai change AX et EAX pour rester en 32 bits mais cela ne change rien)
Je ne fournis pas le vrai source car il fait partie d'un défi mais je pense que je pourrais, si on m'autorise, a l'adresser en MP
Boris