6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 5:06 am

All times are UTC




Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Wed Nov 20, 2019 10:48 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
I've been taste-testing assemblers for '816 and so far every one I've tried (with a few lines of assembly) has at least something wrong with it (or my understanding of how to use it, more likely). Please correct any misconceptions/misunderstandings or add suggestions (I will try to keep this message up to date as much as possible)
I am sticking with free (as in freedom and beer) tools as I need source access and no legal encumbrances. I don't mind paying for software, but it had better be amazing. An assembler that works as intended is hardly amazing (although looking at a lot of modern software, maybe it is...)

I am not bothering with tools I can't easily compile on a standard linux box. 5 minutes of my time and into the trash bin. I will not use tools written in python, java, or anything that changes or requires obscure knowlege, megabyte+ downloads, build systems with their own names, or lingo (5 min limit applies. What the fuck is lenningen? Never mind, I really don't want to know) except possibly GForth or Common Lisp. Also nothing that requires its own distribution/update mechanisms, or loads 100MB of crap like Electron. In other words, C, C++ (yuck), assembly, CL, Forth.

WDC tools
* Windows only. Registration/crippleware is adding an insult to injury.WTF. With $0.30 ARM chips floating around and things like $3.00 ESP32 systems with everything on-board, are they completely bonkers? As for winders, maybe a crippled version works in Wine, but I have enough layers of scripting to assemble, add headers and pump over a serial port via screen that F**K NO.

64tass -- spoiler...THE WINNER!
* @b @w @l indicate operand size (thanks, thedrip). Good listing with hex data.
This one is at the top of my list. It has a number of amazing features, similar to my favourite x86 assembler FASM.
See post from soci for details on controlling addressing modes and size http://forum.6502.org/viewtopic.php?f=2&t=5834&start=15

xa65
* Does not generate a listing, and the disassembler does not (yet?) support '816. That means I have to work blindfolded (I am one of those people who likes to see what the assembler/compiler is generating in a listing - especially for '816!).
* Somewhat jarring syntax (.byt instead of a db or even .byte) and a C-like preprocessor (although some would think of it as a feature, not a great fan).

naken_asm
Seems to work (and supports dozens of CPUs). Good listings (cycle counts not implemented but at least considered for the future)
Uses suffixes like lda.b to indicate operand size. I can't remember why I stopped using it... I need to look at it some more.

ca65
Works independently or as part of cc65. I haven't tried it, but drogon swears by it: viewtopic.php?f=2&t=5834&start=13

Merlin32
Apple 2GS focused. After a cursory examination, it looks good but does it output plain binaries? Worth a look. https://www.brutaldeluxe.fr/products/crossdevtools/merlin/

Acme
Seems pretty good, limited to 64K. Worth a look https://sourceforge.net/projects/acme-crossass//

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Last edited by enso on Fri Apr 30, 2021 1:02 am, edited 18 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Wed Nov 20, 2019 11:58 pm 
Offline

Joined: Tue Oct 02, 2018 4:22 am
Posts: 48
For 64tass, there is a built in method of forcing long addressing

lda @l003456 will force a long address reference (@ lower case L for long)

@b will force an 8bit address, @w will force a 16 bit address, @l will force a 24 bit address.

Straight out of the 64tass reference manual.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 3:56 am 
Offline

Joined: Sat Dec 30, 2017 3:19 pm
Posts: 116
Location: Detroit, Michigan, USA
I feel like I must be the only person who actually still uses ca65. :) The only annoyance I've had with it so far is that it doesn't support direct page segments. It supports a single zero page segment that is always at $00/0000. You can still use a direct page anywhere you want, but you can't make a segment whose symbols are DP symbols. This is easily worked around by just telling the assembler they are zero page symbols, even though your direct page is elsewhere. It only becomes a problem if you want to access one of those symbols with another addressing mode; the linker will get the address wrong.

