The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: BogdanOntanu on January 24, 2006, 09:52:24 PM

Title: Tools to convert to IDEAL mode?
Post by: BogdanOntanu on January 24, 2006, 09:52:24 PM
Hi all,

Anybody is aware of any tool that could automatically convert TASM/MASM "normal" syntax into IDEAL mode syntax?

Title: Re: Tools to convert to IDEAL mode?
Post by: MusicalMike on January 25, 2006, 05:32:51 PM
Could someone tell me what Ideal mode is?
Title: Re: Tools to convert to IDEAL mode?
Post by: Vortex on January 25, 2006, 05:54:43 PM
QuoteTASM, Inpise's Borland Turbo Assembler, supports an alternative to MASM
emulation.  This is known as Ideal mode and provides several advantages
over MASM.  The key (questionable) disadvantage, of course, is that MASM
style assemblers cannot assemble Ideal mode programs.

http://www.faqs.org/faqs/assembly-language/x86/borland/section-3.html
Title: Re: Tools to convert to IDEAL mode?
Post by: MusicalMike on January 30, 2006, 05:29:33 PM
The syntax specifications in that text vaguely remind me of the syntax for an assembler I like to use in linux (masm is not available for linux) called FASM. <scratches head> ::)
Title: Re: Tools to convert to IDEAL mode?
Post by: Vortex on January 30, 2006, 06:01:00 PM
Mike,

Did you try using Masm with help of an emulator on the Linux platform?
Title: Re: Tools to convert to IDEAL mode?
Post by: MusicalMike on January 31, 2006, 09:53:33 PM
I am sort of new to linux, and am still trying to get solid with the basics, but when i asked my brother (who is well versed in linux and other unix derivitaves) he said that most emulators don't work that well. What would be really nice is if POASM was implimented for linux, but I don't believe it is. Anyway, if you know of an emulator that you know works, feel free to post a link, and I will check it out. (Must be free AND fully functional)
Title: Re: Tools to convert to IDEAL mode?
Post by: Vortex on January 31, 2006, 10:04:57 PM
Mike,

If I remember well, the emulator was wine and Agner Fog mentioned in one his papers how to use wine with Masm.
Title: Re: Tools to convert to IDEAL mode?
Post by: Vortex on January 31, 2006, 10:06:51 PM
I found it :

http://www.agner.org/assem/pentopt.pdf

Agner Fog describes the whole process.
Title: Re: Tools to convert to IDEAL mode?
Post by: BogdanOntanu on February 01, 2006, 07:28:25 AM
However my original question was not related to moving into Linus and using natively FASM or MASM into an emulator.

I have huge projects like SolarOS or HostileEncounter or Sol_ASM and i was thinking to make my own assembler compatible with IDEAL mode and use LZASM until i finish my  own assembler.

Unfortunately chnaging huge projects from MASM/TASM style into IDEAL mode style syntax is a lot of work...
and i was wondering IF i can find some kind of tools to automate the process...a little

So basically it would also be nice to convert back from IDEAL to MASM or TASM mode :D
Title: Re: Tools to convert to IDEAL mode?
Post by: dsouza123 on February 01, 2006, 03:00:22 PM
Olly dbg is able to switch the assembly syntax in realtime
between three different formats MASM, Ideal, HLA.

Some Olly dbg code is available at the site with the debugger.
http://www.ollydbg.de/
Title: Re: Tools to convert to IDEAL mode?
Post by: zooba on February 02, 2006, 02:05:21 AM
After having a quick play with Olly, it seems the only difference is in how memory pointers are expressed:

MASM:
mov eax, DWORD PTR [abc]
Ideal:
mov eax, [DWORD abc]

This modification can be done with a simple find/replace (assuming you've been consistent with it in the first place). Try looking for a multiple file find/replace tool (I use Windows Grep (http://www.wingrep.com)). :U
Title: Re: Tools to convert to IDEAL mode?
Post by: u on February 02, 2006, 05:06:52 AM
I'm not sure, but could MASM listing help?
ml.exe /Fl[file] Generate listing
Title: Re: Tools to convert to IDEAL mode?
Post by: BogdanOntanu on February 02, 2006, 07:08:45 AM
Yes i was aware tha some parts of it could be done by am extensive search and replace.
Bu i am concerned with issues more like:

String_Len PROC
ARG @@string_ptr:dword
...
ENDP

Keywords like PROC or MACRO or STRUC that are supposet to be the first one on a line in IDEAL mode.
So I would need a tool that will reverse <whatever_name> PROC --> PROC <whatever_name>

Well, it sould not be hard to code, or i can use a Perl script  ;)
I was just fishing for an easy prefabricated solution ... shame on me :D