max65 macro cross-assembler for 65xx CPU

handy tools that can assist in the development of new software
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

Soft launch of max65 v0.10, my macro cross-assembler for 65xx CPU (6502 only at the moment) https://github.com/0xC0DE6502/max65-releases

I am looking for a few 6502 coders that are willing to seriously test max65 and report any bugs in the assembler and its user guide.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
gfoot
Posts: 987
Joined: Tue Apr 14, 2020 9:05 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by gfoot »

0xC0DE wrote: Tue Feb 14, 2023 11:47 pm Soft launch of max65 v0.10, my macro cross-assembler for 65xx CPU (6502 only at the moment) https://github.com/0xC0DE6502/max65-releases

I am looking for a few 6502 coders that are willing to seriously test max65 and report any bugs in the assembler and its user guide.
Cool! I will give it a go soon.
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by TobyLobster »

I tried to get this to run under macOS but sadly Wine isn't a thing any more for recent versions of macOS. Could it be made without using Windows specific libraries?
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

gfoot wrote: Tue Feb 14, 2023 11:50 pm Cool! I will give it a go soon.
:D
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

TobyLobster wrote: Wed Feb 15, 2023 10:30 am I tried to get this to run under macOS but sadly Wine isn't a thing any more for recent versions of macOS. Could it be made without using Windows specific libraries?
I will investigate further but I'm no expert on macOS :oops:
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by picosonic »

Looks good, I will give it a go under Linux with Wine
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

picosonic wrote: Wed Feb 15, 2023 11:34 am Looks good, I will give it a go under Linux with Wine
Excellent! I'm also trying to compile a native Linux binary
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by picosonic »

0xC0DE wrote: Wed Feb 15, 2023 12:03 pm
picosonic wrote: Wed Feb 15, 2023 11:34 am Looks good, I will give it a go under Linux with Wine
Excellent! I'm also trying to compile a native Linux binary
Native binary would be great.

I just tried it and got an error ..

max65 error
max65 error

Happy to provide further info or retest if you have other versions.
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

picosonic wrote: Wed Feb 15, 2023 1:52 pm I just tried it and got an error .
Thanks for trying! Which Linux distro/version, Wine version are you using? Did you configure a 64bit Wine prefix?

As a test, can you try this native 64bit ELF on your Linux?
(update: download removed as it was only a quick test and not a solution)
Last edited by 0xC0DE on Thu Feb 16, 2023 1:10 pm, edited 1 time in total.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by picosonic »

0xC0DE wrote: Wed Feb 15, 2023 2:32 pm Thanks for trying! Which Linux distro/version, Wine version are you using? Did you configure a 64bit Wine prefix?
On the machine I tested on, Ubuntu 18.04.6 64bit with Wine 3.0-1
As a test, can you try this native 64bit ELF on your Linux?
Sorry the linux binary didn't work as it was built for libc 2.34 (this version of linux has 2.27-3) and requires libpython 3.10 (this version of linux has 3.6.9-1)

I'll try again on a newer distro when I get a chance
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

picosonic wrote: Wed Feb 15, 2023 3:01 pm Sorry the linux binary didn't work as it was built for libc 2.34 (this version of linux has 2.27-3) and requires libpython 3.10 (this version of linux has 3.6.9-1)
:lol: Sorry mate, the package hell of Linux, I'll experiment some more with Wine and add details to the user guide.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by picosonic »

0xC0DE wrote: Wed Feb 15, 2023 3:48 pm :lol: Sorry mate, the package hell of Linux, I'll experiment some more with Wine and add details to the user guide.
No worries, maybe you could either specify a minimum package version spec or create a snap which includes all the dependencies to make a universal package..

https://snapcraft.io/
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by picosonic »

I've tried the binary on Ubuntu 20.04.5 also, and that didn't work either, same thing about libc and python.

It looks like libpython 3.10 and libc > 2.34 appeared in Ubuntu 22.04 (Jammy)

However, max65.exe does work fine in Wine that comes with Ubuntu 20.04.5 (which is wine version 5.0-3)
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

picosonic wrote: Wed Feb 15, 2023 4:05 pm I've tried the binary on Ubuntu 20.04.5 also, and that didn't work either, same thing about libc and python.

It looks like libpython 3.10 and libc > 2.34 appeared in Ubuntu 22.04 (Jammy)

However, max65.exe does work fine in Wine that comes with Ubuntu 20.04.5 (which is wine version 5.0-3)
Very useful info, thanks! Yes, I'm using Jammy (and Wine 6.0.3 btw). Will look into 'snap'... (not a Linux guru)
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
derek
Posts: 258
Joined: Thu May 07, 2015 8:31 pm
Location: Sunny Runcorn, UK
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by derek »

Hi,

I downloaded the Gihub zip file and can get the Windows version running with Wine, but the Linux ELF executable needs Python 3.10, which my system only has Python 3.08

I have updated Python to v3.10, but the system still think v3.8 is installed. maybe needs library simlinks changed.

How do I compile the source code?
Regards,

Derek
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

derek wrote: Thu Feb 16, 2023 1:06 pm I downloaded the Gihub zip file and can get the Windows version running with Wine, but the Linux ELF executable needs Python 3.10, which my system only has Python 3.08
Thanks for testing! The best bet is Linux+Wine for now. I have removed the ELF binary since it was just a quick test, not a good solution at all.
derek wrote: Thu Feb 16, 2023 1:06 pm How do I compile the source code?
There is no (published) source code! :shock:
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
TobyLobster
Posts: 618
Joined: Sat Aug 31, 2019 7:58 am
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by TobyLobster »

0xC0DE wrote: Thu Feb 16, 2023 1:14 pm There is no (published) source code! :shock:
:-(
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

Released max65 v0.11, added: Optional listing file

https://github.com/0xC0DE6502/max65-releases
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
paulb
Posts: 1767
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by paulb »

TobyLobster wrote: Thu Feb 16, 2023 8:51 pm
0xC0DE wrote: Thu Feb 16, 2023 1:14 pm There is no (published) source code! :shock:
:-(
I have found Ophis to be fairly usable as a Free Software assembler for the 6502. It provides some of the features described for this software, although there are various enhancements I could imagine being done at some point.
Coeus
Posts: 3557
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by Coeus »

paulb wrote: Fri Feb 17, 2023 3:34 pm I have found Ophis to be fairly usable as a Free Software assembler for the 6502. It provides some of the features described for this software, although there are various enhancements I could imagine being done at some point.
There are plenty of Free Software (as in both free as in beer and open source) assemblers that will assemble 6502 code. Aimed specifically at the BBC Micro there is beebasm (https://github.com/stardot/beebasm), which also includes things like SSD generation and tokenising BASIC programs, and LaXasm (https://github.com/SteveFosdick/laxasm) which I wrote to be able to assembler source code written for the ADE/ADE+ and Lancaster assemblers, the latter of which is free to use on the BBC micro as a native assembler. This gives an option for the same source be assembled by a native or cross-compiler.

Then checking my Linux distro, Arch, specifically for the 6502, or at least the 6502 family, there are acme (https://sourceforge.net/projects/acme-crossass/) which is used to assemble Toby Lobster's disassembly of OS 1.20, xa (https://www.floodgap.com/retrotech/xa/), cc65 (https://cc65.github.io/cc65/), tass64 (http://tass64.sourceforge.net/), badass (https://github.com/sasq64/bass), dasm (https://dasm-assembler.github.io/), ophis (http://michaelcmartin.github.io/Ophis/, as mentioned above) and mads (http://mads.atari8.info/).

Then there are the multi-processor cross assemblers that include 6502 along with various others like Z80, 68000 etc, which include asmmotor (https://github.com/asmotor/asmotor), vasm (http://sun.hasenbraten.de/vasm/), wla-dx (https://github.com/vhelin/wla-dx) and tpasm (https://github.com/vhelin/wla-dx).

Many of these have no OS dependencies and would compile on anything with the appropriate compiler. Most are in C/C++ with at least one in Pascal.
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

I'm fully aware of there being MANY MANY 6502 assemblers, but I would like to get back on topic, i.e. my max65 assembler.
This thread is meant for people who are willing to try max65 and report any bugs in the assembler or its documentation.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

@ Linux users: I am hoping to make your life easier with this snap package (amd64): https://snapcraft.io/max65
Let me know if it works for you.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
scruss
Posts: 653
Joined: Sun Jul 01, 2018 4:12 pm
Location: Toronto
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by scruss »

thanks, but that requires snapd, which is a whole wodge of horrible code and infrastructure from Canonical.

AppImages are a nice way to run programs on Linux without any installation required. No idea how hard they are to build, though
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

scruss wrote: Sun Feb 19, 2023 6:31 pm AppImages are a nice way to run programs on Linux without any installation required. No idea how hard they are to build, though
Interesting. I will look into that.
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

Released max65 v0.12
https://github.com/0xC0DE6502/max65-releases

Added verbose output option (-v)
Created snap package for Linux (amd64) https://snapcraft.io/max65
Fix: defined() checks validity of argument
Exclamation mark '!' forces absolute addressing
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

Released max65 v0.13
https://github.com/0xC0DE6502/max65-releases

Define symbols on the command line (-D)
Optional start offset and length for 'incbin'
Directive 'filler' sets fill value (default: 0) for unused bytes
Optional fill value (default: set by 'filler') for 'skip' and 'align'
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

Released max65 v0.14
https://github.com/0xC0DE6502/max65-releases

Changes:
Fixed some undocumented 6502 instructions
Fixed macro expansion
$. prefix in .inf files
Listing: can show labels +1 or +2
User guide: using macros as user defined functions
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

Released max65 v0.15
https://github.com/0xC0DE6502/max65-releases

Changes:
Added 65C02 instruction set (not Rockwell/WDC)
CPU directive selects 6502 (default) or 65C02
Fixed slow assembly when file has a large number of local scopes
User guide: list all supported 6502 and 65C02 instructions
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
VectorEyes
Posts: 572
Joined: Fri Apr 13, 2018 2:48 pm
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by VectorEyes »

0xC0DE wrote: Tue Feb 28, 2023 9:55 pm Added 65C02 inset (not Rockwell/WDC)
CPU directive selects 6502 (default) or 65C02
Ahah… now things are getting interesting!

Any possibility of plans for native MacOS support? ;)
User avatar
0xC0DE
Posts: 1300
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: max65 macro cross-assembler for 65xx CPU

Post by 0xC0DE »

VectorEyes wrote: Tue Feb 28, 2023 11:23 pm Any possibility of plans for native MacOS support? ;)
Maybe! If I can figure out a reliable way to distribute a non-static binary and without paying Apple. Homebrew perhaps?
0xC0DE
"I program my home computer / Beam myself into the future"
:arrow: Follow me on Twitter
:arrow: Visit my YouTube channel featuring my games and demos for Acorn Electron and BBC Micro
Post Reply

Return to “development tools”