I've actually been tossing around the idea of forking it and fixing this issue myself, but somehow I doubt I'll get around to that any time soon.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 4:47 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
enso wrote:
I've been taste-testing assemblers for '816 and so far every one I've tried (with a few lines of assembly) has at least something wrong with it (or my understanding of how to use it, more likely). Please correct any misconceptions/misunderstandings or add suggestions (I will try to keep this message up to date as much as possible)
I am sticking with free (as in freedom and beer) tools as I need source access and no legal encumbrances. I don't mind paying for software, but it had better be amazing. An assembler that works as intended is hardly amazing (although looking at a lot of modern software, maybe it is...)

I am not bothering with tools I can't easily compile on a standard linux box. 5 minutes of my time and into the trash bin. I will not use tools written in python, java, or anything that changes or requires obscure knowlege, megabyte+ downloads, build systems with their own names, or lingo (5 min limit applies. What the fuck is lenningen? Never mind, I really don't want to know) except possibly GForth or Common Lisp. Also nothing that requires its own distribution/update mechanisms, or loads 100MB of crap like Electron. In other words, C, C++ (yuck), assembly, CL, Forth.

WDC tools
* Windows only. Registration/crippleware is adding an insult to injury.WTF. With $0.30 ARM chips floating around and things like $3.00 ESP32 systems with everything on-board, are they completely bonkers? As for winders, maybe a crippled version works in Wine, but I have enough layers of scripting to assemble, add headers and pump over a serial port via screen that F**K NO.


Well, I tend to agree on the Windows side of things... however, I'll disagree with you on running Linux as a desktop. Linux is great as a server and for building some cool appliances, doing development, etc., but my personal view is it sux as a desktop. The main problem being the Xserver, but that's beyond the gist of this post.

Now, having said that... Wine is NOT a version of Windows. It's a "layer" on Linux that allows many Windows applications to run without any modification and without any Windows license. Just for "ha-ha's", I installed a Ubuntu Linux VM under Fusion, went to the Wine website and installed it. As a Linux/Unix guy, you'll likely enjoy the install, as it's all command line stuff starting with "sudo", but alas, no "grep" or "awk". Once that was installed, I executed the installer for WDC Tools and it worked fine... followed by a winecfg (command line again) to setup drives and directories under the Windows environment.

I then copied my entire 6502 development directory over to the appropriate directory under Linux, then went to a terminal window and typed in "wine tide.exe" and voila... Tide launched in a window... I opened up my various wdc files for my current BIOS, Monitor and some other stuff, and it assembled and linked without issue. I managed to do all of this in about an hour... and I rarely if ever touch a Linux distro these days, albeit I had to search and read a bit online to get directories and drive letters sorted out. You would likely have it done in 15 minutes or less.

