Native 65C02 assembler? Portable to Commander X16?

Programming the 6502 microprocessor and its relatives in assembly and other languages.
pzembrod
Posts: 22
Joined: 05 Sep 2020
Contact:

Native 65C02 assembler? Portable to Commander X16?

Post by pzembrod »

Hi all,

a question or wish that recently came up in a discussion in one of the Commander X16 forums was for an assembler that could run natively on the X16. It seems that most available assemblers these days are cross assemblers, and also looking through the assembler tools section here at 6502.org I didn't see a likely candidate.

Alas, my former favourite assembler, ASSI/M, didn't seem to get open-sources, and I couldn't find any online traces of its author, Dirk Zabel, then from Berlin, either.

Does anyone here know of any assembler, written either in 6502 assembler itself or in something that could be compiled to 6502 (e.g. a C source not too long) ?

Cheers
/Philip
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by BigEd »

There's always BBC Basic, which contains an embedded assembler. It's quirky, compared to most others, but it was good enough to write Elite!

You don't need all that much OS support to run it as an assembler, but you need a little.

It's 16k: it's a full-fat Basic.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by drogon »

BigEd wrote:
There's always BBC Basic, which contains an embedded assembler. It's quirky, compared to most others, but it was good enough to write Elite!

You don't need all that much OS support to run it as an assembler, but you need a little.

