Page 2 of 2

Re: Hydrogen Assembler 0.2.x

Posted: Sat Oct 17, 2009 3:59 pm
by AaronMiller
That looks cool. Looks like it'll be quite useful. :) If you want any help with the assembler or your language (or w/e) let me know. :)

EDIT: Is it case sensitive?

Cheers,
-naota

Re: Hydrogen Assembler 0.2.x

Posted: Sat Oct 17, 2009 4:06 pm
by f2
I do not need help for now, thanks! I just need some testers...
AaronMiller wrote: EDIT: Is it case sensitive?
Instructions are case insensitive, and symbols are case sensitive (like HyASM).

Re: Hydrogen Assembler 0.2.x

Posted: Sat Oct 17, 2009 4:07 pm
by AaronMiller
Okay, cool. :) Good luck!

Cheers,
-naota

Re: Hydrogen Assembler 0.2.x

Posted: Sun Oct 18, 2009 9:51 am
by f2
New release: 0.2.5.

What's new?
- fixed a critical bug with DB and strings.
- MIPS: added new instructions.
- added specific variables:
OFFSET: get the offset in the current section.
BASEADDR: get the base address of the application.
SECTADDR: get the base address of the current section.
SECTSIZE: get the size of the current section.

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 4:08 am
by qw
Hi Tommy,
In the console example I tried to automatically calculate the length of the string:

Code: Select all

Hello:	db	"Hello, world!", 13, 10
Length	equ	$ - Hello
This caused the following error:

Code: Select all

Error: console.asm(55): invalid instruction or directive ("Hello").
Is this something still to be implemented?

Nice start with the manual. I think it's complete enough for people already familiar with assembly language. I'm not sure if I understand the RELATIVE operator though, and should OFFSET really be relative to some section?

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 4:21 am
by f2
Hi Hobbes,
Hobbes wrote: In the console example I tried to automatically calculate the length of the string:

Code: Select all

Hello:	db	"Hello, world!", 13, 10
Length	equ	$ - Hello
This caused the following error:

Code: Select all

Error: console.asm(55): invalid instruction or directive ("Hello").
Is this something still to be implemented?
HyASM doesn't support yet the '$' operator. I don't like the "name" : $. I should find a name more understandable,
like "ADDRESS" or something like that. I think I will made a new release today. Other thing, expressions must be
placed between parentheses.
Hobbes wrote: Nice start with the manual. I think it's complete enough for people already familiar with assembly language. I'm not sure if I understand the RELATIVE operator though, and should OFFSET really be relative to some section?
The RELATIVE operator is equivalent to the RVA operator in FASM. It get the relative address of a symbol to the base address
of the application. The manual will be updated, RELATIVE is not a variable. OFFSET contains the current offset in the
section. To be clear: OFFSET = $ - SECTADDR.

Tommy

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 4:27 am
by qw
Tommy wrote:OFFSET contains the current offset in the section. To be clear: OFFSET = $ - SECTADDR.
This differs a lot from the OFFSET operator in MASM and TASM syntax, doesn't it? I mean, the next two are equivalent in MASM but not in HyASM:

Code: Select all

	push	dword Hello
	push	offset Hello
(Not that MASM accepts "dword <symbol>" but you get the idea.)

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 4:36 am
by f2
Hobbes wrote: This differs a lot from the OFFSET operator in MASM and TASM syntax, doesn't it? I mean, the next two are equivalent in MASM but not in HyASM:

Code: Select all

	push	dword Hello
	push	offset Hello
(Not that MASM accepts "dword <symbol>" but you get the idea.)
In MASM/TASM, the OFFSET operator is used to get the address of a symbol. This is very different.

I forgot to implement something in HyASM: the EQU operator doesn't support expressions. :shock:
Will be fixed today.

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 6:06 am
by f2
New release: 0.2.6.

What's new?
- fixed a critical bug in expressions.
- EQU directive can handle expressions.
- added new assembler variable (ADDRESS).
- added new expressions operators:
& : bitwise AND
| : bitwise OR
^ : bitwise XOR
<< : bit shift left
>> : bit shift right
< : rotate left
> : rotate right

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 7:31 am
by f2
Tommy wrote: Perhaps I will begin my other project of a new programming language...
Perhaps I will merge this project to HyASM to provide a new high-level assembler syntax...

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 7:33 am
by qw
Tommy wrote:In MASM/TASM, the OFFSET operator is used to get the address of a symbol. This is very different.
Then I think you shouldn't call it OFFSET. It's confusing. How about INSECT?

Re: Hydrogen Assembler 0.2.x

Posted: Mon Oct 19, 2009 7:44 am
by f2
Hobbes wrote:
Tommy wrote:In MASM/TASM, the OFFSET operator is used to get the address of a symbol. This is very different.
Then I think you shouldn't call it OFFSET. It's confusing. How about INSECT?
INSECT?
Image
:D

About the MASM's OFFSET, it's confusing, yes, but I will not change. OFFSET means the current offset in section.
And in HyASM, OFFSET is not an operator. Or, I add one character before each variable to avoid confusion.
How about $OFFSET, #OFFSET... ?

Re: Hydrogen Assembler 0.2.x

Posted: Thu Oct 22, 2009 10:20 am
by AaronMiller
I like $OFFSET.

Re: Hydrogen Assembler 0.2.x

Posted: Thu Oct 22, 2009 10:23 am
by f2
AaronMiller wrote:I like $OFFSET.
OK. Will be changed for version 0.3.0.