I've never really understood the need for hla.
It seems to say
"dont learn complex asm or complex C,stradle the line and learn my own weird form of complex asm"
Thats fine! That cool! Good luck with that!

But why the heck confuse asm newbies with whats praticaly a totally different language?
I dont give a mutts nutts what anyone says HLA is just too different to be called asm.
IMHO, It's like saying C is an assembler because it can included _asm statments directly.

Randy, m8 ,dont take this as a personal attack on hla i think it probably has a place somewhere(cant think where..).But hla code shouldn't be mixed in on a guide to asm.

Perhaps HLA should have its own section marked pre-assemblers/compilers with links to the PURE asm version when people want to see how its actually done in asm......

btw.Im refering to this section
Contents
    * 1 Creating arrays
    * 2 Getting/setting array elements with indexes
    * 3 Size of arrays
    * 4 Larger array elements
    * 5 Multidimensioned arrays
    * 6 Stepping through an array with offsets or pointers
    * 7 Search, sort, insert, and delete
          o 7.1 Linear search
          o 7.2 Insert an array element
          o 7.3 Delete an array element
          o 7.4 Insertion sort
          o 7.5 The HLA Standard Library Arrays Module            <------------------

Posted on 2006-07-02 11:34:19 by asmrixstar
There are different flavors and different ways to do things. Some people come from an HLL environment and use HLA as a "stair-case" in their travels downward towards ASM.

Point being, you normally wouldn't want to try and alienate anyone. If you don't like or use HLA, don't read the code.
Posted on 2006-07-02 12:08:30 by SpooK
not trying to alienate anyone. I even suggested that it should have its own section.

But i think the flavour tastes just a little TOO different to be whacked in as 'just another sort of assembler'.

Here's a page i found myself nodding my head to:
http://programming.reddit.com/info/8ttm/comments
Posted on 2006-07-02 12:46:27 by asmrixstar
I personally think that MASM is a little too high level with all those .IF/.ELSE/.ENDIF blocks that obfuscate and generate their own code. Not quite an assembler as much as a compiler to me being a GoAsm user. How about the endless stream of useless macros that further separate you from real assembler ? Like m2m etc.. If you want to put a warning about HLA then I believe you should have to put one for MASM/MASM32 as well. Otherwise, it is an assembler by the more liberal definition of the word so let it be, it doesn't hurt anyone or diminish the project in any way. On my website I describe HLA as follows...

HLA is a front-end preprocessor that adds (pascal like) high level language and structure to MASM or FASM


The same could be said for the high level constructs in MASM (with the exception of the pascal part obviously)
Posted on 2006-07-02 13:00:34 by donkey
yeah i like goasm but the lack of .if blocks is what puts me off it.

I guess it all comes down to where you draw the line.
IMO
m2m blah,blah
is just a more readable form of
push blah
pop blah
and that seems fine to me.

However radacly modify the syntax away from every other assembler just smacks of 'cos-i-can'-ism and hardly helps your average joe thats tring to learn asm.It just adds another layer of complexity to someone still struggling to learn the opcodes.

I dont dispute RH's right to develop such a project.In fact Id activley support his right to do so. I just claim it doesnt belong in a learners guide.
Posted on 2006-07-02 13:42:03 by asmrixstar
An .IF block generates code that is not 1::1 therefore if you disallow Randall's preprocessor engine you must (to be fair) disallow MASM. There has to be a demarcation point, that I agree with, however it is a very complex subject to decide what constitutes an assembler, and assembler w/ preprocessor etc... For myself if you can directly write assembly (1::1) instructions without the use of special directives (_asm) and the use of all high level constructs are optional then it is an assembler. Personally I prefer to construct my own IF blocks and determine my own jump types so GoAsm is the one for me but I like to code API programs using low level assembler and avoid macros like the plague, not everyone agrees with this point of view and I respect that, some find GoAsm too sparse for their needs.
Posted on 2006-07-02 13:51:37 by donkey
mmm...
It would be interesting to know what randy thinks of HLA being inserted into wiki...

(Quote :I prefer to construct my own IF blocks and determine my own jump types)
Dont wanna stray too far from the topic but can you provide an link/example of jump type usage.always keen to learn new methods
      thx

Posted on 2006-07-02 14:09:33 by asmrixstar
JMP types are either short or long, in MASM you can over-ride the default optimization by using SHORT or LONG...

JMP SHORT Label
JMP LONG Label

I sometimes prefer to have a long jump in place of one that would be optimized to short for code alignment purposes, for example if you want a loop to exit on a 16 Byte boundary. GoAsm does not attempt to optimize jumps, it requires that you explicitly state short or long and forward or backward (< << > >>). It will ofcourse throw an error if a short jump was used to a location more than 127 bytes away.

Also the only HLL construct in GoAsm is really INVOKE, though the GoAsm version is more powerful than it's MASM counterpart the code generated is also more predictable (i.e. no LEA EAX is ever generated with GoAsm).
Posted on 2006-07-02 15:57:41 by donkey
nice explanation thx.

