Brass 3.0.0.0 Beta 13

One suite to code them all. An complete IDE and assembler for all your z80 projects!

Moderators: benryves, kv83

Post Reply
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by tr1p1ea »

But do you really *need* forward referencing?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by driesguldolf »

I would love to, really, but the only languages I know are z80 asm, tibasic, visual basic and Scheme... Going to learn decent C++ this year in class, I'm already looking forward :)
tr1p1ea wrote:But do you really *need* forward referencing?
Yes. :P

It becomes necessary when you need a label that is defined in terms of $ earlier then where it is defined.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by benryves »

Would you object to requiring .NET 3.5? I've been playing around with some of the exotic stuff in System.Linq.Expressions (which was added in 3.5) which adds all manner of exciting bits and bobs. For example:

Code: Select all

static object Add(object a, object b) {
	var Parameters = new[] {
		Expression.Parameter(a.GetType(), "a"),
		Expression.Parameter(b.GetType(), "b"),
	};
	var Adder = Expression.Lambda(Expression.Add(Parameters[0], Parameters[1]), Parameters).Compile();
	return Adder.DynamicInvoke(a, b);
}
That will add any two objects together (in .NET anything can be put into an object, be it a class or structure or one of the built-in primitives). As long as the types of the two objects can be added to eachother, that will work (and if not, it throws an exception).
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by driesguldolf »

Me? Not at all.
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by driesguldolf »

Code: Select all

label = 1
#module module
label = 2
#endmodule
#module fail
.echo module.label
#endmodule
fails with
X Label 'fail.module.label' not found.
.echo module.label
This shouldn't happen, right?

I'm pretty sure this was mentioned somewhere... meh, posting it just to be sure.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by benryves »

Labels work by searching within the current module then working out. So, when you say label = 2 within module that searches for module.label, can't find one, then searches outside, finds label, and assigns 2 to it instead of creating a new one.

There's not really an easy way out of it, without introducing an extra directive or function (.local label 2 to force the label local?) This is part of the bug that means that all labels are evaluated as soon as they're seen, so the parser can't tell the difference between an assignment and just taking the value of something until the very last moment.

Yes, it's a bug. :(
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by driesguldolf »

Heh, found another one:

For example, take this define:
#define MACRO(x) ld a,x\ sub 2

This gives the error "label x not found" when used.

Apparently, brass doesn't see \ as a seperator, causing the substitution to fail (it only substitutes whole words). Inserting a space fixes this problem.
User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Re: Brass 3.0.0.0 Beta 12

Post by waeV »

Wow, I just d/led this today. SO much better than TASM.
My ethicator machine must have had a built-in moral compromise spectral release phantasmatron! I'm a genius!
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: Brass 3.0.0.0 Beta 12

Post by benryves »

Not so much "better" as "different". It's rather buggy I'm afraid. :|
User avatar
waeV
New Member
Posts: 74
Joined: Wed 23 Apr, 2008 12:52 am
Location: Maine

Re: Brass 3.0.0.0 Beta 12

Post by waeV »

Well, I haven't compiled anything yet. I really like the help section, though. It's a lot easier to look up a command as I need it than to follow a course, especially as I understand basic programming concepts. I don't need to learn what an if statement is, just how to command one.
My ethicator machine must have had a built-in moral compromise spectral release phantasmatron! I'm a genius!
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: Brass 3.0.0.0 Beta 13

Post by benryves »

I've released a new beta of the assembler to the website. This fixes a bug with multiple forward-references in a single data statement and slightly improves the bundled TI calculator templates and include files. These are issues I've run into when developing Nostromo.
Galandros
Regular Member
Posts: 88
Joined: Sun 14 Sep, 2008 10:00 am

Re: Brass 3.0.0.0 Beta 13

Post by Galandros »

benryves wrote:I've released a new beta of the assembler to the website. This fixes a bug with multiple forward-references in a single data statement and slightly improves the bundled TI calculator templates and include files. These are issues I've run into when developing Nostromo.
Seems nice. I may look a second time to Brass. I know it has interesting features.
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: Brass 3.0.0.0 Beta 13

Post by benryves »

I'd recommend Spasm instead, to be perfectly honest. It's certainly more robust.
Galandros
Regular Member
Posts: 88
Joined: Sun 14 Sep, 2008 10:00 am

Re: Brass 3.0.0.0 Beta 13

Post by Galandros »

benryves wrote:I'd recommend Spasm instead, to be perfectly honest. It's certainly more robust.
There could be some interesting things to implement in SPASM via macros. ;)
Post Reply