Brass - 1.0.5.3 update [06/02/2014]

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

Moderators: benryves, kv83

Post Reply
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I had a question... If I compile something like

Code: Select all

ld a,a
would TASM/BRASS just skip the instruction, or is that a valid z80 instruction?

I ask this because some API macros look something like this:

Code: Select all

#define sine(val) ld a,val \ call sine
If I call this macro with

Code: Select all

ld a,5
sine(a)
it'll work properly, but I'm worried that this will be unoptimized.
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: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Code: Select all

ld a,a
is a valid instruction, $7F. I would not want to "optimise" this, as having the assembler strip it out would cause problems if people were, for example, using SMC and were expecting the byte to be there (for example, swapping it with $78 would change it to an ld a,b).

Here's a copy of the internal table: http://benryves.com/bin/brass/Z80.txt

I can't really think of a way around this, I'm afraid, but am open to suggestions.

EDIT: *has thought*: A directive to switch on/off "forced optimisation": so:

Code: Select all

#define sine(val) .optimiseon \ ld a,val \ .optimiseoff \  call sine
...the "optimiser" would strip out all redundant loads. However, this is really asking for trouble.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

benryves wrote:However, this is really asking for trouble.
And it would be TASM incompatible... :(
This could be a serious problem for the API... It doesn't attract advanced coders to throw away bytes...
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: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

1.0.0.2 update...

Post by benryves »

A little bug fix, a few minor features (well, Latenite support is not so minor) - http://benryves.com/bin/brass/Brass.exe is the link, as usual.

Jim e's mode7 will assemble if you comment out the .end at the top of Dwedit.inc that stops Dwedit.inc from assembling and therefore from defining bcall() macros.

Getting Brass to work in Latenite

Brass is significantly easier to get to work than TASM. It would be even easier if we used the integrated linker, but that requires more work from you and would render the source code non-TASM compatible. I don't think we're ready for a full switch just yet!

First, update to the latest build of Brass. Earlier builds are not Latenite-friendly. You will need to put Brass in the folder:

Code: Select all

{where you installed Latenite}\Compile\Brass.exe
Go to your project, and open up the Build folder. In there is Compile.cmd, open this in Latenite.
You'll see a line like this:

Code: Select all

TASM -80 -i -b "%SOURCE_FILE%" "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" | TASMERR /o >> "%ERROR_LOG%"
Put REM in front of it. This will now look like this:

Code: Select all

REM TASM -80 -i -b "%SOURCE_FILE%" "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" | TASMERR /o >> "%ERROR_LOG%"
This has commented out that line. If Brass gives you problems, you can remove the REM and go back to using TASM.

Now you need to put this line just underneath the line you just REMmed out:

Code: Select all

BRASS "%SOURCE_FILE%" "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" -x -o
The -x switch means "output an XML error log" and the -o means "do not write a header on the log file". You do not need to pass the variable "%ERROR_LOG%" as Brass picks this up automatically.

Save that, build as normal. The output binary should be just as TASM outputs it :)
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Re: 1.0.0.2 update...

Post by Timendus »

benryves wrote:First, update to the latest build of Brass. Earlier builds are not Latenite-friendly.
I tend to disagree ;):P
(Apart from the fact that I got it working with Latenite, the new Brass still gives me the same "file not found" errors, but it still compiles properly)

Anyway, very cool to see XML error output 8) How's outputting XML help files coming along?
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: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: 1.0.0.2 update...

Post by benryves »

Timendus wrote:...the new Brass still gives me the same "file not found" errors, but it still compiles properly)
Is this Brass, or is this the build script? Try REMming out any DELs, as that might be the cause... I get File Not Found errors, but these are not from Brass, rather from a DEL command in the build script not working.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Yes, I'm sorry, I should have been more careful in my choice of words :)
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: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Timendus wrote:Yes, I'm sorry, I should have been more careful in my choice of words :)
No problem, just as long as it's not a bug in Brass itself (the build scripts/templates are pretty ropey in Latenite anyway, and will be rewritten to accomodate some of the nicer features of Brass).
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Re: 1.0.0.2 update...

Post by Timendus »

benryves wrote:It would be even easier if we used the integrated linker, but that requires more work from you and would render the source code non-TASM compatible. I don't think we're ready for a full switch just yet!
If you'll be rewriting the build scripts anyway, you could easily use the integrated linker without make the source TASM incompatible by having the build script add the neccessary lines to the source in a temporary file, and compile that.
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: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

1.0.0.3

Post by benryves »

Timendus wrote:If you'll be rewriting the build scripts anyway, you could easily use the integrated linker without make the source TASM incompatible by having the build script add the neccessary lines to the source in a temporary file, and compile that.
Hmm, I sort of wanted to get away from the temporary file thing... the idea of Brass would be that it supported enough of TASM's directives so that old TASM users would not lose anything by switching, but that it offered enough new features to be worth the swap.

Anyway, we have version 1.0.0.3 with bugfixes and features... (same links as before, and a slightly less crappy colour scheme). .var can be used to easily declare variables inside saferam areas, and .asc can be used to translate strings from standard ASCII mapping to ASCII-mapping-of-your-choice on the target device (eg, swapping [ and theta on the TI-83 series automatically). Enjoy!
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Well, the other option is to include the neccessary directives in one of the Latenite include files, or in target.tgt. Anyway I think it shouldn't be too difficult to work around that.
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: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

1.0.0.4; Nothing major, just some trig table functions and warnings on dodgy label names.
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

http://benryves.com/bin/brass/ : 1.0.0.5; a few more output formats, RLE compression of files loaded through .incbin, optional external tables, list files, better handling of RST.
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Could incbin also sport start and length to include options?

I'll try to test this a bit more rigoursly later, currently though I am very optimistic that you will be setting the standards for future coders. :worship:
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Jim e wrote:Could incbin also sport start and length to include options?
Good idea! Maybe also a flag to swap word order (endianness) and a way to define an expression to perform an action on each byte (like the .asciimap, so rule={*}+1 would add 1 to each byte in the included file)?
Post Reply