News:

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

Assembler preferences

Started by Codec, May 05, 2009, 09:36:17 PM

Previous topic - Next topic

Codec

Well, 50 people have read my post asking exactly what software one needs to start learning HLA, and not one answer.  Additionally, others I have talked to say they have to interest in HLA.  So it makes me wonder:  is standard MASM32 that much better, even though HLA includes high-level syntaxes to simplify everything?  Is there a reason everyone prefers MASM32, or is it just because they are used to it?

Thanks,
-Codec

mitchi

HLA has a simpler syntax?

mov eax, 0  //MASM
mov(0, eax); //HLA

Tell me that HLA simplifies the syntax. DO IT .



dedndave

i looked onto HLA when i started learning 32-bit
i may have found it more interesting if it didn't simply avoid all the stuff i wanted to learn
i think it was intended to get beginners, especially college students, up and running in minimal time
but, you miss out on all the hard stuff


GregL

HLA is not Assembly Language.




Mark Jones

HLA or MASM is personal preference. Use (and learn) whichever seems more "natural" to you.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Farabi

I like MASM because it have simmilarity with a high level language, and its capability to use C macro.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

brethren

Quote from: mitchi on May 05, 2009, 10:07:54 PM
HLA has a simpler syntax?

mov eax, 0  //MASM
mov(0, eax); //HLA

Tell me that HLA simplifies the syntax. DO IT .




I agree, if randall hyde had stuck with the intel syntax (rather than inventing his own), hla would have been massively more popular.

The thing is hla really does have some nice high level features and for any MODERN asm programmer these features are a massive time-saver to the programmer (only to be used in none speed critical code, though).

As you can probably guess i'm not one of those rabid 'purity of assembler' guys :P

dedndave

I have a few simple questions for those that have implemented HLA....
It is done by a set of macros and libraries, no ?
HLA is not implemented by an assembler - is that a correct statement?

If so, it would seem that any particular feature you like from HLA could be
ported back to "the real world" by creating a set of macros and libraries.

Aren't you are still able to use normal syntax with HLA?

brethren

no you can't use intel syntax (as far as i'm aware) :(

btw hla is more of a compiler than an assembler and just like a compiler it creates an intermediate asm source file (which can be masm syntax as well as many other assemblers) this intermediate output is then assembled by whatever assembler you choose

this is how hla works as far as i understand it, feel free to flame if i've got it wrong :bg

mitchi

HLA has a free book and a big standard library. It's also portable across multiple operating systems.
That's actually really nice.
But I really can't digest this language's syntax.

dedndave

I wasn't aware that C or VB compilers spit out ASM source files as an intermediate step.
You may be able to request an optional ASM listing, but that would really slow down compilation.
Also, such a listing would not assemble without the inclusion of the libraries that accompany the compiler.
The "power" (if you want to call it that) of a compiler comes from the sytax itself AND the libraries
that are needed to convert the commands and statements into machine code.



brethren

Quote from: dedndave on May 06, 2009, 04:10:18 PM
I wasn't aware that C or VB compilers spit out ASM source files as an intermediate step.
You may be able to request an optional ASM listing, but that would really slow down compilation.
Also, such a listing would not assemble without the inclusion of the libraries that accompany the compiler.
The "power" (if you want to call it that) of a compiler comes from the sytax itself AND the libraries
that are needed to convert the commands and statements into machine code.



Off course to get an asm file you need to specify the right paramater on the command-line

i'm not sure about vb but c and c++ can easily show the generated asm file. heres how to do it with the free gcc compiler
http://www.delorie.com/djgpp/v2faq/faq8_20.html

I know it can be done with microsofts c++ compiler from the command line. this is what i've found googling

cl test.cpp /Fatest.asm

this should make CL compile the source file "test.cpp", with the /Fa option directing that an assembly-language listing file named "test.asm" be produced as a by-product


really simple c source
main()
{
int i;
int num = 1;
for (i = 1; i <= 10; ++i)
num *= i;

return 0;
}



asm generated by cl.exe
; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.30729.01

TITLE c:\Users\nicky\Desktop\test.c
.686P
.XMM
include listing.inc
.model flat

INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES

PUBLIC _main
; Function compile flags: /Odtp
_TEXT SEGMENT
_num$ = -8 ; size = 4
_i$ = -4 ; size = 4
_main PROC
; File c:\users\nicky\desktop\test.c
; Line 2
push ebp
mov ebp, esp
sub esp, 8
; Line 4
mov DWORD PTR _num$[ebp], 1
; Line 5
mov DWORD PTR _i$[ebp], 1
jmp SHORT $LN3@main
$LN2@main:
mov eax, DWORD PTR _i$[ebp]
add eax, 1
mov DWORD PTR _i$[ebp], eax
$LN3@main:
cmp DWORD PTR _i$[ebp], 10 ; 0000000aH
jg SHORT $LN1@main
; Line 6
mov ecx, DWORD PTR _num$[ebp]
imul ecx, DWORD PTR _i$[ebp]
mov DWORD PTR _num$[ebp], ecx
jmp SHORT $LN2@main
$LN1@main:
; Line 8
xor eax, eax
; Line 9
mov esp, ebp
pop ebp
ret 0
_main ENDP
_TEXT ENDS
END

Vortex

Consider also SolAsm. It's easy to use and can output portable executables.

BlackVortex

Noone mentioned Goasm ? One of the best options for 64bit asm coding ?

dedndave

@Mitchi
well - he asked about HLA - otherwise, i am sure it would have came up

@Brethren
wow! - look at all that code for a loop  :eek
and to think that the vast majority of the MS OS's are written like that
no wonder they are slower (and bigger) than they should be
i am a bit of a purist - i believe that much of an OS should be written in ASM
because it affects everything you run