| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Assembler preferences.
Two questions:
- what's everyone using these days?
- on large productions, do groups tend to enforce a single assembler for the entire project, or is the code base a bit heterogenous?
I'd like to keep this discussion purely focussed on assemblers; please leave code generators, loader toolchains etc for that other thread.
(as for me, I'm still using xa65 for most projects) |
|
... 204 posts hidden. Click here to view all posts.... |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Pitcher: If it does what you want it to do, keep using it until you hit some walls. Whatever makes you most productive. There are people who prefer plain text editors and a shell over fully-integrated IDEs, and those who don't.
Personally, i've never considered using C64prgstudio. Can you decide which assembler to use with it? |
| |
saimo
Registered: Aug 2009 Posts: 36 |
Interesting conversation. I thought that the way I'm writing QUOD INIT EXIT II might be somehow interesting to you - or at least give you a reason to have a good laugh. The only problem is that I suffer from Constant Lack Of Time, so I really shouldn't be doing this and rather write down some more code, but anyway...
BACKGROUND INFORMATION
I have started writing code entirely in 6502 assembly only recently (there's a long story behind, but I'm trying to keep it short). I was writing QIEII's code as a mix of BASIC and BASIC BOSS £CODE statements (so, I was writing by hand the ML code as byte values). Little by little, I replaced lots of BASIC parts to save more memory (and gain speed, but that was secondary). At some point, ~95% of the code was ML: that, combined with the fact that I really would have had a use for the extra memory taken by BASIC BOSS and the whole zero page, made me decide to switch to assembly.
I had to take a decision: which assembler to use? I had already read somewhere here that there is no standard syntax; moreover, I'm working on AmigaOS 4, so I thought I didn't have much choice. Eventually, I decided to do it my own way, much in the vein of what I was already doing. And so I decided to use... no assembler at all.
THE SOLUTION ADOPTED
What I did was, instead, creating a little framework in C that allows me to write assembly-through-C, so to speak: basically I write C code whose corresponding executable program outputs a C64 executable. Note that I'm not talking of compiling C code into 6502 ML: I'm actually writing assembly code, just in a somewhat weird syntax (that I got used to very quickly). The fact that the context is that of a C source gives me a lot of power and flexibility (which I'm not even using to the fullest, I believe).
But I guess that this description fails to give a decent idea, so let me resort to some visual aids...
EXAMPLES
This picture here shows you some ordinary code/routines.
This picture shows dynamic generation of code: if the C program detects that the 6502 ML code it is generating would overwrite itself, it generates additional code to deal with that issue.
This picture shows (conditional) inclusion of sources, declaration of an embedded table, incbinning, and debug output.
CONCLUSION
There's more to this, but chances are that you're already throwing up at the syntax, so I'll stop it here ;) |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@saimo: That's a funny way of doing it for sure. :D
...and speaking of Amiga. Somewhere I have a version of the ACME assembler compiled so that it is possible to run it even on A500 (with kickstart above 1.3 only I think). It is not the latest version of ACME, but it is not a very old version either. |
| |
saimo
Registered: Aug 2009 Posts: 36 |
Never used ACME. I started with DevPac, but soon my favourite assembler became PhxAss. The only problem I had with it is that it produced incorrect base or outer displacements (can't if either or just one of them) for memory indirect pre/post-indexed modes when in conjunction with some optimization (it was something quite specific, but unfortunately I can't remember more). That bug made me waste many hours searching for a bug in my code - eventually, looking at the disassembly, I discovered the 84574rd. The author told me that the problem wasn't curable without a complete rewrite (but it was not a big deal: if I remember correctly, it was enough to specify the size of the displacements manually and correctly to avoid the problem). |
| |
Digger
Registered: Mar 2005 Posts: 437 |
@saimo: I love that :) Could this be ported to JS? I make a lot of prototypes in JS (Coffescript actually) and it would be nice to convert them to gradually into Assembly and then output it as .asm file by the browser :) |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: @saimo: I love that :) Could this be ported to JS? I make a lot of prototypes in JS (Coffescript actually) and it would be nice to convert them to gradually into Assembly and then output it as .asm file by the browser :)
That's exactly how I code my complex parts. Start with java code, then gradually replace each function with assembly (in java) and a crude CPU/VIC emulation to verify the correctness. |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@Saimo: ACME is a 6502/6510 assembler. Not for 68k like devpac etc. |
| |
saimo
Registered: Aug 2009 Posts: 36 |
@Digger
Unless I misunderstand you, it sounds like you have something quite different in mind. My stuff does not compile C into assembly (so it doesn't allow to do prototyping in C), and does not output an assembly source. It's simple, but it's kind of weird to explain, so here are more details:
* all I have is a bunch of C files that constitute the framework;
* a C64 program consists of one or more C sources that include some of the framework files;
* the C sources define all the assembly code by means of C functions and macros (f.ex. ldai(0); is the equivalent of lda #0);
* I compile the sources with GCC, which generates an AmigaOS executable;
* I run the AmigaOS executable, which generates the C64 executable.
@Frantic
You've just exposed my ignorance about C64 assemblers :p
Sorry, I took a trip down the memory lane... |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
saimo, congrats, thats a terribly masochistic way of doing it. :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Quote: Quoting ChristopherJamon large productions, do groups tend to enforce a single assembler for the entire project, or is the code base a bit heterogenous? As others said already, there is no need to enforce The One Assembler. And why would there be? :) Given the plethora of assembler preferences, no demo coded by many coders would get finished. And already the choice of loader usually gives you the need to work with a second assembler, albeit only once to build the loader with your preferred options.
Good point that enforcing a standard would exclude any coders that didn't wish to switch.
I guess I was thinking it might simplify the build process, or at least make it easier to wrangle linking the handover between parts. (I'm curious as to whether any multiparters use a common kernel for juggling IRQs etc, but that's a whole 'nother topic).
Must admit, it's ca65's linker that's had me considering switching away from xa - as it is I occasionally resort to using a small Python script to parse the .lst from one prg to generate symbols to include into another .a65
Oh, and it also looks like it'd be saner for building and including code targeted for relocation (e.g. to zero page or the disk drive) if I switched to ca65. The hacks I use to get xa to do that are not my favourite thing. |
Previous - 1 | ... | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 - Next |