inline assembler

Top  Previous  Next

What is partially translated > inline assembler

 

The student version of Delphi2Cpp doesn't process inline assembler code. It is put into comments instead, so that the translated code will not stop to compile because of invalid assembler parts. In the professional version of Delphi2Cpp, you can enable a processing of the assembler code:

 

Delphi comments are converted to C++ comments
Delphi expressions used inside of the assembler code are analysed and converted
identifiers can be substituted by other identifiers

 

These actions often suffice to get operating code. However, assembler expert knowledge is needed in individual cases. The result depends on the target compiler:

 

C++Builder:

 

Much inline assembler code of Delphi also works with C++Builder. But there are a few constructs of Delphi inline assembler which are not permitted in C++Builder and there are differences in the manner how parameters are passed to functions and how values are returned.

 

Other compilers:

 

Local labels are converted to global labels for other compilers than C++Builder. Local labels are labels that start with an at-sign '@'. They donít have to be declared and their scope is restricted from the asm reserved word to the end of the asm statement that contains it. Other compilers don't know them. Therefore they are converted to normal labels.Example:

 

 asm

 @SomeLoop:

   jmp @SomeLoop

 end;

 asm

   push  esi

   { Some remarks }

 @SomeLoop:

   jmp @SomeLoop

   pop esi

 end;

 

->

 

_asm

{

    

 SomeLoop__0:

       jmp SomeLoop__0

}

_asm

{

  

   push  esi

     //  Some remarks 

 SomeLoop__0:

     jmp SomeLoop__0

   pop esi

}

 

 



This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content