new tg16/pce assembler

Or rather, a new build of PCEAS with changes. MooZ and I were working on doing changes to the assembler, sine some changes were needed for specific code layouts. I was gonna wait and just do a joint release with MooZ last year, but I guess things got slow on his side. So I’m just releasing it here. There’s a readme and a commented ASM test file, but I’ll just relist the new features here.

There’s a new data define directive; .dwl and .dwh. They return the LSB (.dwl) and MSB (.dwh) of a word entry. This useful for building a split lsb/msb tables. But more important, it cuts down the amount of typing needed for creating arrays of function tables of.. function addresses. Normally, you can just handle binary data in split format with external apps and just include the new binary data. But working with specific and runtime address generated labels for tables gets tedious. So this helps. Just copy/paste the same table and change the directive to .dwh for the second split set.

Macro’s now how a new legal character for macro names. Doesn’t sound a like a big deal, but ADDW.b or MOVE.b/MOVE.w/MOVE.l looks cleaner and much nicer than using an underscore _ or such.

Local labels how have -/+ support… sort of. You still need the ‘.’ character to signify/define a local label name, but now you can use .- or .– and .+ and .++ etc. You can use them in higher level math/logic operations too and inside EQUATE defines. You just need whitespace between the end of the name and the – or + operator, *IF* your label ends with a – or +. So test = .+++ + $10 works fine, but so does test1 = .skip+$10. The new labels for local doesn’t not break backwards compatibility with otherwise normal label names. I’m not a big fan of the -/+ usage as it can messy looking real quick in my opinion. But couple of people had requested it. Plus, it would make converting some c64 or such code a little easier (I mean, for when you’re lazy).

Opcodes that cross 8k bank boundaries no longer create an error and stop assembling. That is to say, if one or more opcode’s byte cross that boundary. Now it will generate a warning instead, but assemble correctly. Labels logic works fine with this as well. This means you can make 16k or 24k or whatever size ‘code banks’. This is needed for some hacking related stuff since those commercial assemblers didn’t have this problem/issue (like Bonk for instance). This also applies to data defines as well.

And finally, I fixed a bug where if the assembler encountered a certain error – it would just crash (there was no exit handler).

You can download the new version in Download and Links section.

Note: Things I like about PCEAS assembler syntax that I wouldn’t change; [] instead of () for indirect addressing. Who cares if almost all the original 65x assemblers used (), [] just makes things sooo much easier for the parser and avoid *certain* high level logic bugs (misinterpreted bracketing for opcodes). And < for non indirect ZP addressing. Though what I would like to add in the future is <# and >#for shorthand #low() and #high() directives, which have nothing to do with ZP addressing.


7 Responses to “new tg16/pce assembler”

  1. Cool! It’s too bad I didn’t have enough free time for pceas 😦
    One of my top priority task is to make the ‘*’ symbol writtable in order to make relocatable code easier. Atm I have to compile the relocatable code separately and then include it as data in the main code. It’s rather painful compared to something like this:
    .bank 7
    .org $6000
    proc0: lda #$00
    inc proc0+1
    bpl proc0
    proc1: nop

    • Value changeable equates is another feature. I don’t remember off hand why I used it, but it came in handy when doing 68k code for ASW assembler. Another nice feature would be for more customizable counters (like what RS does). SIZEOF() doesn’t work for incspr, only seems to work for incbin. Another thing that could be added/updated.

  2. if I understand, 8k code limit is over ??

  3. Yes. You’ll only get a harmless warning.

  4. Cool, but i am not using assembly only (i am too noob for that) 😦 .

    For now, only all asm in line with huc .

    • You know.. I had made a small change to HuC source code that would allow single line ASM inserting. You could use a #define for it too. You know, like to call a macro or such. Made the ASM single line insertion much cleaner looking. I don’t know if I still have the source changes to that.

  5. aaah that’s cool …
    If you can find it, i’ll can test it :-)))))

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: