Dear interlocutors.

    I have a question which might be disputed has little to do with asm, but yet i
hope it is worth some consideration.

  To assess the extent of it, it is of vital importance that you should have a sumpathetic insight
into a number of inconviniences with arise when one is moving a project from one compiler to
another.

  I, for one, encountered it in the form of sudden change in inline assembly syntax.

  Broadly speaking, i'd like to inquere if anyone else also expirienced same problems.

  How ingenious it would be, if someone would come up with the idea and source code for a
macros in c++ to automatically convert AT&T syntax gcc-style to that of Intel and VC++ style or vice versa!

  Unforunately my shallow knowledge of preprocessor is not of great here.
 
  Apparently, compiler -masm=intel options leaves but three dissimilarities:

          1) asm(...) instead of _asm{...}
          2) in gcc opcodes are quoted
          3) in gcc they are ending with \n

  If only one could eliminate them completely by means of preprocessing...

  Does enyone knows how this miracle can be achived??






Posted on 2010-03-16 05:51:57 by Turnip
What you call pre-processing can also be called a "Search and Replace".

Scan through the source code for what you are looking for while copying the stuff you don't want to change into another buffer, when you get to the place that you need changing skip the part you don't want and write the replacement part into your buffer, then continue scanning.

Hardly a miracle.

(http://win32assembly.online.fr/w32_01.txt) < Close to what you want - but not quite.
Posted on 2010-03-16 07:21:40 by JimmyClif
A good point, no doubt.

But you will agree sir, surely, that macro would be a much more appropriate way to deal with things.

without, so to say, resorting to third-party programs (like one you offered)
and highly efficient  tools like 'unlucky junior emploee' or even 'do it yourself, you eejet'.

Perhaps you will support me sir, in backing my view that such macro must be made?
Posted on 2010-03-16 07:41:52 by Turnip
Well, a lot (if not all) tools were made because someone thought it was a necessity for them. I never said you should write it in assembly, you are free to use any language or macro system you choose - in some languages the issue you are confronted with would not be to much more than a few lines.


Posted on 2010-03-16 08:27:52 by JimmyClif
Yeah, in C# you can make a converter like that by writing literally 1 line of code and clicking here and there :)
Posted on 2010-03-16 11:20:20 by ti_mo_n