Hydrogen Assembler 0.1.x

Programming, for all ages and all languages.
Post Reply
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Hydrogen Assembler 0.1.x

Post 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
Last edited by f2 on Sun Oct 11, 2009 4:25 pm, edited 2 times in total.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hydrogen Assembler 0.1.0

Post 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.)
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen Assembler 0.1.0

Post 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.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen Assembler 0.1.x

Post 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
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen Assembler 0.1.x

Post 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).
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hydrogen Assembler 0.1.x

Post 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.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen Assembler 0.1.x

Post 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.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Hydrogen Assembler 0.1.x

Post 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.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: Hydrogen Assembler 0.1.x

Post 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!
Post Reply