Jump to content
IGNORED

RMAC - The grandchild of MADMAC assembler finally gets 6502 support!


ggn

Recommended Posts

Hello,

 

After a couple of afternoons' work, RMAC (the offspring of Atari's MADMAC assembler) has 6502 support! It's a cross assembler so no native 6502 version I'm afraid.

 

What is RMAC?

 

To quote the manual:

 

RMAC began its life as MADMAC. It was initially written at Atari Corporation by programmers who needed a high performance assembler for their work. Then, more than 20 years later, because there was still a need for such an assembler and what was available wasnt up to expectations, Subqmod and eventually Reboot continued work on the freely released source, adding Jaguar extensions and fixing bugs.

 

And of course recently 6502 support was added back!

 

Why do this?

 

A couple of reasons. First of all the original MADMAC did support 6502 code generation so it was a "simple" matter of adding the code back (plus fixing a few things). Another reason was because a couple of people that use rmac as their main 68000 assembler and got really cozy with it, while at the same time wanted a 6502 assembler. Finally, we thought there wouldn't any harm done whether people used it or not as it wasn't too much of an effort!

 

What you get

  • Equates, symbols and local labels.
  • ASCII/Atari 800 Internal strings - following the convention mads uses ("foo" for ASCII, 'foo' for internal encoding).
  • Poweful expression evalutator - integer only for now and left-to-right evaluation but with virtualy no limit on the complexity of the expression!
  • Conditionals to omit code sections from assembly, also via external defines.
  • Powerful macros - featuring named parameters, as many parameters as you wish, chained evaluation (macros within macros), unique label name generation and much more!
  • All the standard 6502 addressing modes.
  • .xex (or com/exe if you prefer) output.
  • Comprehensive manual, describing the syntax of macros and everything else in detail: http://d-bug.mooo.com/various/rmacman/rmac.html
  • That warm fuzzy feeling that you're using an Atari product at heart :D.
  • Probably some bugs!
What you don't get
  • The character star (*) as program counter. Sorry! You can work around this by using labels though...
  • Undocumented instructions (can probably be added easily if people really need them)
  • 6502 variants instructions (again, can be added if people are serious about using rmac)
  • Not much testing! It was tested with a sample source that assembles all instructions and their addressing modes, plus a few other sources but that's about it. Bug reports welcome!
Get it!

 

So you want to give it a shot? Head over here and get the latest build (1.6.4 at the time of writing), or if you want to build it on linux platforms get the source by cloning this git repository.

 

Remember that by default 68000 mode is enabled so you have to use the ".6502" directive at the top of your source, otherwise you might see a couple of errors!

 

Thanks

 

First of all, thanks to Landon 'lmd' Dyer for making the sources available. It really is a pleasure to work with them :). Also thanks to anyone that decides to give this a spin. And most of all thanks to anyone offering constructive criticism and/or praise!

 

[EDIT] AA editor mangled the download URLs somehow, sorry.

Edited by ggn
  • Like 4
Link to comment
Share on other sites

Cool project. Too bad a more recent version of the source code for MadMac, than what Landon had, wasn't available. Never the less, good that he was able to come up with what he did.

 

The RMac source code link you posted above just gives a blank page.

 

Weird, the link works here. Here's a direct link in any case: http://virtualjaguar.kicks-ass.net/builds/rmac-1.6.4.zip

 

As for not having the latest source: yes it does suck a bit but it's no big loss - whatever feature the madmac from the Jaguar devkit had, we recreated it more or less. Plus we fixed a lot of issues and shortcomings and extended some things too. So I think it's not too bad :).

 

 

How does this assembler compare with AMAC?

 

-Thom

 

I'm by no means an expert on 6502 assemblers but I would expect the syntax to be close to amac. Other than this: rmac can assemble stuff really quick (no surprise there I suppose!), it has a stack-based expression evaluator that can probably evaluate expressions as large as you can feed it since it allocates memory dynamically. REPT and MACRO directives can also be nested (and of course you can put macros inside repeats etc) so I can also no think of many restrictions there. It can include external files, etc. The only real drawback from what I gather is the omission of "*" for program counter as I mentioned above

 

Not sure if this covers your question. Probably the easiest thing to do would be to toss it a few sources and see how badly it chokes up :).

Link to comment
Share on other sites

The RMac source code link you posted above just gives a blank page.

 

Weird, the link works here. Here's a direct link in any case: http://virtualjaguar.kicks-ass.net/builds/rmac-1.6.4.zip

 

