| |
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.... |
| |
Raistlin
Registered: Mar 2007 Posts: 680 |
I just tried converting our code to 64Tass... got it working - but there’re a couple of things that KickAss does that 64Tass doesn’t seem to..? Eg.:-
.fill 64, i <— KickAss would give you a 64 byte array with 0, 1, ..., 63
I got this working in 64Tass only by using a .for loop... which isn’t anywhere near as neat. Can this be done more easily?
KickAss also lets me name blocks easily with just:-
* = $8000 “codeblock”
But in 64Tass I have to drop the name.
Maybe these features are there in different ways - I dodm’t Read the whole .doc yet...?
If 64Tass is much faster i’ll forgive it.. but i’m not sure yet. |
| |
Raistlin
Registered: Mar 2007 Posts: 680 |
Anyone who’s tried 64Tass vs KickAss, i’d be very interested in hearing your thoughts. I am so far finding that 64Tass is faster at compiling, and will probably stick with it for that... but i’ll see... |
| |
soci
Registered: Sep 2003 Posts: 480 |
Quoting Raistlin
.fill 64, i <— KickAss would give you a 64 byte array with 0, 1, ..., 63
I got this working in 64Tass only by using a .for loop... which isn’t anywhere near as neat. Can this be done more easily?
Such one liner table generation is easier with sequences than using loops. The equivalent is: .byte range(64) For most of the cases just replace "i" with "range(something)" in the expression.
Quoting Raistlin* = $8000 “codeblock”
But in 64Tass I have to drop the name.
Moving around * does not create sections, it just moves the PC and the location of data in the image. Sections and their names need to be defined explicitly. I usually define them at the start like this (with your naming):
*= $0801
.dsection codeblock
.section codeblock
.word +, 2019
.null $9e, format("%d", start)
+ .word 0
.send
.dsection datablock
.dsection bss
;------------------
.section codeblock
start rts
.section datablock
bitmask .byte %10000000 >> range(8)
.send
.section bss
tmp .byte ?
.send
.send
Results in:Memory range: $0801-$0815 $0015
Section: $0801-$080d $000d codeblock
Memory range: $0801-$080d $000d
Section: $080e-$0815 $0008 datablock
Memory range: $080e-$0815 $0008
Section: $0816-$0816 $0001 bss
Memory ranges show where data is stored in the image within a section. As only space was reserved in "bss" it does not have any. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Real-world question:
Consider a given disk track number, anything in say [1..35], as a compile-time constant denoting the (shadow) directory track.
Depending on the track number (density zone), there is a specific maximum legal sector number.
Now, how do i put in a mapping from track number to max sector number, such that the max sector number can be used as an argument for cmp #imm, with the operand being determined at compile-time?
I've not yet found a nice solution for ca65, maybe another assembler can do that? |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Real-world question:
Consider a given disk track number, anything in say [1..35], as a compile-time constant denoting the (shadow) directory track.
Depending on the track number (density zone), there is a specific maximum legal sector number.
Now, how do i put in a mapping from track number to max sector number, such that the max sector number can be used as an argument for cmp #imm, with the operand being determined at compile-time?
I've not yet found a nice solution for ca65, maybe another assembler can do that?
KickAsm can do it with simple Hashtable: http://theweb.dk/KickAssembler/webhelp/content/ch06s04.html
I'll see if I can come up with a way in CA65, maybe @Radiant knows? |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
There are char mappings in ca65, which i've not tried yet, but i have a hunch that this will result in at least 35 more lines of code for my specific problem. :)
Edit: Also the .CHARMAP mapping appears to be global and non-resettable, and applies to string or character literals only. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
.define sectors_in_track(tk) (21-tk/18*2-tk/25-tk/31)
|
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Haha, brilliant! Glad i stated my actual problem and not just the wrong tree i've been barking up to. X-Y problem averted. =)
The academic question still remains, though. :] |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Cheers!
But yeah, if I really need proper data structures I just use Python to generate source for ca65 to assemble. Scripting's not its strong point. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
I'm generally opposed to the idea of a Turing-complete language embedded in assembly code, though (see above), so having external scripts for the complex stuff is a-okay.
But simple things like mappings i do like to have. :) |
Previous - 1 | ... | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 - Next |