| |
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.... |
| |
Trash
Registered: Jan 2002 Posts: 122 |
64tass with my own C#-shell, if I need scripting inline and the assemblers commands isn't enough I just add:
C#
{
..code that returns a tass64 compatible string
} |
| |
oziphantom
Registered: Oct 2014 Posts: 490 |
maybe worth mentioning I added Array adding support to MLA on top of Tass64 and boy has it changed the way I code..
lda #!!ArrayAdd { [array name]:[data]}
...
.byte !!ArrayInstance{<array name>}
so this lets me add an item to an array, the add places the index into said array in its place when "assembled" then later you pull out the arrays data to use in tass. For example
lda #!!ArrayAdd { copyData:[$2000,$8000,$10]} ; src, dest, pages
...
CopyDataFields .block
values = !!ArrayInstance{copyData}
src .block
lo .byte <(values[:,0])
hi .byte >(values[:,0])
.bend
dest .block
lo .byte <(values[:,1])
hi .byte >(values[:,1])
.bend
pages .byte values[:,2]
.bend
added it on a "yeah why not" and now I basically use it nonstop.. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
^ I'm still using Python code generators for that sort of thing. Starting to think it might be worthwhile bastardizing the sort of template engine that usually gets used for generating html… |
| |
Papademos Account closed
Registered: Jan 2011 Posts: 8 |
I'm a bit retarded so I use my own language called LAX. It's assembler with a c-ish syntax.
// Copy glyph to screen.
y = 0, do
0xf8[0] = 0
a = 0xf0[0][y]
x = 0xf9[0], if !=, do
a >>= 1, ror 0xf8[0]
--x, while !=, endif
0xf2[0][y] = a | 0xf2[0][y]
0xf4[0][y] = 0xf8[0]
++y, y ?= 8, while != |
| |
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. |
Previous - 1 | ... | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 - Next |