It's 16k: it's a full-fat Basic.
Plus another 2K or so of stripped down/minimal OS required to actually get it to run... (It needs its own BRK handler as well as the basic character read/write, then you need to emulate/"nullify" all those other osbyte/osword calls in-case you accidentally type in a sound of vdu command... This is essentially how I bootstrapped it on my Ruby board - write the bare minimum then start to write larger programs and see what broke or what it needed (by tracing all as yet un-written osbye/osword calls), write it, repeat ...

I looked at this when the X16 was in its early days but the memory layout was somewhat challenging to make it work (8K paged banks - not impossible but a little trickier also the existing "kernal" would need it's own vectors changing - or patch BBC Basic - which I do for my Ruby '816 System).

What did people use on the PET/Vic-20 or C64? Couldn't one of those assemblers be ported and modified?

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
IamRob
Posts: 357
Joined: 26 Apr 2020

Re: Native 65C02 assembler? Portable to Commander X16?

Post by IamRob »

I came across a 65c02 assembler called, "Editor not included, Assembler". Which reads source from a text file to assemble. It is just over 5kb in size, but it does do 65c02 assembly.
Attachments
Assembler.dsk.zip
(23.51 KiB) Downloaded 212 times
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by BigEd »

Nice find! This might be the manual:
https://www.apple.asimov.net/images/pro ... er.shk.txt
pzembrod
Posts: 22
Joined: 05 Sep 2020
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by pzembrod »

Thanks a lot for the pointers; Editor Not Included Assembler looks really nice indeed, and great news! I found the original author. He has registered here in the forum and should show up as soon as his registration is approved.

Another 65C02 assembler that was brought to my attention is Bibo Assembler from the Atari world:
https://atariwiki.org/wiki/Wiki.jsp?pag ... 0Assembler
It's source is available, alas the manual is in German, and other than ENI which assembles file to file IIUC, Bibo Assembler assembles from and to memory.
Gragathaz
Posts: 3
Joined: 11 Feb 2021

Re: Native 65C02 assembler? Portable to Commander X16?

Post by Gragathaz »

Hello all! I'm the author of the ENI Assembler that pzembrod mentioned, and the link that BigEd gave is indeed its manual. I can't say how delighted I am to see interest in my work!

I'll be happy to wax nostalgic about it, but for now at least I'll try to keep things on topic. As understood correctly by pzembrod, it's a file-to-file assembler for the Apple //, my rationale being that you could use it to write object code larger than the available free RAM: its only significant memory limitation is the size of the symbol table. (I also wrote a utility to combine text files, so that you could write source code larger than the available RAM as well.) It doesn't do macros or conditional assembly or linking or local labels, but IIRC ORCA/M is the only native 8-bit Apple // assembler that ever did any of those. Outside of ORCA, mine does everything that every other Apple // assembler did, at least as fast, and often more flexibly. It uses standard notation for different data types, which can be mixed on the same line -- even strings. And, yes, it assembles 65c02 code. It was written specifically for Apple // ProDOS, but I believe it should be modular enough to be adaptable to other platforms without too much trouble. In fact, I would have ported it to the 8-bit Atari platform (my other love in the 6502 world), except that I couldn't find any low-level documentation for Atari DOS. And I still have its source code, which IIRC I commented prolifically. In short, my assembler could well be the sort of thing you're looking for.

Now for the downside: I started grad school a few years after I wrote it, and that and my subsequent career has put my Apple // hobby on hold ever since. I do still have all my original hardware, software, and documentation (including a hardcopy of the assembler source code) -- *somewhere* in storage. But I also have a two-year job overseas, waiting for me whenever COVID will allow me to get there, and other projects (the biggest being a semi-restoration of a 1968 Volvo 122S) that I want to get finished before I move. I do need to go through that storage unit before I leave, but it's a bit of a toss-up as to whether I'll find my assembler stuff amongst the hoard of other old-computer treasures I've amassed over the years.

So, where does that leave us? Best case is I get that Volvo running and registered, find the right things in storage, get hold of the appropriate Commander X16 documentation, and port my assembler and release it to the community, all with time to spare before I depart for Europe. Worst case is I have to leave before I can find anything relevant to low-level 6502 programming, and wish you the best of luck until I get a chance to dive back into the 8-bit world. In between those extremes, I might find enough to pass along to someone else to port it, and provide whatever advice or clarification I can. Regardless, unless you're running an Apple // emulator with ProDOS, you'll have to wait at least a little while before I can help personally.

In the meantime, though, I'm glad to have been pulled back into the quirky but elegant world of the 6502 (and, frankly, overjoyed that my little assembler project is what did it!), and I'll be happy to do whatever I'm able to in its community.
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by BigEd »

That's great to hear, Gragathaz - welcome, and I might just bump this thread every 5 years as a gentle reminder! (Things can go wonderfully slowly in this place.)
pzembrod
Posts: 22
Joined: 05 Sep 2020
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by pzembrod »

Hi Gragathaz,

welcome, glad to see you here; I'm super happy and excited that you are interested in dabbling in old 8 bits again with the rest of us.

Sounds like you have quite a bit on your plate getting your coming job in Europe and the transition there organized. Fingers crossed here that you get lucky with at least finding your old source code and enough equipment to transfer the code to a modern platform that might allow you to upload it to github or so. I'd be happy to try and lend a hand if I can.

Your plan with the old Volvo sounds great, btw. Wishing you best of success with that as well. I lived in Sweden for 7 years and drove a much younger but still old enough Volvo 245 there, and loved it.

Where in Europe are you heading? I'm based in Germany, south of Munich,
Gragathaz
Posts: 3
Joined: 11 Feb 2021

Re: Native 65C02 assembler? Portable to Commander X16?

Post by Gragathaz »

BigEd wrote:
That's great to hear, Gragathaz - welcome, and I might just bump this thread every 5 years as a gentle reminder! (Things can go wonderfully slowly in this place.)
Thanks! And good to know that I'm not under any pressure to get things done quickly…! That said, I think it only took me four months to write my assembler, so it's really a matter of access more than anything else. Well, that and getting things transferred across platforms: last time I was active with 6502-related stuff (15 years ago) I was quite disdainful of emulators — I much preferred the actual hardware. I logged onto the Internet using a 2400-bps modem on my Apple //c and browsed the Web by logging into a Unix system and using Lynx… I'm not sure what sort of tech is used to interface with old hardware, and I'd be surprised if there were any easy ways to get new hardware to read old media. But I'm sure others here have answers for that, eh?
pzembrod wrote:
welcome, glad to see you here; I'm super happy and excited that you are interested in dabbling in old 8 bits again with the rest of us.

Sounds like you have quite a bit on your plate getting your coming job in Europe and the transition there organized. Fingers crossed here that you get lucky with at least finding your old source code and enough equipment to transfer the code to a modern platform that might allow you to upload it to github or so. I'd be happy to try and lend a hand if I can.
Yeah, like I said, I'm busy, but others' interest is great motivation. :D
pzembrod wrote:
Your plan with the old Volvo sounds great, btw. Wishing you best of success with that as well. I lived in Sweden for 7 years and drove a much younger but still old enough Volvo 245 there, and loved it.
Thanks again — actually, with any luck (mostly regarding the weather) I might finally get it running this week…! Then I only have to rebuild the brakes… :P
pzembrod wrote:
Where in Europe are you heading? I'm based in Germany, south of Munich,
Awesome! I'll be in Prague, but my second language is German, and it'd be nice to tour around Europe a bit. Of course, I doubt I'll have any 8-bit hardware wth me, and definitely not my car, but I'm sure I'll figure something out… and you (and any other 6502 aficionadoes) are welcome to look me up if you're in Prague!
User avatar
floobydust
Posts: 1394
Joined: 05 Mar 2013

Re: Native 65C02 assembler? Portable to Commander X16?

Post by floobydust »

Gragathaz wrote:
pzembrod wrote:
Where in Europe are you heading? I'm based in Germany, south of Munich,
Awesome! I'll be in Prague, but my second language is German, and it'd be nice to tour around Europe a bit. Of course, I doubt I'll have any 8-bit hardware wth me, and definitely not my car, but I'm sure I'll figure something out… and you (and any other 6502 aficionadoes) are welcome to look me up if you're in Prague!
I traveled extensively around Europe, Middle East, Africa for 25 years... I also lived in Germany for a couple years in Reutlingen (just south of Stuttgart). I also got to spend a fair amount of vacation time around Europe and Eastern Europe. If you plan on traveling about, I can recommend many places. Prague is a lovely city! There are many other great places to visit in the Eastern block countries: Budapest, Bratislava, Rijeka, Split, Dubrovnik, Zagreb, Ljubljana, Maribor and several others. You're also close to Poland and Austria... Vienna is also a great city to visit. Granted, I could go on for pages on this stuff.... but you'll have a great time living over there.

As for 8-bit hardware.... I always bring one of my C02 Pocket SBCs with me... so I can always play and write code being connected to my laptop: https://github.com/floobydust/C02-Pocket-SBC
pzembrod
Posts: 22
Joined: 05 Sep 2020
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by pzembrod »

Gragathaz wrote:
I'm not sure what sort of tech is used to interface with old hardware, and I'd be surprised if there were any easy ways to get new hardware to read old media. But I'm sure others here have answers for that, eh?
I may have a bit of an answer. There's an odd FDC controller called Catweasel (https://en.wikipedia.org/wiki/Individua ... _Catweasel) which reportedly can read Apple][ disks. I actually own one, an Mk3, but I must shamefully admit that I haven't really used it yet, though it is installed in my old workstation, together with a 40 track 5.25 "" drive. In case you do find your Apple and the disks, don't find the time to get the data to a modern machine but do find the time to make a copy of a disk with source code, and would post it to me, then I'd be happy to try my hand at reading that disk (wouldn't want to risk this with an original).
Gragathaz
Posts: 3
Joined: 11 Feb 2021

Re: Native 65C02 assembler? Portable to Commander X16?

Post by Gragathaz »

Hello all -- sad to say, my storage unit has become a monster that eats things put in it without a trace... which is to say that all my 6502 stuff is in there, for certain, but it's not going to show itself until I get a house big enough to move all my things into. Hopefully that'll happen within a few years, but until then, I only seem to be able to find random things that aren't at all immediately useful. And I'm moving to the Czech Republic tomorrow, so further attempts to locate things in storage will have to wait. Hope that doesn't let you down too much -- as I might've said, I'm quite proud of my assembler, and would love to see it adopted more widely.
IamRob
Posts: 357
Joined: 26 Apr 2020

Re: Native 65C02 assembler? Portable to Commander X16?

Post by IamRob »

Gragathaz wrote:
Hello all -- sad to say, my storage unit has become a monster that eats things put in it without a trace... which is to say that all my 6502 stuff is in there, for certain, but it's not going to show itself until I get a house big enough to move all my things into. Hopefully that'll happen within a few years, but until then, I only seem to be able to find random things that aren't at all immediately useful. And I'm moving to the Czech Republic tomorrow, so further attempts to locate things in storage will have to wait. Hope that doesn't let you down too much -- as I might've said, I'm quite proud of my assembler, and would love to see it adopted more widely.
Thanks for your contribution to the software world. Your program has been on my computer for awhile now but have yet to use it. But did manage to scan through the code and it is well written.

Have yet to get around to editing it, but my ultimate goal is to turn it into a command-line application where both the source and assembly can be accessed quickly and easily with simple commands: EDIT source / ASSEMBLE source - from the prompt. With these changes and your permission to re-release it, I think it can be come as popular as Merlin.
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Native 65C02 assembler? Portable to Commander X16?

Post by fachat »

Welcome Gragathaz, and thanks for your contributions!

But back to the topic. I used to use my own @ASS assembler on the C64, which may somewhat fit the Commander X16, as it is based on Commodore BASIC (IIRC). http://www.6502.org/users/andre/misc/
It reads assembly source as input in the Commodore BASIC editor (incl. Tokenization...), can use source overlays for large sources, assembles into memory or file (see .OPT pseudo opcode), and can assemble itself. Open source.

André
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
Post Reply