Granted, this will allow you to run the WDC Tools under Linux without any real issue, but then again, you might not really like it either... who knows. But at least it's an option. I understand the frustration getting the right toolset and development environment, but it's never a perfect setup. I just opted to use the WDC Tools (an earlier version which is licensed. I purchased this when they dropped the price to $39 back in 2013).

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 5:08 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
I use Cross-32 ("C32"), originally from Universal Cross Assemblers, but now distributed by Data Sync Engineering and MPE Forth. They're saying it's Windows, but I think it will run under DOS too. I run mine on a separate DOS machine, but I do run a couple of DOS things under Linux, using the DOSbox DOS emulator which is free. C32 is not free (it's $100); but the one-time price gets you a great macro assembler that works for dozens of processors (6502, 65c02, 816, Z80, 6800, 6809, 68000, etc.). I like the way it handles the 8- and 16-bit accesses for the '816 without requiring you to spend extra lines in your source code telling it "LONGA," "SHORTA," etc.. If you decide to use my program flow-control structure macros for the '02, you can get them, already working, off my site, at http://wilsonminesco.com/StructureMacros/ .

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 7:04 am 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
Jimthompson, thanks for the heads up. I did not think ca65 supported '816, and have some reluctance as other assemblers that are a part of a "C suite" tend to focus on things I am not interested in.

Garth, at this point I think I am liking 64tass, but C32 sounds like a good backup plan.

floobydust - Not to start a religious war, but I was an early MSDN since windows 3.1. I wrote the thousand-dollar check every year. Bought a new Mac or two every year. Unwindowing and unmac'ing myself was the best thing I ever did. I would agree with your assessment of Linux - if this was 1995 or so. Modern Linux is infinitely more flexible than any proprietary OS, for oh, so many reasons... There are many things I don't like about Linux, but at this point it installs easier than Windows, supports any device I am interested in, and does not have a billionaire trying to reach into my back pocket or my address book. Also, impervious to viruses. And I have source for every piece of code I use. And I can move my development system to a Raspberry Pi. And my current uptime is around 200 days. But whatever works for you.

However, I don't know what you mean about X. Again, I think you are talking about 1995. The look is changeable, and I can connect to a computer across the world and open a window for a graphical application on that machine without any extra software. You never have to 'configure X' anymore. People trash X, and it has its dumb points, and people forgot about why it has a client-server bottleneck, but it is wonderful. Like film cameras, I will miss it when it's replaced by some modern mediocrity.

Even if I cared enough to get WDC tools running in 15 minutes, then I would have to figure out how to forward their output back into the linux pipe to the device. I keep an interactive 'screen' session with SBC-4. A 5-line makefile connects to the session, starts XModem on the SBC4, starts sx on my linux box, transfers the binary, and leaves me back in the monitor half a second later. Without some "IDE" or any extra software.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Last edited by enso on Thu Nov 21, 2019 7:14 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 7:05 am 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
There's also the Merlin32 assembler - I haven't actually used this myself, though.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 8:59 am 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
I've been using SB-Assembler, so far. It's written in Python, which you have already ruled out, but I will say that installing python on linux is trivial, if you need to do it at all(it comes preinstalled on at least some of them). It does the basics with a minimum of fuss. Takes in ASM, spits out Intel Hex, S-Records, plain binary, Woz monitor listings, and a number of other formats. It has its warts, though; arithmetic expressions do not use order-of-operations, and it's a pain to align the end of a block to a given location. That said, it's reasonably capable.

If you're using Linux, you will inevitably have to do some tinkering and fiddling around at some point. I also think your criteria are going to be very restricting. Native-only will cut out a fair number of them, and no dependencies will also knock out a fair slice of them. Java is pretty easy to install on a Linux box, as is Python(if that doesn't come pre-installed), so I don't think that's a fair restriction.

I prefer assemblers that don't make you use a linker, because I simply have no need for one, and it gets in the way. All I need is a program that takes in a source file, and spits out a binary in Intel Hex form, and a listing of what it did.
If there was a C compiler that produced sensible code, I would most likely be using that (Don't look at me, CC65, you didn't even produce working code, let alone good code!). I had hopes for a couple projects, but they have limitations that aren't palatable to me, usually relating to pointers if memory serves. I wanted to set up a struct describing a peripheral's registers, and access them that way, and you use a pointer to point the struct instance at the hardware. Because none of the C or C-like compilers I've looked at do these things sensibly, I just went back to assembly.

EDIT: Mind you, I've only been targeting the 'C02. I have no clue if SBASM even comes with an '816 mode.


Last edited by DerTrueForce on Thu Nov 21, 2019 9:44 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 9:12 am 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
enso wrote:
Jimthompson, thanks for the heads up. I did not think ca65 supported '816, and have some reluctance as other assemblers that are a part of a "C suite" tend to focus on things I am not interested in.


