Page 1 of 1

Hydrogen Assembler 0.1.x

Posted: Fri Oct 09, 2009 10:19 am
by f2
Hello guys,

It's been a month since I work on my own assembler, called Hydrogen Assembler. Today, I have released
the first alpha release of it e.g. the first version really usable. HyASM is very young, but it is already able to
build Windows executables. You can download it here.

Features:
- can produce PE 32-bit executables.
- can produce DLL libraries.
- can produce flat-binary files (for OS development).
- can encode 16 and 32 bits.
- can produce HX executables, the executable format of the next release of Hydrogen OS.

What's wrong?
- no 64-bit support.
- no HLL primivites.
- no conditional assembly directives.
- no macros support.
- only basic instructions are supported (no FPU, no MMX...)
- ... and many other things & bugs !

So, please feel free to test, bug report, suggest ideas, features request, etc... in this thread or in
my website.

>> Tommy

Re: Hydrogen Assembler 0.1.0

Posted: Fri Oct 09, 2009 11:47 am
by qw
Nice work, Tommy. I especially like the ease to import and export DLL symbols. Also the command line is very clear.

BTW in "dllhello.asm", DllStart should be stdcall calling convention: return with "ret 12" instead of a plain "ret". (It works fine, I guess Windows handles it well, but you'd better be sure though.)

Re: Hydrogen Assembler 0.1.0

Posted: Fri Oct 09, 2009 12:05 pm
by f2
Hobbes wrote:Nice work, Tommy. I especially like the ease to import and export DLL symbols. Also the command line is very clear.
Thanks for testing, Hobbes.
Hobbes wrote:BTW in "dllhello.asm", DllStart should be stdcall calling convention: return with "ret 12" instead of a plain "ret". (It works fine, I guess Windows handles it well, but you'd better be sure though.)
Yeah, that's right. But this is just an example! :wink:
This little mistake will be fixed when HyASM supports HLL primitives, such as PROC/ENDP.

Re: Hydrogen Assembler 0.1.x

Posted: Sat Oct 10, 2009 10:41 am
by f2
New version updated: 0.1.1

What's new?
- added "-d" option for dumping symbols list
- added support for control/debug registers
- improved HX executable format

Re: Hydrogen Assembler 0.1.x

Posted: Sun Oct 11, 2009 3:57 pm
by f2
New version updated again: 0.1.2.

What's new?
- fixed a critical bug with ORG directive.
- added support for local labels (you can define a local label like this: @Label).

Re: Hydrogen Assembler 0.1.x

Posted: Mon Oct 12, 2009 2:14 am
by qw
Just a suggestion...

I've always liked the dotted local label mechanism of NASM, such that

Code: Select all

label:
.foo:
becomes a globally accessible "label.foo" that is also locally accessible as ".foo".

What I would have liked even better is a cumulative mechanism, such that

Code: Select all

label:
.foo:
..bar:
is accessible as "label.foo.bar" and ".foo.bar" and ".bar".

BTW is there any documentation for your assembler? I'd like to know what directives there are.

Re: Hydrogen Assembler 0.1.x

Posted: Mon Oct 12, 2009 5:51 am
by f2
Hobbes wrote: I've always liked the dotted local label mechanism of NASM, such that

Code: Select all

label:
.foo:
becomes a globally accessible "label.foo" that is also locally accessible as ".foo".
I learned assembly with TASM. So, I usually use '@', and I prefer this instead of a dot. But I will add
the dotted mechanism in HyASM.
Hobbes wrote: What I would have liked even better is a cumulative mechanism, such that

Code: Select all

label:
.foo:
..bar:
is accessible as "label.foo.bar" and ".foo.bar" and ".bar".
This is a good idea. But I do not include this feature in HyASM. I want to make an easy, clear and
understandable syntax as much as possible. By dint of abusing sub-labels, we can get something like this:

Code: Select all

..........foo:
...........bar:
I think this is really ugly and not very understandable.
Hobbes wrote: BTW is there any documentation for your assembler? I'd like to know what directives there are.
HyASM documentation is being written. Could be included in the next version.

Re: Hydrogen Assembler 0.1.x

Posted: Mon Oct 12, 2009 8:29 am
by Creature
Tommy wrote:

Code: Select all

..........foo:
...........bar:
I think this is really ugly and not very understandable.
Ugly, indeed IMO, but isn't that relative and up to the programmer? It's pretty much the same as in C/C++, where some people think Java-style braces are ugly and prefer other styles and other people prefer the Java-style braces because they're used to it. Other programmers can be annoyed the hell out of it when they see the other style.

Re: Hydrogen Assembler 0.1.x

Posted: Mon Oct 12, 2009 9:02 am
by qw
Tommy wrote:I learned assembly with TASM. So, I usually use '@', and I prefer this instead of a dot.
I like this as well, especially the extremely local @@ label that may be referenced forward or backward as @F or @B respectively.
Tommy wrote:This is a good idea. But I do not include this feature in HyASM.
The decision is off course entirely yours, but I agree with Creature that it is up to the programmer to keep the code readable.
Tommy wrote:HyASM documentation is being written. Could be included in the next version.
Great, keep up the good work!