Friday 5 July 2013

MASM32 is a Windows "Geek Weapon" :)

Windows programmers today use a number of different tools to make applications. Some of them make consumer apps using "managed" platforms like .NET and others make low-level applications using "native code generating" programming languages like Visual C++ and Delphi.


But there is an amazing tool available that is not even known to many people. It is MASM32. From above it looks like common assembly language from within it has treasures that even medium level programmers can also loot.

After C became the de-facto low level language to make system programs assembly language (considered a hard nut) was pushed back to the role of additional inline code inserted into C programs to make some functionality faster. The reason behind this is that assemblers do not add optimizations to your code when compiling them nor they add extra garbage to your executable. The binary files generated by assembler are almost always faster and smaller than the ones generated by C, C++, etc.

But MASM32 is not even like traditional assemblers (actually it's both assembler and linker that generated executables but for simplicity i am using the term assembler only). MASM32 provides a number of functions (macros) to make a programmer's life easy. It has a library with helpful functions about everything from string operations to if..else conditional operators.

Let me show you a sample code:
--------------------------------------------------------
.386
.model flat, stdcall
option casemap: none

include \masm32\include\masm32rt.inc

.code
  start:
  fn MessageBoxA, NULL,chr$("hello"),chr$("world"),MB_OK
  invoke ExitProcess,0

end start
--------------------------------------------------------

This will show a message box saying "hello world" - just a simple example showing some features of this tool. Funny, if you look closely this doesn't even look like an assembly language program!

It comes with a complete set of tools including a very simple editor with many features except one, that is syntax coloring. But syntax coloring is not much needed in this kind of code so that's not a problem for most people. The help menu provides several help files (CHM) with complete reference to all functions, operators and other features of the language.
Update: There is an advanced IDE available for MASM32 called RadASM. It can be download for free. There is a comprehensive tutorial also available on the site. URL: http://www.oby.ro/rad_asm/
Surely not all people would use this tool because even with "bells and whistles" it is yet "the super low-level" assembly language :D. But if you want fast code and complete control over your program MASM32 is something you should give a try.

Please comment and share this post and let me know what you think about this and have you ever used it? Till then bye! :)

Download MASM32 here: MASM32 Website

0 comments:

Post a Comment

All Articles © Asit. No Copying. Powered by Blogger.
 
Copyright © . The Tech Veda - Posts · Comments
Markup Powered by Bluefish Editor 2.2