I'm also using the ca65 suite for both 6502 and 65816 development. My "OS" is asm only and it's working well. (Although I also do some C stuff, but it's not good for '816 C, so that's 602 only, no deal breaker for me though)

I'm somewhat surprised you've not used it though, given your Linux only stance (hurrah!) - it's very "classic" Unix in it's ways. Separate assembly and link stage (optional though) and I use a Makefile to control it all. My OS assembles to about 10KB of code in under a second on my desktop and is spread over a few dozen files. I have a version of ehBasic, and MS Basic that assembles with it (as well as Applesoft and Apple Integer Basic)

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 4:43 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
My Dev65 package is Java based so runs on most operating systems. It has macros, generates a listing, supports relocatable code and structured programming (on the 65xx family).

Its actually a set of assemblers for different processors based on the same Java class framework. Currently there are 6502/65c02/65816 + CDP 1802 + SCMP + 6800 + 6809 + 8080 + 4004 + 8008 + 4040 + KenBak-1 + M740

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 4:53 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
Long time ago, I had used the AS macroassembler.

To me, it always was sort of a "Swiss army knive", supporting: 6502, 65816, 68k, PIC16C8x, 8031...

There is source code for the AS.
Older versions of the AS were written in Pascal, but at some point it had migrated to C.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 5:18 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
enso wrote:
floobydust - Not to start a religious war, but I was an early MSDN since windows 3.1. I wrote the thousand-dollar check every year. Bought a new Mac or two every year. Unwindowing and unmac'ing myself was the best thing I ever did. I would agree with your assessment of Linux - if this was 1995 or so. Modern Linux is infinitely more flexible than any proprietary OS, for oh, so many reasons... There are many things I don't like about Linux, but at this point it installs easier than Windows, supports any device I am interested in, and does not have a billionaire trying to reach into my back pocket or my address book. Also, impervious to viruses. And I have source for every piece of code I use. And I can move my development system to a Raspberry Pi. And my current uptime is around 200 days. But whatever works for you.

However, I don't know what you mean about X. Again, I think you are talking about 1995. The look is changeable, and I can connect to a computer across the world and open a window for a graphical application on that machine without any extra software. You never have to 'configure X' anymore. People trash X, and it has its dumb points, and people forgot about why it has a client-server bottleneck, but it is wonderful. Like film cameras, I will miss it when it's replaced by some modern mediocrity.

Even if I cared enough to get WDC tools running in 15 minutes, then I would have to figure out how to forward their output back into the linux pipe to the device. I keep an interactive 'screen' session with SBC-4. A 5-line makefile connects to the session, starts XModem on the SBC4, starts sx on my linux box, transfers the binary, and leaves me back in the monitor half a second later. Without some "IDE" or any extra software.


Agreed, no religious wars needed... we've been down similar roads, mine goes back to PC-DOS 1.0 and earliest of Windows anything and everything, every release of OS/2 ever done and pretty much every Linux distro for the past 25 years... plus Solaris, AIX, Next... and do you remember Xenix??

As for the X server, the look and feel is changeable and customizable to the point of exhaustion. No issues... pick your desired flavor and dress it up. My main issue with X is stability... it's never been that difficult to crater it. I've been using VMs for decades and do a lot of different types of applications, which require different OSes. For example, all modern ECUs (computer that runs the engine and such in newer cars) which are tunable... they only app the manufacturer offers is a Windows app. I also designed and implemented a render farm for my son (technical artist for a game company) when he was in college and had to render a lot of full motion animations. To prototype it, I used VMware Fusion and had 6 different VMs running, Maya in one, Mental Ray in four others and a NAS in yet another (end result was 4- 1U rack machines as quad-core render engines, and another 1U rack for NAS). This level of computing on Linux (even RedHat's enterprise workstation which was expensive) and VMware Workstation would crater the Xserver frequently. This was in the 2009-2010 timeframe. Windows XP 64-bit was a complete waste of time... Going to OSX and Fusion resulted in a rock solid environment, so I never went back to Linux as a main OS, but do run multiple VMs daily, including some Linux ones once in a while.

In any case, Linux can make a great dev system with the large amount of open source tools available... but you need to sorta roll your own on some of it. I did the same on OSX, but I just roll my own OSX systems these days... but always keep a MacBook Pro for travel... and it runs Fusion as well. Peace!

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 6:12 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
floobydust: Just to clarify, I am hardly a 'unix guy'. I was dragged into Linux kicking and screaming minimalist rants. I know like 5 commands, and have to look up rsync parameters every time I back up. I hate make with a passion and have a healthy distrust of things like prolog as you can't tell when and why they do what they do at a glance. I kind of hate linux as there is no joy in it for me - it was a rational choice based on instability, expense, and ideology of the alternatives. However, I don't miss virus-checking and defragging and downloading iffy code to do really simple things that are just a part of linux.

As for servers, I think a BSD unix box is considered far more safe and stable than Linux.

drogon, thanks. I've looked at ca65 a couple of times. At some point I may even install it, but for now I am avoiding C. I think the taste left by GNU as (the worst assembler I've had to work with, perhaps) is what's giving me the willies, which is not fair since ca65 may be a fine assembler.

BitWise, no offense but I find Java a nuisanse - a cumbersome language taking the worst qualities of C++. I actually took a Java certification test long ago and was hashing out the finer points of C++ templates at X3J16, so my disgust with both is not entirely uninformed. And it requires a rather large framework that I am just not willing to maintain. No offense intended - if it works for you it certainly covers a lot of ground.

DerTrueForce, again, no offense intended, but I am likewise annoyed with python. I just don't like it - kind of the way I don't like perl. I like languages that either compile code I can look at, and if there is a VM I would much rather deal with something like Smalltalk as gives you an awful lot of power. I do wind up with something that requires python every year or so, and it's kind of different every time. It is a big download, has its own library system that downloads all kinds of crap that scares the pants off me every time, has weird newspeak lingo, etc. I am probably too critical of it, but every encounter with it makes me wish I hadn't installed it in the first place.

To summarize, yes, I am now a confirmed pompous Smug Lisp Weenie. Once you get Lisp, blub (languages that are not Lisp, which is a programmable language) just won't cut it, so you may as well just use assembly for low-level enjoyment. And your assembler had better not drag in a bunch of blub, which means it should be compiled down to code or better yet, be written in Lisp.

ttlworks and others, I will add these to my list of assemblers to try when I get a chance.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 7:09 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
enso wrote:
drogon, thanks. I've looked at ca65 a couple of times. At some point I may even install it, but for now I am avoiding C. I think the taste left by GNU as (the worst assembler I've had to work with, perhaps) is what's giving me the willies, which is not fair since ca65 may be a fine assembler.


