Home > Back-end >  The variables in the compilation of assembly
The variables in the compilation of assembly

Time:09-21

Consult a very garbage problem...
In DELPHI, want to have a variable transformation as the base, and then plug in to the assembly, and how to...
For example pushi:='$14515 e4'; How to convert into effective in assembly code
Asm
MOV ecx, pushi
MOV edx, dword PTR ds: [ecx]
end;

Assembly code into the
Asm
MOV ecx, $14515 e4
MOV edx, dword PTR ds: [ecx]
end;

CodePudding user response:


The above assembly inside the correct code, what should I in DELPHI
write to achieve?Asm
MOV ecx, pushi
MOV edx, dword PTR ds: [ecx]
end;
But the variable should be how to assign a value to achieve the above code,
How should be pushi statement and how to assign a value

CodePudding user response:

You are 1 and 2 floor assembly is contradictory, which one shall prevail?

CodePudding user response:

This variable is a string or an integer?

CodePudding user response:

Asm
Pushi LEA ecx

CodePudding user response:

With lea: no, he is to take the contents of the pushi indirect addressing again, not taking the address of the pushi indirect addressing,
In fact in Delphi BASM can directly write:
Mov ecx, [large $14515 e4]
Is generated by the direct addressing instructions, is mov ecx, dowrd PTR ds: x14515e4 [0]

CodePudding user response:

Oh, immediately number ah,,,,

CodePudding user response:

Var - I: integer;
Asm: ecx, I

CodePudding user response:

Var reg_ptr: ineger;
Asm
Mov ecx, reg_ptr
end;
  • Related