News:

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

Masm conversion

Started by danzar, December 08, 2009, 09:01:26 PM

Previous topic - Next topic

danzar

I was woundering if there is a tut or a posting on conversion from Masm to C++ or some HLL or C++ to Masm so I can help understand the logic. I have been reading and studing Kip Irvine's "Assembly Language for Intel-Based Computers". It has some conversions but I would like to see more so I can grasp the logic better.

Thanks for any and all help
Danzar

jj2007

Masm has a powerful macro engine that makes it emulate anything from C-style to BASIC-style. Conversions depend on what you were used to. The best starting point is \masm32\help\hlhelp.chm, from Overview/Creating procedures onwards.
Second step could be a look at the Masm32 examples, e.g. \masm32\examples\exampl01\generic\generic.asm
I attach a very simple Windows example taken from the RichMasm/MasmBasic editor; open it either in RichMasm or in MsWord or in WordPad.

hutch--

Danzar,

Microsoft C  can be set with a switch so that it creates an assembler dump and while the output is no joy to read, you can simplify it by turning the internal compiler optimisation off. As long as you are familiar with the  standard C notation there are only minor notation differences in terms of IF blocks, WHILE loops and C style runtime evaluation.

What will take the time is learning the basics of registers and the intel instruction set but the reference material from intel is excellent if a bit technical. With practice you write MASM code at about the same speed as low level C. Very high level C++ is a lot more complicated internally and it goes together with a different brain being an OOP language, this can be done to some extent in MASM with the right support but its not a native capacity as assembler is simply lower level than OOP.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php