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 127 128 129 130 131 132 133 134 135
| procedure Val2(s: string; var v,Code: integer);
var
po : pointer;
p: pchar;
i : integer;
begin
po := addr(Code);
p:= pchar(s);
asm
mov edx,dword ptr[po];
mov eax,p;
@@2ea4:
push ebx
push esi
push edi
mov esi,eax
push eax
test eax,eax
je @@2f1a
xor eax,eax
xor ebx,ebx
mov edi,$0ccccccc
@@2eb7:
mov bl,byte ptr ds:[esi]
inc esi
cmp bl,$020
je @@2eb7
mov ch,0
cmp bl,$02d
je @@2f28
cmp bl,$02b
je @@2f2a
@@2ecb:
cmp bl,$024
je @@2f2f
cmp bl,$078
je @@2f2f
cmp bl,$058
je @@2f2f
cmp bl,$030
jnz @@2ef2
mov bl,byte ptr ds:[esi]
inc esi
cmp bl,$078
je @@2f2f
cmp bl,$058
je @@2f2f
test bl,bl
je @@2f10
jmp @@2ef6
@@2ef2:
test bl,bl
je @@2f23
@@2ef6:
sub bl,$030
cmp bl,9
ja @@2f23
cmp eax,edi
ja @@2f23
lea eax,dword ptr ds:[eax+eax*4]
add eax,eax
add eax,ebx
mov bl,byte ptr ds:[esi]
inc esi
test bl,bl
jnz @@2ef6
@@2f10:
dec ch
je @@2f1d
test eax,eax
jge @@2f6c
jmp @@2f23
@@2f1a:
inc esi
jmp @@2f23
@@2f1d:
neg eax
jle @@2f6c
js @@2f6c
@@2f23:
pop ebx
sub esi,ebx
jmp @@2f6f
@@2f28:
inc ch
@@2f2a:
mov bl,byte ptr ds:[esi]
inc esi
jmp @@2ecb
@@2f2f:
mov edi,$0fffffff
mov bl,byte ptr ds:[esi]
inc esi
test bl,bl
je @@2f1a
@@2f3b:
cmp bl,$061
jb @@2f43
sub bl,$020
@@2f43:
sub bl,$030
cmp bl,9
jbe @@2f56
sub bl,$011
cmp bl,5
ja @@2f23
add bl,$0a
@@2f56:
cmp eax,edi
ja @@2f23
shl eax,4
add eax,ebx
mov bl,byte ptr ds:[esi]
inc esi
test bl,bl
jnz @@2f3b
dec ch
jnz @@2f6c
neg eax
@@2f6c:
pop ecx
xor esi,esi
@@2f6f:
mov dword ptr ds:[edx],esi
pop edi
pop esi
pop ebx
mov i,eax
end;
v:=i;
end; |
Partager