I had no problem downloading the RMac compiler executable, it was the Source Code link that failed.

 

 

As for not having the latest source: yes it does suck a bit but it's no big loss - whatever feature the madmac from the Jaguar devkit had, we recreated it more or less. Plus we fixed a lot of issues and shortcomings and extended some things too. So I think it's not too bad :).

 

That's good to know. I guess I was judging by some of the Comments Landon made when he was posting the original source code. But I know it's common for coders to downplay the quality of their own source code when it's not up to the higher standards they would feel more comfortable presenting. It sounds like quite a bit of work has gone into RMac.

 

Link to comment
Share on other sites

I had no problem downloading the RMac compiler executable, it was the Source Code link that failed.

Heh sorry, I was a bit tired when I read your post :). It's a git repository so you need a git client (graphical or cli) and clone the repository. Simply typing

 

git clone http://shamusworld.gotdns.org/git/rmac
will do the trick! Edited by ggn
Link to comment
Share on other sites

Heh sorry, I was a bit tired when I read your post :). It's a git repository so you need a git client (graphical or cli) and clone the repository. Simply typing

git clone http://shamusworld.gotdns.org/git/rmac
will do the trick!

 

Thanks, I didn't realise a client was required. I'm just used to going to people's pages and digging out an archive to download.

Link to comment
Share on other sites

Thanks, I didn't realise a client was required. I'm just used to going to people's pages and digging out an archive to download.

Well, if you clone the repository then the bonus feature is that you have all the versions together :). But I suppose if people prefer source archives we can probably do that too.

Link to comment
Share on other sites


That's pretty neat. My God, that stuff is 30 years old, and people are still hacking on it? Yike.


Here's a little history about that mode.


