News:

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

assemblers

Started by WSP_SNIPER, February 21, 2010, 12:35:13 AM

Previous topic - Next topic

WSP_SNIPER

i have seen a few assemblers, nams, masm, and tasm and they have different syntax. i think they all have things in common but they just have a different layout so can anyone tell me. i have been learning asm for a day now!! and just joined the form. and is it a good idea to use the inline assembler in visual studio c++. my idea was to use c++ to organize asm code by calling it threw c++ classes and method but i found you need to make a local copy of variables.

Thanks to anyone who takes the time to answer, asm rocks

ecube

Masm is the most popular, it has a fantastic macro ability, and easy clean syntax that supports high level things,a large user base, SDK, and lots of examples and people willing to help, it's windows only though and has some licensing issues. Alternatively there's JWASM which is basically a full open source masm clone, that lets you make binaries for linux, windows etc... and no license issues. NASM is open source, and cross platform, but personally I can't stand its syntax, its documentation and examples are pretty slim, and until recently the project appeared almost dead. TASM is completely dead so I wouldn't bother with it.Fasm is a great assembler, open source, cross platform and has a pretty big user base,the assembler was written in FASM itself so it's pretty neat. There's also GoASM,which is now my favorite assembler, because it has fantastic syntax, and a lot of features masm doesn't. Its 64bit support is incredibly easy too. The author also frequents this board to, and adds features, fixes bugs etc...
Visuall C++ inline asm support was stripped from newer visual studio versions, so I wouldn't bother, I believe the hardcore geeks use classes to add it back, but it's not worth the effort IMO.

BlackVortex

Agree with what was said. So for starting out better use jwasm (which is an enhanced masm clone) or maybe as you get more experience GoAsm.

Mixing c++ and asm isn't really "neat", maybe you should assemble your asm projects/functions in dll libraries and call those from c programs, or the other way around ! So you get the best of the two worlds and they are "reusable" with other languages/stuff.

joemc

Quote from: WSP_SNIPER on February 21, 2010, 12:35:13 AM
my idea was to use c++ to organize asm code by calling it threw c++ classes and method
sounds interesting to do for fun, or as a way to use something familiar to help you learn something new. I doubt you would get better performance than just using C++ and than using inline ASM for critical locations, i doubt file size would go down either. MASM uses fairly high level ideas like structures, and you can hide data by not using it when your not suppose to :) and you dont need the C runtime library anymore.

Quote from: E^cube on February 21, 2010, 02:16:45 AM
Visuall C++ inline asm support was stripped from newer visual studio versions, so I wouldn't bother, I believe the hardcore geeks use classes to add it back, but it's not worth the effort IMO.
it works on my visual studio 2010  RC.  and msdn says its suppose to.

how would you use a class to add assembly support to a compiler?

http://msdn.microsoft.com/en-us/library/4ks26t93%28VS.100%29.aspx

Quote from: MSDN
Because the inline assembler doesn't support all of Microsoft Macro Assembler's (MASM) macro and data directives, you may find it more convenient to use MASM for such modules.

GregL

QuoteQuote from: E^cube on February 20, 2010, 06:16:45 pm
Visuall C++ inline asm support was stripped from newer visual studio versions, so I wouldn't bother, I believe the hardcore geeks use classes to add it back, but it's not worth the effort IMO.

it works on my visual studio 2010  RC.  and msdn says its suppose to.


Actually, E^cube should have said inline assembler support was stripped from 64-bit code in Visual C++. No big loss, inline assembly is pretty limited. Much better to write MASM modules as separate object modules and call the procedures from C/C++. You can then easily create a library from the MASM modules if you want.