"ie. no LEA EAX is ever generated with GoAsm" how does it pass its data locations? Does it just pass the offset?
Posted on 2006-07-02 17:02:07 by asmrixstar
It calculates the offset relative to ESP or EBP (depending whether it is LOCAL or PARAM) and pushes that, there is never a need to use LEA in an INVOKE statement and since it trashes a register (EAX) I consider it a flaw in MASM. I had demonstrated to Randall how to calculate the offsets on the other board and I believe that he has removed the LEA from HLA, no other assembler but MASM does this now AFAIK.
Posted on 2006-07-02 17:13:08 by donkey
Randy himself inserted the HLA into the "All About Arrays" section.

I, too, find it a little jarring to read descriptions from different points of views mixed together. The code itself I don't mind. However, commentary is needed to explain the "odd" code, and it got inserted into the main text.

We could move the text so that it doesn't clutter up the exposition. After all, there is a need to explain without hiding the details. Shortcuts ought to be treated as shortcuts, and probably separated out somehow.

That section does not use any of MASM's "high level" executable constructs. I've worked with too many assemblers that don't have such luxuries.

BTW, the forum for the wiki book is currently titled "x86 ASM Book Project", as there was an option to later convert it to PDF or some other publication format.
Posted on 2006-07-02 17:34:53 by tenkey
Well, my 2 cents is that everyone programs using the API no matter what assembler they use so EVERYONE is using a form of HLL ...

P
Posted on 2006-07-02 17:44:34 by PBrennick

Well, my 2 cents is that everyone programs using the API no matter what assembler they use so EVERYONE is using a form of HLL ...

P



Agreed. I get my "purist ASM fix" whenever I do my OS Dev stuff ;)
Posted on 2006-07-02 22:27:25 by SpooK
Donkey,

It calculates the offset relative to ESP or EBP (depending whether it is LOCAL or PARAM) and pushes that, there is never a need to use LEA in an INVOKE statement and since it trashes a register (EAX) I consider it a flaw in MASM. I had demonstrated to Randall how to calculate the offsets on the other board and I believe that he has removed the LEA from HLA, no other assembler but MASM does this now AFAIK.


    Could you point me to some specific discussion, link, or example of how this is done?  I would appreciate that.  Ratch
Posted on 2006-07-02 23:33:17 by Ratch
I just want to say that as somewhat of an ASM purist (I use invokes, and .IFs and all that jazz for now), HLA DOES need it's own seperate section, because I keep looking for non-HLA stuff, and of course, the Art of Assembly is in HLA, which is a major annoying for me, because I don't use HLA, and like to see stuff in it's native ASM format because as a new ASM coder, it helps me to see everything in (or close to) the form I use to code.
Posted on 2006-07-03 02:44:47 by Bobbias
To me this debate was always enevitable when so many assemblers/opinions are out there and no 'line was drawn' at the start.

Would this be an appropriate solution?
The asm book should be kept pure from ALL HLL Syntax with appendments made in each section describing assembler specific information?

At least this way the Assemblers presence in the would be entirely based on the users/developers commitment to it!
ie. not many people will throw up load of entries for an unknown assembler.

This would seem to me to be a resonable compromise. :)
Posted on 2006-07-03 06:59:37 by asmrixstar

Well, my 2 cents is that everyone programs using the API no matter what assembler they use so EVERYONE is using a form of HLL ...


Except that the core of the wiki book is not supposed to contain any API code.



I went and looked at Randy's entries again, and to tell the truth, he does not use "high level" code. It may look like high level code because of its syntax, but it really is low level code.

The things that bothered me were the entries about @size, @length, and @elements. They are in an inappropriate location, because no MASM equivalents are given as examples there. I generally feel it is important to know how to get sizes without such features. I have seen too many people make the off-by-one mistakes because they don't know which values they ought to be using. (Plus the MASM versions of @size and @length are limited by line length limits.)

Oops. It looks like SIZEOF is being used in the search/delete/insert element code. Some of that code needs to be redone anyways.

Posted on 2006-07-03 14:29:11 by tenkey
Yeah, The core is for ASM, regardless of what assembler you use. I actually think that asmrixstar's suggestion is a decent idea. We could have the page using pure ASM, and then sections outlining differences with different assemblers, and outlining the HLA syntax for whatever you're doing in pure ASM, for those who want HLA.

Or something to that effect, anyway.
Posted on 2006-07-03 14:43:27 by Bobbias
That is fine and dandy, but the Wiki book is there for *you* to help with, as well as read.

If you want satisfaction, start implementing those changes. This is how that Wiki book came to be in the first place, lots of people helped, not one person taking suggestions and implementing them.
Posted on 2006-07-03 17:42:15 by SpooK
I would definately help out if I had enough material to do something more than 3 or 4 lines, constituting a sorry excuse for a page. I have made a contribution, though a minor one, and I'll definately fix any spelling errors, and add minor details and stuff, but I don't really know enough by myself to write an entire page there. yet, anyway.
Posted on 2006-07-03 20:06:13 by Bobbias