I have a habit of putting contractors out of work. The 68K stuff in MadMAC was nearly done when I got wind that someone in the group doing the 7800 (on the other side of Building 1196 -- it might have been Richard Frick's group) had hired a contractor to write a 6502 assembler, since there was nothing very good available for developers to do cross-assembly with.


I'd written a series of assemblers as a hobby over the past couple of years, and now had nearly finished MadMAC, and my curiousity got the better of me. I wondered "What does an assembler written by a professional contractor look like? I'll bet there are some cool techniques, and hey, we own the source code, so..."


I was system operator on the VAXes we were using, so I logged in as superuser, dug into the contractor's account and started reading what they'd produced. The contractor (a couple of guys, actually) had taken several weeks and so far only had some notes and a little bit of code. It was clear that they had never written an assembler before and had little idea what they were doing. Their assembler was going to take 3-4 months to finish, and it wasn't going to have conditionals, or macros, or listings. In short, it looked like my Hobby Assembler #2 (which I thought was unusable for production). I was sorely disappointed.


I was not impressed. Honestly, it was depressing to see how prosaic their effort was. I was kind of mad that we were paying some not-very-with-it guys money to do a miserable product. (That's assuming they *would* be paid, which was not exactly a sure thing in those days, at Atari, by the way).


So I told Rich that he he might not need those guys. "I can do that work in week or two." He didn't believe me, so I just did it, over the next week or so. It was easy because most of the assembler infrastructure was already there in the MadMAC code, and being slightly angry (and having three or four other hobby assemblers under my belt) made it even easier. Then I told Rich, "Hey, we've got a 6502 assembler now, you don't need those contractors." It took a little convincing, but in the end we saved the company a chunk of money, and MadMAC's 6502 mode, clunky as it was, was almost certainly better than the tool we would have gotten from the contractors.



I said it was a habit, to put contractors out of work, so here's another example.


  • Like 7
Link to comment
Share on other sites

 

That's pretty neat. My God, that stuff is 30 years old, and people are still hacking on it? Yike.
Here's a little history about that mode.
I have a habit of putting contractors out of work. The 68K stuff in MadMAC was nearly done when I got wind that someone in the group doing the 7800 (on the other side of Building 1196 -- it might have been Richard Frick's group) had hired a contractor to write a 6502 assembler, since there was nothing very good available for developers to do cross-assembly with.
I'd written a series of assemblers as a hobby over the past couple of years, and now had nearly finished MadMAC, and my curiousity got the better of me. I wondered "What does an assembler written by a professional contractor look like? I'll bet there are some cool techniques, and hey, we own the source code, so..."
I was system operator on the VAXes we were using, so I logged in as superuser, dug into the contractor's account and started reading what they'd produced. The contractor (a couple of guys, actually) had taken several weeks and so far only had some notes and a little bit of code. It was clear that they had never written an assembler before and had little idea what they were doing. Their assembler was going to take 3-4 months to finish, and it wasn't going to have conditionals, or macros, or listings. In short, it looked like my Hobby Assembler #2 (which I thought was unusable for production). I was sorely disappointed.
I was not impressed. Honestly, it was depressing to see how prosaic their effort was. I was kind of mad that we were paying some not-very-with-it guys money to do a miserable product. (That's assuming they *would* be paid, which was not exactly a sure thing in those days, at Atari, by the way).
So I told Rich that he he might not need those guys. "I can do that work in week or two." He didn't believe me, so I just did it, over the next week or so. It was easy because most of the assembler infrastructure was already there in the MadMAC code, and being slightly angry (and having three or four other hobby assemblers under my belt) made it even easier. Then I told Rich, "Hey, we've got a 6502 assembler now, you don't need those contractors." It took a little convincing, but in the end we saved the company a chunk of money, and MadMAC's 6502 mode, clunky as it was, was almost certainly better than the tool we would have gotten from the contractors.
I said it was a habit, to put contractors out of work, so here's another example.

 

FWIW - my company hasn't been able to , in 5 years, find anyone worth a shit to help with code my brother and I maintain. It's business software. I consider myself a metal worker and welder, not a coder. Sad state of affairs, but it keeps me employed at nearly five times the salary I made welding and doing construction work. I still don't consider myself "good".

Link to comment
Share on other sites

 

That's pretty neat. My God, that stuff is 30 years old, and people are still hacking on it? Yike.

 

I know you kind of disowned the code base judging from the article on your site! To be honest before I started looking at the code I expected to find hacked stuff tied on a string, hammered enough till it worked. And well, in some cases it was like that. But in general it's very well thought out, the whole thing reeks of "have done this before, got bitten bad by some decisions, making it right this time".

 

The "line parser"-tokenizer-"handle opcodes and keywords"-fixups-"object code" is very clever. adding new keywords and mnemonics (hell, even new architectures) takes very little effort, and much less code than someone would guess first. Stuff like macros, repeats, conditional code, expression evaluator can be used in all architectures supported. So when adding a new architecture it's like you have most of the things that make an assembler great out of the box without even trying :).

 

I started working on the codebase when a group of people needed a good 68000 cross assembler for the Atari ST. The only other choice we had was still very buggy and imposed weird limitations so we got sick of it. In comparison rmac is much less buggy and about 3x faster: it's very satisfying to see your code assembling before you lift your finger off the enter key! And feature wise, I still haven't seen .init and .cargs in another assembler, ever.

 

So for a 30 year old thing I think it has aged quite well. Again thanks for releasing the code and feel free to clone the repository so you can witness the fruit of your loins :).

  • Like 2
Link to comment
Share on other sites

FWIW - my company hasn't been able to , in 5 years, find anyone worth a shit to help with code my brother and I maintain. It's business software. I consider myself a metal worker and welder, not a coder. Sad state of affairs, but it keeps me employed at nearly five times the salary I made welding and doing construction work. I still don't consider myself "good".

 

I'll equate this with something else. I moved to Germany speaking no German whatsoever bar a few words. I knew that I knew nothing about German.

 

I then learnt a few key phrases to get around, I thought I was getting OK.

 

Then I mixed those phrases up into different orders and said, "Hmm...I'm getting good".

 

Then I started to socialise with Germans, then realised I wasn't good at all.

 

Then my German progressed a fair bit, though I thought that I was staying still. But then I started to watch the TV and realised I knew very little.

 

In the meantime, my English friends are all amazed at my German and think that I am speaking perfect German with Germans. The Germans made allowances, but I got my point across.

 

My first German teacher thought that I was useless as she was teaching me to be perfect. The 2nd allowed me imperfections as long as I felt more comfortable in actually speaking.

 

After all that, my point is: You can always compare yourself with someone else and realise that you're not good in comparison, but how well are you getting along? If you're making a business out of it, you're doing well. There could be a far better traditional coder, but if they've produced nothing and never sold anything (via themselves or the business that they're in), they've not succeeded.

 

You've done well.

 

On another note, without being rude, a metal worker no matter how good that they are will only earn a certain amount. Actually anyone that works for anyone else is limited. A metal worker who owns their own business may no longer be restricted, like a programmer with their own company.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...