News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

GoASM?

Started by Bieb, January 09, 2005, 02:59:21 AM

Previous topic - Next topic

Bieb

What exactly is the difference between GoASM and MASM.  Is it somehow superior, or is it just different?

James Ladd

There the same in that they take assembler source and assemble it into a running program.
They are different in the MASM - Macro Assembler has more macro support.
It like comparing Microsoft Visual C++ and Borland C++.

donkey

Hi Bieb,

Well, it seems similar on the surface, that is that the grammar is about the same as MASM but it is a much more explicit assembler, and it requires that you do alot of things manually that MASM would normally do. So why you ask would you go to the trouble of doing this ? Well, you can also do them in MASM, and it gives you much more control over your program. As a matter of fact the few times that I still use MASM, my code is much more explicit and I don't use the high level constructs.

But there are other things,

it handles scoping much better
the invoke pseudo-macro is much more powerful
inline strings are built in and handled logically (choosing a section based on certain criteria)
the grammar, though like MASM is completely unambiguous
supports the same code libraries as MASM
does not require import libraries
handles DLL imports incredibly easily (ie invoke MyDLL.dll:SomeFunction, param)

And many, many other advantages over MASM, the biggest of which is that Jeremy actually reads and replies to your emails (when he's not globe trekking), last I heard MS was not replying to questions about MASM (or anything else for that matter).

Why not give it a try, it's free and the complete suite of tools is available for download from Jeremy's site. If you need any help there are quite a few of us who check in but I'm probably the most vocal of the users.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Bieb

Just how different is the syntax?  That is, how difficult will it be to learn?

donkey

Hi bieb,

You can always take a look at Jeremy's website or mine for example code in GoAsm,the syntax is surprisingly similar...

mov esi, [pYUV]
mov eax,[clrRGB]
and eax,0FFh
mov [RED],eax

mov eax,[clrRGB]
shr eax,8
and eax,0FFh
mov [GREEN],eax

mov eax,[clrRGB]
shr eax,16
and eax,0FFh
mov [BLUE],eax

finit
mov edi,[pTable]
xor ecx,ecx
dec ecx
:
inc ecx
mov [TempDword], ecx
fld Q[FloatStuff]
fild D[TempDword]
fmulp ST1,ST0
fld Q[FloatStuff+8]
fdivp ST1,ST0
fstp Q[edi]
sub D[edi+4],00100000h ; Devide TempQ by 2
add edi,8
or cl,cl
jns <
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Vortex

No any intention to implement HLL constructs?

bushpilot

From GoAsm help file:

QuoteGoAsm does not support run-time "if" commands. MASM allows you to test conditions and/or repeat instructions in a loop using the .IF/.ELSE/.ELSEIF/.ENDIF and .WHILE/.BREAK commands. These test for conditions at run-time. A386 offers the IF command which tests the flags at run-time. However in MASM the IF/ELSE/ELSEIF/ENDIF/IFDEF series of commands are used for conditional assembly tested at assemble-time. A386 uses the #IF form for this task, while NASM uses %IF. "C" syntax is #IF for compile-time tests. To me, using any syntax for run-time tests which are so similar to established syntax which means something completely different is a recipe for disaster. For the time being I have decided not to support any form of run-time testing or looping. I am willing to reconsider this if anybody can suggest a suitable syntax. For the time being GoAsm users will have to rely on the trusty CMP, TEST, LOOP and conditional jump mnemonics.

I think the key phrase is "I am willing to reconsider this if ..."

I haven't had a need for it, and I guess most others who use GoAsm are the same.

Greg

rwalt

Quote from: donkey on January 09, 2005, 04:19:03 AM
handles DLL imports incredibly easily (ie invoke MyDLL.dll:SomeFunction, param)

That is cool..

How well does FASM stack up to GoAsm?

donkey

#8
FASM is a very powerful assembler, perhaps one of the most powerful there is. I tried it originally as a possible replacement for MASM but found that the syntax was too different, it handled structures badly (at the time), and the section setups were a bit too complicated for someone jumping from MASM. GoAsm has the advantage that it is very focused on Win32, though it can also be used for Linux, and uses a syntax that most MASM users will find intuitive, in other words you didn't waste all of that time it took to learn MASM. FASM's macro system is much more powerful than GoAsm's but as I said, that is not something I am likely to use in my coding. However, scoping in GoAsm (which is easily the best of any assembler), dll imports as well as inline strings etc... make it the choice for me.

By the way the DLL import thing works for ordinals as well, making them much more accessible than in any other language...

invoke Shell32.DLL:123, Param1, Param2

And like a normal forced (normal) import, the program will not load if the ordinal is not present.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

rwalt

#9
Quote
By the way the DLL import thing works for ordinals as well, making them much more accessible than in any other language...

invoke Shell32.DLL:123, Param1, Param2

And like a normal forced (normal) import, the program will not load if the ordinal is not present.

That is really neat. I would say that GoAsm is very powerful too. Like you, I don't really like to use macros, they are a nice feature though.

AeroASM

(hard logical confrontation:)

If you don't like to use them, then how can you describe them as nice?

(curious question:)

Why don't you like to use them?

donkey

Quote from: AeroASM on March 09, 2005, 06:51:45 PM
(hard logical confrontation:)

If you don't like to use them, then how can you describe them as nice?

(curious question:)

Why don't you like to use them?

Well, I do understand the usage of macros, though I do not use them myself, or at least not significantly. I did write a series of debug macros for GoAsm/RadASM that work rather well. In my code however, I prefer clarity, that is that I find that macros obfuscate the code and though I pretty much understand them and know the difference between a powerful macro system and a limited one, I do not use them personally.

I do not use macros as I find that generalizing code blocks adds nothing to clarity and reduces clarity. Also,if you have looked at a number of MASM or FASM examples,how often have you had to search for a particular macro that the author assumed you already had. I bet it is quite a few times, after a few hundred similar searches I decided macros were more of a problem than a solution.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable