Brass 3 (Under Development)

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

Moderators: benryves, kv83

User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Timendus wrote:
Latenite 1 compatibility is just a temporary hack, ultimately I'd like to build a .NET-based IDE (Latenite 1 uses a lot of Win32 code). Hopefully Mono's WinForms will be up to the task. :)
Whiiiiiiee :mrgreen:
Can't want to transparently wobble Latenite in my Beryl/Compiz! :mrgreen:
They give us 3D composition and what do people do with it? Wobbling windows and Flip 3D. *sigh*
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I absolutely think it's brilliant :)
We've been imprisoned in rigid rectangular windows for far too long! Viva la revolución!
And it's not Flip 3D, it's The Cube, mind you! :P
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

no idea why i wrote to add .endpage... maybe to make it easier to support nested pages... no idea how usefull that can be... Just ignore it... :mrgreen:
benryves wrote:
driesguldolf wrote:Don't forget to release a "Hello World!" program! :D
(I never got the 'old' brass to properly compile a asm program, I kept using devpac8x for doing .bin->.8xp) :oops:
Hm, putting .binarymode TI8X \ .variablename "PRGMNAME" should be enough to turn a .bin->.8xp.
anyway, wouldn't it it better to make an .endpage directive?
I'm not sure what advantage that would have..?
What happens when u use .page n when you haven't yet defined that page?
The page number will be set (:$ = <page>) and the output and program counters will be set to zero.

As for what will be output, it depends on the output writer. The raw writer will just spit out a binary of all pages, Intel HEX will also emit a correct object file, but the rawpages directive requires that all pages be defined so it knows how to format each page. In the case of undefined pages it displays a warning that it found data on page X, but page X wasn't defined so it doesn't appear in the output.
And just to be sure, what output does this generate:

Code: Select all

  x=20
.for t is 0 to x
  .db t
  x=x-1
  t=t*2
.loop
0, 1, 3, 7, 15.
EDIT:
is this valid?

Code: Select all

.module x
  y=255 ; <-
.endmodule
.module x
  z=y
.endmodule
;Now should x.y=x.z=255
Yes. :) The logic is that the current module name is appended to all newly created labels (so, on the line y=255 it sees "y, hmm, don't know what that is, so I'll create a new label called "x.y").
And it keeps getting better ;)

:worship: :excited: :shock: :o :D 8) :twisted: :insane: :yes:
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

driesguldolf wrote:no idea why i wrote to add .endpage... maybe to make it easier to support nested pages... no idea how usefull that can be... Just ignore it... :mrgreen:
I don't know, if "nested pages" are useful (however you can nest pages) then I'd like to add support for them. I just don't know how you could nest them. :)
Timendus wrote:And it's not Flip 3D, it's The Cube, mind you! :P
I was referring to Aero's Flip 3D (compare to switcher which looks half as cool but is twice as useful). ;)

Anyhow; I've added the crude beginnings of a veradoc plugin (for documentation comments that follow the Vera coding standards). I've also added support for OS-provided encodings (you can specify a name or a code page number, see example).
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

benryves wrote:I was referring to Aero's Flip 3D (compare to switcher which looks half as cool but is twice as useful). ;)
Isn't that just the expose effect made popular by Mac OS? Beryl has that too. But you're right, Flip 3D is totally pointless, and it doesn't even "feel" right if you ask me. But as you may know I don't run Windows Vista, and I was referring to something more like this:
http://www.youtube.com/watch?v=ZD7QraljRfM
Anyhow; I've added the crude beginnings of a veradoc plugin (for documentation comments that follow the Vera coding standards).
I saw the Coding standards topic; that's going to be a pretty useful plugin :)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Well, I found a major architectural hole in Brass 3 over the weekend.

It's related to loading plugins. Basically, a plugin has to implement the following interface;

Code: Select all

namespace Brass3.Plugins {

	/// <summary>
	/// Defines the basic interface for plugins.
	/// </summary>
	public interface IPlugin {
		
		/// <summary>
		/// Gets the name of the plugin.
		/// </summary>
		string Name { get; }
	}
}
This means that each plugin has a property 'Name' that it has to expose, and this name is used as its directive name, assembler name, function name or whatever it is the plugin actually does.

To further cause problems, there's another type of plugin, IAliasedPlugin, that also requires string[] Names { get; } (ie, it needs to return multiple names). This is so that a single plugin can have more than one name (eg "db" and "dw" are handled by the same plugin).

So, that's a bit of a mess, and lots of plugins have this fairly ugly syntax:

Code: Select all

public class SomePlugin : IDirective {
    public string[] Names { get { return new string[] { "directive" }; } }
	public string Name { get { return Names[0]; } }
}
Not only is that ugly, but it exposes a fairly nasty bug to do with stopping particular plugins from being loaded when the project is loaded. Interfaces can only expose instance members, so to be able to extract the name from the plugin I'd have to load it anyway! Normally this isn't a problem (I can just ignore the plugin) but if the plugin attaches an event handler to a compiler event in its constructor it will still be executed even though the compiler can't see it.

So, the new design is much simpler: use attributes to specify the name of the plugin. In fact, if you don't bother to specify a name, just use the name of the plugin class instead. Thus;

Code: Select all

// Creates the directive .someplugin
public class SomePlugin : IDirective { }

// Creates the function hello()
[PluginName("hello")]
public class Goodbye : IFunction { }

// .quit/.die/.exit/.byee
[PluginName("quit"), PluginName("die"), PluginName("exit"), PluginName("byee")]
public class Exiting : IDirective { }
As the names are attached to the plugin type via attributes rather than instance members I can get the name of the plugin without creating an instance of it. :)

I've reimplemented reusable labels; they are rather better supported in Brass 3 and so the following is valid:

Code: Select all

-
    ; stuff
    jr -   ; Valid in Brass 3
    jr {-} ; Still valid in Brass 3
...which is also supported by WLA-DX. If you want to have more than the reusable label in an expression (eg 1 + -) you still need to escape it à la Brass 1 (1+{-}).

I rewrote the Z80 assembler pretty much from scratch; it had been poorly hacked out of Brass 1. The new one is a lot more robust, and I added some limited .addinstr support for include files that use it.

I complemented the latenite1errors plugin with a latenite1debug one; now projects can be built and run with F5 from Latenite once more.

Of course, they now simply crash as the output binaries don't always match... I'm working on it!
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Well, that was easy: a broken .align directive that only modified the program counter and not the output counter, not to mention it leaving a hole in the output where it skipped bytes. :) Now it seems to be building old Latenite + Brass 1 source files properly (with some adjustments where Brass 1 features have changed slightly).

To fix the holes-in-the-output bug, .contiguous is a new directive plugin.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

On the subject of having holes in the output of Brass; did you get my e-mail to the mailing list about the broken Vera binaries..?

Good to see Brass 3 coming along by the way, I'm starting to look forward to it more and more :) Perhaps it would be worth the trouble of sending me a binary to check if Mono will run it under Linux?
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Timendus wrote:On the subject of having holes in the output of Brass; did you get my e-mail to the mailing list about the broken Vera binaries..?
Hm, this one?
- console.something doesn't work with this version of Brass (it thinks "console" is a label and "something" is another), so I've changed all periods into underscores.
I'll take a look into it.
Good to see Brass 3 coming along by the way, I'm starting to look forward to it more and more :) Perhaps it would be worth the trouble of sending me a binary to check if Mono will run it under Linux?
Good plan. I had Mono set up in a VM, but it's probably easier if I throw you the stuff to play with (private beta, if you will).
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

OK, now that is serious! :(
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Quite nasty. Fortunately, the adresses after $41 are correct relative to each other, so I just jump there instead of using the faulty label, and all seems to work... Of course we need to fix this before any real hardware will accept it, and interrupts seem to jump to the wrong place too...
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

I committed Brass 1.0.4.12 to the repository. Tell me if that works for you. :)
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

You scared me there :) My source didn't work anymore all of a sudden, turns out the new Brass works properly and I needed to remove my fix ;) Thanks!
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post by driesguldolf »

I hope after all this mess you can still work on Brass 3

Here's some more stuff to fill your weekends with :P

it looks much better quoted :)
I wrote:
  • #### in Brass Help Viewer\Directives\asciimap ####

    A square instead of an arrow in the fourth example
  • #### Forward reference error ####

    Brass 3 builder gives

    Image Label 'libs_end' not found.
    ;
    ; .echoln "Libraries: ", libs_end-libs_start, " bytes (smc: ", smcsize, " bytes)."
    ;

    libs_end is defined 3 lines below it
    strange, libs_start is defined directly below that line and it doesn't give an error...
  • #### Translations ####

    Brass mixes translations (stuff not yet translated so Brass uses the default language?)

    Image File 'file\goes\here' not found.

    Should be (in Dutch)

    Image Bestand 'file\goes\here' niet gevonden.
  • #### Suggestions ####

    I assume Brass automatically detects the language of your computer,
    but it would be nice if one could select the language he wants himself

    A recompile button in Brass 3 Builder window
Post Reply