MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7
Author Message
PostPosted: Wed 17 Sep, 2008 10:47 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4095
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
Image


Top
 Profile  
Reply with quote  
PostPosted: Wed 17 Sep, 2008 11:54 am 
Offline
Extreme Poster
User avatar

Joined: Thu 17 May, 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  
Reply with quote  
PostPosted: Thu 25 Sep, 2008 11:29 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
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  
Reply with quote  
PostPosted: Thu 25 Sep, 2008 10:29 pm 
Offline
Extreme Poster
User avatar

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


Top
 Profile  
Reply with quote  
PostPosted: Tue 21 Oct, 2008 12:56 pm 
Offline
Extreme Poster
User avatar

Joined: Thu 17 May, 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  
Reply with quote  
PostPosted: Tue 21 Oct, 2008 2:27 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
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  
Reply with quote  
PostPosted: Fri 24 Oct, 2008 1:06 pm 
Offline
Extreme Poster
User avatar

Joined: Thu 17 May, 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  
Reply with quote  
PostPosted: Mon 08 Dec, 2008 3:00 am 
Offline
New Member
User avatar

Joined: Wed 23 Apr, 2008 12:52 am
Posts: 74
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  
Reply with quote  
PostPosted: Mon 08 Dec, 2008 11:12 am 
Offline
Maxcoderz Staff
User avatar

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


Top
 Profile  
Reply with quote  
PostPosted: Tue 09 Dec, 2008 2:04 am 
Offline
New Member
User avatar

Joined: Wed 23 Apr, 2008 12:52 am
Posts: 74
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  
Reply with quote  
PostPosted: Fri 03 Dec, 2010 12:15 am 
Offline
Maxcoderz Staff
User avatar

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


Top
 Profile  
Reply with quote  
PostPosted: Fri 10 Dec, 2010 8:03 pm 
Offline
Regular Member

Joined: Sun 14 Sep, 2008 10:00 am
Posts: 88
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.


Top
 Profile  
Reply with quote  
PostPosted: Sat 11 Dec, 2010 12:24 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I'd recommend Spasm instead, to be perfectly honest. It's certainly more robust.


Top
 Profile  
Reply with quote  
PostPosted: Sat 11 Dec, 2010 10:06 am 
Offline
Regular Member

Joined: Sun 14 Sep, 2008 10:00 am
Posts: 88
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. ;)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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 ® Forum Software © phpBB Group | DVGFX2 by: Matt