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

Brass - 1.0.5.3 update [06/02/2014]

Post by benryves »

One logical step up for Latenite is to not have to be bundled with a 3rd party assembler.
Mainly because one (high profile!) user is having real problems getting the buggy TASM to work with it, and other people have expressed annoyance with TASM, (limited string length, limited label length, limited numbers of DBs, lack of features, buffer overflow crashes... the usual) I have decided that I need to write an assembler (BRASS).
WLA-DX is very nice but is geared towards console development and burning programs on ROMs, and defining a ROM bank map for a TI-83 Plus program is a bit silly. I will try and keep it as compatible with TASM as possible, so old TASM-geared code still compiles, but will add some new features.
Just to show that this isn't just an idea and that I am actually doing something about it, have an evening's work;
Image
(BRASS at the top, TASM at the bottom - not that it actually matters!)
A lot of work still needs to be done - supporting ZIDX/ZIX/ZBIT instructions (anything like BIT *,A or LD A,(IX*)) is a pretty important one, for starters. The expression parser (for things like "_label+21" needs to actually parse expressions (all it does at the moment is check for and substitute in labels or numbers). Directives for conditionals and macros (and macros themselves!) need to be worked in.

Currently supported directives: .org, .include (#include maps to .include), .locallabelchar and .module.

.include could do with some work, this will compile (or rather, it won't ever get into pass 2):

File: test.asm

Code: Select all

.include "test.asm"
I also need ideas for directives. Some are already in my mind (.dbsin, .include_once (like PHP's require_once()), .incbin)... What would you implement if you were writing a Z80 assembler?
Last edited by benryves on Fri 27 Jul, 2007 10:31 am, edited 36 times in total.
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 »

This is a great idea ben! More than 30 array elements per line would be a great feature, especially when strings are concerned.

Here is a nice TASM reference with a list of directives and stuff: http://home.comcast.net/~tasm/tasmman.htm
"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:

Re: BRASS - (maintainable) TASM compatible assembler.

Post by Timendus »

Ben, you rock! :P Why do you call it BRASS?
benryves wrote:one (high profile!) user
Smiles in silence :)
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
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Re: BRASS - (maintainable) TASM compatible assembler.

Post by kalan_vod »

Timendus wrote:Ben, you rock! :P Why do you call it BRASS?
benryves wrote:one (high profile!) user
Smiles in silence :)
B/c BRASS KICKS A**.
Ben this is looking sweet!
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: BRASS - (maintainable) TASM compatible assembler.

Post by benryves »

Timendus wrote:Why do you call it BRASS?
My initials combined with assembler. Maybe the lack of differentiation between arse (backside) and ass (donkey) in US English means this is a bad choice... :wink:
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 »

Did 'BRASM' ever cross your mind?
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

tr1p1ea wrote:Did 'BRASM' ever cross your mind?
Well, it's really Brass. I tend to stick to words that make sense (so a DOOM-like engine I was toying with was called "Broom").
Though, to be honest, the actual name is of little real importance!
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm

Post by CompWiz »

How about a poll with possible names? :mrgreen:

anyone have suggestions for names that could be put on the poll? :D
In Memory of the Maxcoderz Trophy Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

BRASS sounds good to me.
Image
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 »

I like brass, i think it's cool. A name suited for the project who's goal is to replace tasm. :)
Anyway, a project like this is LONG overdue. Ben if you achieve this you are my hero.

As for requests more support for Multipage apps and OSes.
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

I agree with Jim on all accounts :)
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
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

I'd really rather see Z80 added to NESHLA.
You know your hexadecimal output routine is broken when it displays the character 'G'.
User avatar
benryves
Maxcoderz Staff
Posts: 3089
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Main updates:
Expression parsing now works, but in a non-TASM way. The easiest approach I could think of was a simple recursion splitting up the expression by parentheses and operators. It doesn't add up in left->right order, thanks to this, and as a result unless you wrap everything in parentheses the order of operation is very odd.
Fixed bug where 16-bit operations declared in the table file weren't being flipped.
Z80 index (ZIX/ZIDX) instructions added.
Binary is no longer written in the order of instructions in the file: eg;

Code: Select all

.org 1
.db 'A'
.org 0
.db 'B'
...should produce BA, not AB.

Supported directives (anything in [brackets] is an alias):
.org
.include [#include]
.locallabelchar
.module
.db [.byte] [.text]
.dw [.word]
.block
.chk
.echo
.equ [=]
.export
.fill

What needs doing:
Not all ZBIT directives work at the moment :( I need a document on them (building an assembler without a machine-code reference is a stupid idea, after all!).
Macros! TASM is thankfully quite simple, just basic find-and-replace style macros.
TASM-like expression parsing (including substituting $ for current IP), as well as adding % ~ = != < > <= >= operators.
Dwedit wrote:I'd really rather see Z80 added to NESHLA.
The main priority for me is to get a really basic assembler that works like TASM, so I can get rid of TASM's oddities. In the same way that I can use WLA-DX to assemble TI projects, but it's not TASM compatible.
As for requests more support for Multipage apps and OSes.
I'm not sure what this would really require me to do, not ever having assembled a multipage app/OS.
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

Don't forget

.define [#define]
.ifdef [#ifdef]
.ifndef [#ifndef]
.else [#else]
.endif [#endif]
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:Don't forget

.define [#define]
.ifdef [#ifdef]
.ifndef [#ifndef]
.else [#else]
.endif [#endif]
Oh yes (see "What needs doing:") - macros.
Post Reply