Just to puncture the balloon
anomit | February 13, 2008Some might have started learning assembly language programming in MASM and maybe already under the impression that finally they are ‘doing some shit’. Well, I don’t want to sound as if I am a know-it-all guy. Even I was under the same impression, and we can’t be blamed. Well, when you see a screen all fluorescent green and bright blue showing the registers and segments getting updated as you trace through the program, you can be excused for feeling on top of the world. That is, if you are a Computer Science student and most importantly think like one too!
Well, sorry for the digression. Coming back to the point, there are two major syntaxes of writing assembly language code for the x86 processors: the AT&T syntax and the Intel syntax itself. For the first one, we can use the GNU assembler in linux with the as command (which is a part of the gcc package) and for the latter, another assembler called NASM is used. In this scenario, assemblers like MASM and TASM don’t exactly fit in and are neither here nor there.
You would say, why should I give a f to the assembler and its syntax as long as it is churning out the binaries. After all, whatever the syntax it would get translated to the same machine code in the end. Sample this, you are stuck on quite a large assembly code and you need some urgent help. You go to an IRC channel, show the guys out there the code and ask them to help you out. Chances are that none of them would be able to help you out. Why? Simply because MASM and TASM syntaxes aren’t exactly standards and so most probably they haven’t even cared to learn them.
Now if you are stuck in the lab using MASM and on top of that debugging using Turbo Debugger (yeah, that Turbo shit!), I would advise that at least use the debugger that comes with DOS. I can say this from my personal experiences. TD will often load the code from some other code segment that you had executed previously rather than the one you want to trace right now. It can be really irritating and for the programs which have almost the same functionality like multiplying two 16-bit numbers and multiplying a 32-bit and a 16-bit number, after you have traced through half the program you realise this is not the program you wanted to trace. I am yet to face any such issues with debug.






