MaxCoderz.org

Back in business




Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Wed Sep 17, 2008 10:47 am 
Maxcoderz Staff
User avatar

Joined: Thu Dec 16, 2004 10:06 pm
Posts: 3981
Location: I cant seem to get out of this cryogenic chamber!
But do you really *need* forward referencing?

_________________
"My world is Black & White. But if i blink fast enough, i see it in Grayscale."
Image


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Wed Sep 17, 2008 11:54 am 
Extreme Poster
User avatar

Joined: Thu May 17, 2007 4:49 pm
Posts: 395
Location: $4080
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.


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Thu Sep 25, 2008 11:29 am 
Maxcoderz Staff
User avatar

Joined: Thu Dec 16, 2004 10:06 pm
Posts: 2938
Location: Croydon, England
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:
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).


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Thu Sep 25, 2008 10:29 pm 
Extreme Poster
User avatar

Joined: Thu May 17, 2007 4:49 pm
Posts: 395
Location: $4080
Me? Not at all.


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Tue Oct 21, 2008 12:56 pm 
Extreme Poster
User avatar

Joined: Thu May 17, 2007 4:49 pm
Posts: 395
Location: $4080
Code:
label = 1
#module module
label = 2
#endmodule
#module fail
.echo module.label
#endmodule
fails with
Quote:
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.


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Tue Oct 21, 2008 2:27 pm 
Maxcoderz Staff
User avatar

Joined: Thu Dec 16, 2004 10:06 pm
Posts: 2938
Location: Croydon, England
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. :(


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Fri Oct 24, 2008 1:06 pm 
Extreme Poster
User avatar

Joined: Thu May 17, 2007 4:49 pm
Posts: 395
Location: $4080
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.


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Mon Dec 08, 2008 3:00 am 
New Member
User avatar

Joined: Wed Apr 23, 2008 12:52 am
Posts: 73
Location: Maine
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


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Mon Dec 08, 2008 11:12 am 
Maxcoderz Staff
User avatar

Joined: Thu Dec 16, 2004 10:06 pm
Posts: 2938
Location: Croydon, England
Not so much "better" as "different". It's rather buggy I'm afraid. :|


Top
 Profile  
 
 Post subject: Re: Brass 3.0.0.0 Beta 12
PostPosted: Tue Dec 09, 2008 2:04 am 
New Member
User avatar

Joined: Wed Apr 23, 2008 12:52 am
Posts: 73
Location: Maine
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 100 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
DVGFX2 By: Matt