Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Assembler preferences.
2016-02-09 06:03
ChristopherJam

Registered: Aug 2004
Posts: 1381
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....
 
2016-05-02 19:36
Krill

Registered: Apr 2002
Posts: 2854
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?
2016-05-03 17:29
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 ;)
2016-05-03 17:43
Frantic

Registered: Mar 2003
Posts: 1629
@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.
2016-05-04 19:52
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).
2016-05-04 21:06
Digger

Registered: Mar 2005
Posts: 422
@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 :)
2016-05-05 09:39
JackAsser

Registered: Jun 2002
Posts: 1990
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.
2016-05-05 09:39
Frantic

Registered: Mar 2003
Posts: 1629
@Saimo: ACME is a 6502/6510 assembler. Not for 68k like devpac etc.
2016-05-05 14:58
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...
2016-05-05 15:06
Oswald

Registered: Apr 2002
Posts: 5027
saimo, congrats, thats a terribly masochistic way of doing it. :)
2016-05-05 16:26
ChristopherJam

Registered: Aug 2004
Posts: 1381
Quote: Quoting ChristopherJam
on 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
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
goto80/HT
LightSide
tempest/extend
cobbpg
Frostbyte/Artline De..
Proton/Finnish Gold
t0m3000/HF^BOOM!^IBX
Jammer
bodo^rab
Guests online: 113
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.6)
6 Comaland 100%  (9.6)
7 Uncensored  (9.6)
8 No Bounds  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 Layers  (9.7)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Rainbow Connection  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Booze Design  (9.3)
3 Censor Design  (9.3)
4 Crest  (9.3)
5 Performers  (9.3)
Top Logo Graphicians
1 Sander  (9.9)
2 Facet  (9.6)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.05 sec.