If you use the installer, you should have some sample projects in your Documents directory (Documents\Brass Projects\Samples). If you open any of the .brassproj project files (double-click), hitting F6 should build them (F5 will run them). To debug you will need to copy ROMs into C:\Program Files\Brass\Debug\TI\ROMs (see ROMs.txt for information).

The easiest way to make new projects is to copy the sample directory, edit the .brassproj (it's just an XML file, any text editor will do) to the name of your program and work from that.

It's all a bit messy, but I don't have as much time to work on this (and everything else) as I'd like.

The way labels are handled and expressions are parsed is pretty lousy (eg labels can only be strings or doubles and when parsing expressions any unknown terms generate temporary labels which can confuse the assembler).

I'm glad you haven't asked about structs or array[index] type syntax as those are even more horribly broken. I'd very much like to rewrite this part of the assembler when I have time, with a more sensible parser and using full .NET objects as labels (which wouldn't break existing code as the assembler syntax would remain much the same, just would actually work).

Hmm, I've been thinking about a way to handle such forward referencing without breaking backwards compatibility

During the first phase (where macro processing happens):Generate a list with the footprints a label when you encounter one, a footprint are the labels of which the value of this label is dependent of.Now either:1) The label has not yet been registered: Mark the label as "Forward reference enabled"2) The label has already been registered: Mark it as "No forward reference allowed" (since "forward referencing" basically means a label has a universal value throughout the source, a redefinition will make the label ambiguous, instead this label will be treated as #defines)

Now before the second phase starts we're going to solve the label values:First delete all labels who are marked as "No forward reference allowed" (these will be re-calculated during the 2nd phase).Next create a new list of labels, these will hold the solved labels.

While the last iteration solved at least one label do:For each label check if all the labels its value depends on is calculated (ie, the labels are found in the solved labels list), if so calculate its value and add it to the list of solved labels.Repeat.

If there are still unsolved labels this means that there was a circular definition: Like "a=b\ b=a"

A nice idea, but there is only a single pass (stuff that needs to output data based on labels that may be defined in the future registers a delegate which is invoked at the end of the pass to insert the correct values). eg ".dw somelabel" says "reserve 2 bytes for me", and at the end of the pass the assembler invokes the delegate to retrieve the proper byte[2]. Macro preprocessing is done as statements are read in from the file in the same pass.

I still stand by my original point; the expression parsing bit and handling of labels needs to be completely rewritten. The expression parser relies on each and every label in an expression already existing (even x in x=1 has to exist beforehand, so there's lots of fudging around creating potentional temporary labels), which causes all sorts of issues. It would be much nicer to just have a label reference that may - or may not - have a value, and that value is only extracted at the last minute when it's actually needed.

Allowing for full .NET objects with properties and methods makes logical sense (see how PowerShell handles this for example). There's all sorts of hackery involved with labels either being strings or numbers (including the fun feature that 'a'+1 is 'a1', not 'b' as you may expect, you need to do 'a'*1+1) as well as creating constants (values that can't be changed). Again, proper .NET objects with conversion operators and member properties would help alleviate most of these problems.

Who is online

Users browsing this forum: No registered users and 2 guests

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