Just FYI: The C compiler and the Assembler are 2 separate programs (and the linker is a 3rd and there are a couple other utility programs that come with the suite) so the C part is optional, although they all get installed at initial build/install time which only takes a minute or 2.

As a quick example:

Test program:

Code:
; test.s:
;********************************************************************************

   .include   "../rubyOs816/osVectors.h"
   .include   "../rubyOs816/rubyOs.h"

   .org   $8000

   jsr   strout
   .byte   "Testing 1 2 3",13,10,0

   jmp   rubyCold
   .word   *


I saved this in a file called test.s

To assemble & link:

Code:
cl65 -t none -l test.l test.s


(cl65 is a supplied "compile and link" command as the assembler on its own produces relocatable output which needs 'fixing' with the linker. the -t none parameter tells it that we have no specific 'target' - like Apple 2, C64, etc.)

hex dump the output: (od command)

Code:
000000 20 a5 ff 54 65 73 74 69 6e 67 20 31 20 32 20 33  > ..Testing 1 2 3<
000010 0d 0a 00 4c 00 c0 16 80                          >...L....<


This binary file can be sent via any means you like to the target. It won't pipe the output file though, but you can cat the bianary into your uploader.

The list file:

Code:
000000r 1                  .org   $8000
008000  1               
008000  1  20 A5 FF        jsr   strout
008003  1  54 65 73 74     .byte   "Testing 1 2 3",13,10,0
008007  1  69 6E 67 20 
00800B  1  31 20 32 20 
008013  1               
008013  1  4C 00 C0        jmp   rubyCold
008016  1  16 80           .word   *


So it's fairly easy to use and I don't think you should discount it from your available 65816 assembler options - especially one that runs the Unix way.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 21, 2019 9:10 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
drogon: thanks, I will definitely give it a shot.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: