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
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Beta:

Go to http://benryves.com/bin/brass

Brass is a very simple assembler, just type

Code: Select all

brass <source name>
on the command-line to assemble a file to a binary (if you type "brass source.asm" it'll output "source.bin").

Make sure you do not have an important file in your folder called *.bin or *_labels.inc (where * is the filename of the sourcefile, no extensions) as Brass outputs to these files by default.

If you do, rename them just in case ;)

It is the same as running TASM with the -80, -i, -b and -x switches.
You can even add this code to your program:

Code: Select all

.binarymode TI8X
.variablename MYAPP
...and it'll output an 8XP instead of a raw binary. :) (you could also add .tivariabletype $07 and it'll output a TI picture, but that's not the point).


If you want to help a lot, please download this EXE:
http://benryves.com/bin/brass/BinaryComparer.exe
This (crap, simple, non-error trapping) EXE will compare 2 files and list any memory addresses that are DIFFERENT. This is important to debugging.
Running Brass with the -d switch will dump an output, so do this:

Code: Select all

brass source.asm -d > debug.txt
then open debug.txt and it will list (amongst other things) what it has assembled. In the long listing it will have addresses (eg starting at 9D93 with a TI-83+ app) in the first column, followed by the offset from the lowest address on the right. You can use this to see what it has assembled at which line to try and work out what is breaking it. A hex editor might also be useful, I use something called XVI32.

The following all compile fine:
-BF Interpreter
-Eliza
-Ben's 3D Maze
-Pixel Madness
-Acelgoyobis
-Gemini
-Asteroids
-API demo
-- a mixture of simple (to more easily catch bugs), massive and complex.

See the manual ( http://benryves.com/bin/brass/manual.htm ) for more information.

I am expecting there to be bugs. This project has not been running for very long (less than a week) and TASM was written over the period of many years ;)

I know you guys like them, so have a screenshot:

Code: Select all

D:\My Documents\Visual Studio 2005\Projects\Brass\Brass\bin>brass PINBALL.asm
Brass Z80 Assembler 1.0.0.0 - Ben Ryves 2005
--------------------------------------------
Pass 1 complete.
Interaction engine: 428
Rendering engine: 391
Physics code: 751
Menu code: 289
Graphics routines: 402
Keyboard handling: 50
Arithmetics: 266
Misc data: 341
Sprites: 153
Total executed code: 3851
Total data: 909
Pass 2 complete.
Errors: 0, Warnings: 0.
Done!
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

What a nice logo you have. I'm gonna test it now :D
Image
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Far out ben, a week?! That readme would have taken me a week alone! :).

Great stuff, will have to throw TASM out finally :D.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Great! I'll try it as soon as I've got some time for myself...
Manual wrote:# From Eliza: TASM assembles

.db "IVE",0,"YOU'VE",0
.db "YOUVE",0,"I'VE",0

as

.db "IVE",0,"YOU'VE"
.db "YOUVE",0,"I'VE"

Brass doesn't lose those NULs. I have verified it as a bug in TASM by moving the ,0 definitions onto a new line as .db 0, which TASM then assembles correctly.
TASM has a bug with 's. When you compile something like "Don't do that!",0 it'll lose the zero, unless you make it "Don",$27,"t do that!",0 Good to see that's fixed :P
Website wrote:Unlimited length macro/label names, unlimited string length, unlimited number of expressions when defining bytes and unlimited source inclusion depth. No silly restrictions, in other words!
Does that also mean that home/graph.output("Ow my fucking hell, it's actually working!") will do what it should instead of truncate after 16 chars? :)
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 »

tr1p1ea wrote:Great stuff, will have to throw TASM out finally :D.
I wouldn't be too hasty, kv's already helped locate a bug (.binarytype doesn't work - I must have messed it up somehow) and in a raw binary output of his project there are 4 different bytes. I'll be going through with a hex editor to work out where the difference comes from... this is a really tough project, as each fix has the possibility of breaking something else!

@kv: It was the only brass object I had to hand :)
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Timendus wrote:Great! I'll try it as soon as I've got some time for myself...
Manual wrote:# From Eliza: TASM assembles

.db "IVE",0,"YOU'VE",0
.db "YOUVE",0,"I'VE",0

as

.db "IVE",0,"YOU'VE"
.db "YOUVE",0,"I'VE"

