| |
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.... |
| |
LHS
Registered: Dec 2002 Posts: 66 |
64TASS as well, in PSPAD. And C++ for some code generation and data converting. |
| |
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?
|
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@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—<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. |
| |
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:
[...]
|
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
@Radiant: I added that to codebase. Thought it may be useful to someone (and I want to remember it myself). |
| |
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. |
| |
yago
Registered: May 2002 Posts: 333 |
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) |
| |
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) |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
And the Graham Assembler does the code generator in 6502 asm.
|
| |
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 |