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 > What assembler/compiler are you using?
2010-03-16 20:44
Mace

Registered: May 2002
Posts: 1799
What assembler/compiler are you using?

Since I kind of switched from 64TASS to Kick Assembler, I was wondering what the other coders use as coding tool?
Still working on the C64 with TASM or do you use one of the cross development compilers?
 
... 47 posts hidden. Click here to view all posts....
 
2010-03-18 10:07
LHS

Registered: Dec 2002
Posts: 66
64TASS as well, in PSPAD. And C++ for some code generation and data converting.
2010-03-19 03:18
Ervin

Registered: May 2008
Posts: 14
Well, since I've been using ca65 almost exclusively till now, I wonder if there is any assembler which can produce labels like this (in "ca65 pseudo code"):
*=$c000
.repeat	3,i
  .label( concat("startofnop_", .string(i)) )
  .repeat i+1
    nop
  .endrep
  .byte i
.endrep
.word startofnop_0, startofnop_1, startofnop_2

which would result in:
startofnop_0:
nop
.byte 0
startofnop_1:
nop
nop
.byte 1
startofnop_2:
nop
nop
nop
.byte 2
.word $c000,$c002,$c005

As I found out (I might be wrong!) ca65 can not use the actual repeat counter (in this example: "i") as input for builtin pseudo functions, like ".string(i)". Maybe another assembler can do the trick, or maybe ca65 can do this too in some way?

2010-03-19 07:43
Frantic

Registered: Mar 2003
Posts: 1627
@Ervin: I can't recall seeing the ability to create labels on the fly in other assemblers than ca65. For me that is one of the few distinct benefits that I remember from ca65. Would be interesting to hear if this is possible in some other assembler.

@Oswald: In TextMate you can create something called "Bundles" which are associated with certain file types per default, and they contain info on syntax highlighting, what to do when pressing certain keys on the keyboard (such as calling external programs) and so on. Magervalp created a bundle for TextMate and ca65 that I customized for ACME instead, and added a bunch of stuff too. So, whenever I call make from TextMate to parse my Makefile (I can invoke several variants such as "make", "make clean", "make all", "make vice", "make codenet"), I also capture the output from the assembler (using standard regext matching tools such as egrep), and if there is any matches to strings such as "Warning" or "Error" I transform these error strings (using standard regexp substitution tools such as sed) to HTML that looks like this:

<b>Trouble:</b><br>
<a href="txmt://open?url=file:///Users/matsandren/systems/c64/code/own/music/superp layer/code.a&line=692">alt.a:692&mdash;<i>error:Syntax error.</i></a><br>

...and if any such output is produced, I enable a flag in TextMate saying "Show output as HTML" and make sure that the execution of the Makefile is halted. The txtm:// stuff is a special feature of TextMate that opens a particular file (or switches to it, if it is already open) and the line parameter also makes it jump to the correct line. If everything worked fine, no window is popped up, and the file is instead executed in VICE, or on the C64 via codenet.

It was a little work to get this working correctly, but now I use it all the time, so it was worth it I guess.
2010-03-19 08:30
Radiant

Registered: Sep 2004
Posts: 639
Ervin: Actually, it is possible to do what you want to do in ca65, but I know of only one specific way:

.macro makeident lname, count
    .ident(.concat(lname,.sprintf("%d", count))):
.endmacro

Using a macro like this it's possible to create labels using a repeat counter.

.repeat $100, I
    .makeident "foo", I
    lda $1000 + I
    sta $2000 + I
.endrepeat

This produces the following code:

foo0:
    lda $1000
    sta $2000
foo1:
    lda $1001
    sta $2001
foo2:
    [...]
2010-03-19 10:38
Frantic

Registered: Mar 2003
Posts: 1627
@Radiant: I added that to codebase. Thought it may be useful to someone (and I want to remember it myself).
2010-05-06 21:01
bert64
Account closed

Registered: Jan 2010
Posts: 2
I guess I'm old-school, but I use Buddy on WinVICE with 16MB ram expander enabled and Jiffy-DOS roms. My c64 programs first save all ZP, source, Buddy, etc. memory to expander and put it back in the end. Doesn't take much code to do this. That way I can still use nearly the entire 64K for the program code and can actually get things done in a single lifetime. I've tried cross-compiling but I guess it's just not for me, although ReLaunch/KickASS is a nice mix. Too much commit charge, though.

There's just something about coding directly on the 64 that feels good. Almost forgot--I usually open two or three Win VICE instances at a time, one with AR6 or Warpspeed enabled. It helps.
2010-05-07 14:26
yago

Registered: May 2002
Posts: 332
on k2asm, codegeneration (incl. labels) would go like this
#pybegin
for i in range(0,10):
  print "foo"+str(i)+":"
  print "lda $1000+",i
  print "sta $1000+",i
#pyend


would produce same code as radiantx ca65 example

(one can also use external (non-python) code-generators, but thats for the heavy stuff)
2010-05-07 16:26
Slammer

Registered: Feb 2004
Posts: 416
The KickAssembler approach would be to put the memory positions in a list:
.var list = List()
.for (var i=0; i<100; i++) {
	.eval list.add(*)
	lda $1000+i
	sta $1000+i
}
.for (var i=0;i<list.size(); i++) .word list.get(i) 

(Kind of illustrates the difference between a preprocessing script and an integrated script - here we put the actual memvalue in a list)
2010-05-07 18:53
Graham
Account closed

Registered: Dec 2002
Posts: 990
And the Graham Assembler does the code generator in 6502 asm.
2010-05-07 19:34
Slammer

Registered: Feb 2004
Posts: 416
Large unrolled loops in an trackmo is ofcause best done by doing an unroll routine. However this workcycle works for me:

1. Make the code fast with unrolled loops by the assembler and see that it works
2. Declare the loop code 'virtuel' so it isn't stored in memory and create functions that generates the loop code.

This makes the development more rapid and the assembler calculates the amount of memory an unrolled loop needs so they are automaticly placed right after each other.


Previous - 1 | 2 | 3 | 4 | 5 | 6 - 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
Mike
qbhead
Fred/Channel 4
Oswald/Resource
Guests online: 126
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 A Life in Hell  (9.1)

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