Brass doesn't lose those NULs. I have verified it as a bug in TASM by moving the ,0 definitions onto a new line as .db 0, which TASM then assembles correctly.
TASM has a bug with 's. When you compile something like "Don't do that!",0 it'll lose the zero, unless you make it "Don",$27,"t do that!",0 Good to see that's fixed :P
Website wrote:Unlimited length macro/label names, unlimited string length, unlimited number of expressions when defining bytes and unlimited source inclusion depth. No silly restrictions, in other words!
Does that also mean that home/graph.output("Ow my fucking hell, it's actually working!") will do what it should instead of truncate after 16 chars? :)
There are no limitations in place, so that should work. Of course, I have no idea how watertight the macro preprocessor is (it's given me the most grief), so I was amazed that your demo.asm assembled :D
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Code: Select all

	graph.clear()
	graph.output("Outputting some text...")
	graph.output("Ow my gawd Brass rocks already :D")
	kbd.waitkey()
PTI wrote:Image
Need I say more? :) AND it doesn't crash in Latenite :P
Compile.cmd wrote:REM TI-83 AND TI-83 PLUS BUILD SCRIPT
CD "%SOURCE_DIR%"
SET PATH=%PATH%;"%COMPILE_DIR%"
ERRLOG START > "%ERROR_LOG%"
IF EXIST "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" DEL "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin"
ECHO Assembling %SOURCE_FILE%
BRASS "%SOURCE_FILE%" "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" | TASMERR /o >> "%ERROR_LOG%"
ECHO Linking...
8XPLINK ("%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin","%PROJECT_BINARY%") "%PROJECT_DIR%/bin/%PROJECT_NAME% - %BUILD_FILE_NOEXT%.8%1p" %2 /o /x >> "%ERROR_LOG%"
IF EXIST "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" DEL "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin"
MOVE *.lst "%PROJECT_DIR%/bin/"
ERRLOG END >> "%ERROR_LOG%"
Now I can finally properly use the latest Latenite 8)
Two little things though, I had to create the directory "bin" by hand, Brass didn't do that for me, and judging from the compile scripts, TASM does. The other thing:
Output screen wrote:------ Building: Source File: Brass test.asm, Script: TI-83 (Ion).cmd ------
Het systeem kan het opgegeven pad niet vinden.
Assembling Brass test.asm
Het systeem kan het opgegeven pad niet vinden.
Linking...
Er bestaat een dubbele bestandsnaam
of het bestand is niet gevonden.
------ Build Process Complete ------
Brass Z80 Assembler 1.0.0.0 - Ben Ryves 2005
--------------------------------------------
Pass 1 complete.
Pass 2 complete.
Errors: 0, Warnings: 0.
Done!
Linked 1 file successfully!
========== Build: 0 errors, 0 warnings ==========
Compiling gives a few errors, which has probably nothing to do with Brass or Latenite but with my ugly hack to get Latenite to work with Brass, but I thought I'd mention them anyway. They translate to "The system could not find the specified path" and "A double filename exists or file not found".
Last edited by Timendus on Mon 05 Dec, 2005 5:43 pm, edited 1 time in total.
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 »

Cool stuff ;) I'm expecting you to be the one to identify bugs in the macro preprocessor. I hope you'll find #elseifdef and #elseifndef especially useful too :)
Timendus wrote:
Compile.cmd wrote:BRASS "%SOURCE_FILE%" "%PROJECT_DIR%/bin/%SOURCE_FILE_NOEXT%.bin" | TASMERR /o >> "%ERROR_LOG%"
Emphasis mine - TASMERR might crash/do something odd as it's meant to translate TASM's output, not Brass's. Ultimately, Brass will be able to output a Latenite XML log directly, no special converters required (it's very easy to add as all error reporting goes through a single function, DisplayError()).
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Sorry, cross-edit :) See last post.

Anyway, those directives are really cool indeed :P It's getting more and more depressing that I have decided that at least the basic API functionality has to remain compatible with TASM :)
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
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 »

Cool, I tried it in my random coding folder, worked fine. But in my mode7 one it failed. I'm using dwedit.inc and it said it didn't understand bcall(_clrscreen).

Code: Select all

Error: Instruction 'bcall(_clrlcd)' not understood. [mode7.z80:16]
Errors: 1, Warnings: 0.
Build failed.
Here's a link to my folder so you can see the source.

What else should I be doing to test this, I'm real hopeful of it's development. :worship:
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Bugfixes

Post by benryves »

Same download link as before - main site for updates, manual documenting new features and the new executable.

Bugs fixed in:
-- expression parser - Durk's greyscale package now assembles correctly, as does the Al 3D engine demo democube.z80.
-- minor other parser bugs fixed.

New features:
-- Reusable labels.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Are those reusable labels a TASM thing? I can't remember I've ever seen anyone use 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: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Timendus wrote:Are those reusable labels a TASM thing? I can't remember I've ever seen anyone use that...
No. WLA-DX supports them (though without the curlies), but not TASM.

@Jim e: I just haven't had a chance to look at your code yet, I'm not ignoring you. ;-) I'll get around to looking into your problem tonight.
Kozak
Maxcoderz Staff
Posts: 791
Joined: Fri 17 Dec, 2004 5:33 pm
Location: On the dark side of the moon.
Contact:

Post by Kozak »

I like this one better then TASM already. Especially the macro part and the absence of the ' bug. This assembler could have saved me so much time when writing dialogue for TVF. This IDE will be incredible.
"They say that sea was created by a man named Maarten Zwartbol, a long time ago...." - Duck, an old Corbin version
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Kozak wrote:I like this one better then TASM already. Especially the macro part and the absence of the ' bug. This assembler could have saved me so much time when writing dialogue for TVF. This IDE will be incredible.
I'm glad you think so. :) I'm still expecting there to be numerous bugs dotted throughout the assembler, but I am doing everything I can to make the assembler more solid. I've discovered a worrying number of bugs in TASM (the jr z,$17 becoming jr z,$00 in TASM scares me!), but I do appreciate that an assembler is quite difficult to write.
TASM is still faster, but the slowest file takes about 2.5s in Brass on my PC, whereas TASM completes it in about 1/4 of a second. I wish I had an optimising compiler - everything I release is running in Debug mode. :(

Tonight, I aim to make error messages a little better when an expression fails, try to get Jim e's project to assemble, and if I have time fix the icon. I might also add some limitations on label names, _4$?!3+f{--}d: is a valid label name at the moment, which will only cause problems ;)

I'm still open to feature requests of course; highly specific things ("App support") are noted, but if I have no experience in them I will put them off (sorry!) until I understand them a little better (I want this to be a good assembler, after all). General features (such as the reusable labels) are really useful to know about, and little easy features (".dbsin to generate sine tables") will appear soonest.

Bug reports will always take priority over features.
Post Reply