Hey everyone! Thank you for reading my thread. I have been interested in programming for quite some time now, but I have never had the time or motivation to do it. I moderate a forum that revolves around online games and various "tools" and programs, in which our members program both for free or for a fee. I think it's about time I begin to contribute some quality programs, and from what I have read, assembly is where it is at.

I have never programmed before in my life, well at least until I picked up a copy of Randall Hyde's "The Art of Assembly Language". HLA boasts to be as powerful as ASM, but also more time-efficient, which was everything I could have hoped for. I had a look at some documents and articles on various Assemblers before reading the book, and MASM32 and TASM also sound quite interesting.

I have almost finished chapter 1 of The Art of Assembly Language, but because of the lack of source code available and variety of tutorials (or lack of) for HLA in general, I am considering changing to MASM32 or TASM.

My Question) Should I stick with HLA, and just continue working through the book? Keep in mind my goal is to learn Assembly, but also to be able to program, in the shortest time possible. The Art of Assembly book states that it "weeds" you out of HLA procedures, so hopefully by the end I'll have a decent knowledge of true ASM (Win-32).

Thanks!



Posted on 2008-11-11 02:38:22 by Matt
As soon as you are comfortable with HLA, stop using it.
Why? Because to stagnate is to rot - if you're not in a state of growth, you are dying.
Although HLA is a nice place to start, I would not suggest you stick with it - because its an interpreted language, and you'll never have absolute control over your code if you use an interpreted language.

Once you're familiar with HLA, I would recommend taking a look at ObjAsm32.
HLA is a preprocessor which emits asm.
ObjAsm32 is what Randy was trying to achieve in MASM before he gave up and wrote HLA - a highlevel object oriented programming environment which only exists at buildtime - no preprocessor!
Randy gave up because MASM has some serious limitations that he was never able to work around.
Biterider has managed to find ways around them :)

It's perfectly suitable for rapid application development, and has a similar look and feel to HLA, so you'll be right at home. Furthermore, the key developers of ObjAsm32 are both administrators of this forum! (Biterider wrote most of OA32, I've been actively developing under it and contributing to its expansion for the past couple of years).
HLA is aimed at orienting students in the ways of asm, whereas OA32 is geared toward commercial development.

Of course, I am biased but do note that I use OA32 for ALL my programming requirements since I was pressed into using it.... now I'm addicted! If I want a new feature in OA32, I can ask Biterider for it and usually he agrees with me and it gets added immediately (whether I provide the code or not). OA32 has a smart update feature which allows you to keep up to date with changes without waiting for the next major public release, so it is very much an organic living thing which is in a state of constant growth.

Posted on 2008-11-11 03:38:24 by Homer
Thank you for the very detailed and informative reply. I was under the impression that I would be able to write and use pure ASM (the only way I know how to describe untouched/modified Assembly for Windows XP) when necessary, but use HLA's additional "procedures" if I wanted to save some time.

One major problem that I am having is mainly the overload of information. Often I have to google stuff from the Art of Assembly Language book because of my lack of prior programming knowledge, and I end up viewing info that relates to a multitude of assemblers! I am having a hard time knowing what to apply and what assembler it applies to :(.

Maybe I should just "complete" the Art of Assembly Language, meaning read it all, do my best to understand all of the concepts and then turn to ObjAsm32. What kind of documentation does it have though? And are there any specific tutorials I should follow?

Thanks!



Posted on 2008-11-11 04:10:32 by Matt
I've been programming in asm for over 25 years and I still have to google stuff.

ObjAsm32 has a helpfile (not that useful) and a set of examples (more useful) but you'll be able to ask questions and have them answered by the key players... I have a lot of respect for Randy, however he doesn't have the time nor the inclination to answer each and every question, and we do... so yes, follow through with what you are doing, and then move on.
Posted on 2008-11-11 07:05:10 by Homer
Thank you very much! And I have decided to just go with MASM32 for now, as I was able to find a whole lot of helpful stuff (specifically for beginners like myself).

I'm looking forwards to Objasm32, and it's great that you can offer help, which you have already done allot of for me. :D
Posted on 2008-11-12 01:26:31 by Matt
Good choice..  MASM is not exactly the best assembler in the world, it has some real limitations (I think all assemblers do), but its macro engine is very powerful, which is how OA32 was realized.
OA32 is mostly a set of macros for MASM, coding under OA32 is somewhere between pure asm and HLA, but really, its just MASM and some macros and some procedures.
You can freely mix pure MASM code with OA32 code, and you don't need a fancy preprocessor to make it work.

However eventually we'd like to write a preprocessor like HLA.
But not for the same reasons.
We wish to cross to other platforms, and other assemblers, so our preprocessor will be a 'babelfish' which translates sourcecode into asm source for the platform and assembler of choice... but for the moment, we're stuck with MASM.

In terms of commercial viability, one of the key features of OA32 is that you can use pre-assembled objects (classes) in a project, which vastly improves build times. I'm not sure that HLA offers this.

Posted on 2008-11-12 02:54:30 by Homer
Once again, thanks for the insight. I have a question though, it may sound stupid and I think I know what the answer will be. My question is, if I use OA32, will it be as "efficient" as pure ASM? For example, as fast, small and clean (meaning no junk code) as if I just used MASM32?

Thanks!
Posted on 2008-11-13 05:25:47 by Matt
Objects are junks. Any object oriented language adds "junk" to your code. Code pure, code simple, code low level  :lol: However, you must know that the efficiency of your code is mostly related to the code that you write. Not what the compiler might add to your code.
Posted on 2008-11-13 06:46:38 by XCHG
I can understand your point of view, but fortunately they are other coders that don’t see it like you.
The key difference from the 2 perspectives is the project scale. If you want to code a “Hello World” app, everybody will agree with you that brute assembler is the best choice in terms of size. If you intend to code something bigger and you want to base your new work on the proven code you just developed, OOP is a genuine alternative, if not the best. I agree again, that they are exceptions, but exceptions confirm the rule.

In terms of speed, OOP isn’t necessary slower that pure assembler and… you have always the choice to mix both when you believe that you can do it better.

There is a general misconception about OOP. In its simplest form, OOP behaves exactly like traditional procedural programming. When you add more features because you want to do some more sophisticated tasks, OOP simplifies the code making it less prone to errors.

OOP is more complicated than brute assembler because you need to learn new rules. Unfortunately not everybody is able to learn to take benefit of it and it is good so.

My 2 cents…

Regards,

Biterider
Posted on 2008-11-13 12:33:41 by Biterider
As I mentioned, OA32 is little more than a bunch of macros for MASM.
You'll still have to get your hands dirty and use lots of 'pure asm'.
However you'll be able to do things which are really difficult and hard to debug using asm alone - and you'll find it much easier to recycle your code from one project into another project.

Imagine that an application is a house, its made from bricks.
Now imagine you wish to build a house.
Do you want to make each and every brick by hand, make sure its nice and square and fits well with all the other bricks - or would you use bricks that already exist and have been laboriously optimized?

Now imagine you want to build ANOTHER house, of vastly different design.
Wouldn't it be easier (and faster) to recycle those bricks you used previously than to start making new bricks from the ground up?

The bloat in a typical OA32 object is minimal (just a few bytes of call indirection for some kinds of methods, none if they are 'bound' methods), and OA32 is capable of emitting linear asm just like HLA so you can see exactly what its doing and tweak the parts of the code that annoy you. Most of the OA32 macros are merely wrappers for 'pure asm' code snippets, making your code easier to read and shorter to type, you can poke around inside them and see exactly whats in them, its all open sourced.

Furthermore, OA32 has some really useful debugging support built into it, allowing you to emit messages at runtime, dump chunks of arbitrary memory, view strings, registers, and other goodness which you can't easily do in a typical debug environment. (Think of this as an enhancement to, not a replacement for a good debugger).
Also, it can detect resource leaks such as unreleased handles and objects and alert you to them. You can build your code with full, partial, or NO debug support.

Yes, hand crafted asm will always have the edge, but that's exactly the point - 99% of your code under OA32 IS HAND CRAFTED ASM - this is where OA32 differs from any other object oriented programming environment (except one, ATC, which is no longer public).

Posted on 2008-11-13 18:14:57 by Homer
Thanks allot Homer and Biterider, you've helped me more than I could imagine. I'm glad you cleared everything up for me, and I think I have a better understand on what I should be learning now.

It was mentioned that I could use my code in OOP languages (I assume 'Object Orientated Programming'). I know you can use ASM code in Delphi (I'm not sure about MASM32 or ObjAsm32), but are there any other languages which support the code?
Posted on 2008-11-15 05:05:17 by Matt
sure, a number of languages support 'inline asm' - but this is never powerful or well featured, for example you can't generally use macros inside inline asm, it's limited to linear code, no tricks, no fun.
Posted on 2008-11-15 08:51:27 by Homer