Hydrogen Assembler 0.2.x

Programming, for all ages and all languages.
User avatar
AaronMiller
Member
Member
Posts: 81
Joined: Thu Mar 06, 2008 1:26 pm
Location: Roseville, California (USA)
Contact:

Re: Hydrogen Assembler 0.2.x

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

Re: Hydrogen Assembler 0.2.x

Post 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).
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
AaronMiller
Member
Member
Posts: 81
Joined: Thu Mar 06, 2008 1:26 pm
Location: Roseville, California (USA)
Contact:

Re: Hydrogen Assembler 0.2.x

Post by AaronMiller »

Okay, cool. :) Good luck!

Cheers,
-naota
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen Assembler 0.2.x

Post 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.
"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.2.x

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

Re: Hydrogen Assembler 0.2.x

Post 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
"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.2.x

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

Re: Hydrogen Assembler 0.2.x

Post 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.
"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.2.x

Post 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
"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.2.x

Post 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...
"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.2.x

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

Re: Hydrogen Assembler 0.2.x

Post 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... ?
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
AaronMiller
Member
Member
Posts: 81
Joined: Thu Mar 06, 2008 1:26 pm
Location: Roseville, California (USA)
Contact:

Re: Hydrogen Assembler 0.2.x

Post by AaronMiller »

I like $OFFSET.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: Hydrogen Assembler 0.2.x

Post by f2 »

AaronMiller wrote:I like $OFFSET.
OK. Will be changed for version 0.3.0.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
Post Reply