Page 2 of 2
Re: asm6 + 65816 = asm16
Posted: Sun Apr 23, 2017 6:30 am
by tepples
ca65 overrides address size using z:, a:, and f: prefixes for direct, absolute, and absolute long respectively.
In addition to the .dpage, I guess you'd need a default data bank register for instructions that use absolute addressing mode.
Re: asm6 + 65816 = asm16
Posted: Sun Apr 23, 2017 8:19 am
by Pokun
Great to see 65816 finally coming to asm6!
Even if you can track DP, I think a directive for manually setting DP is good to have. That way, adding HuC6280 support would be easy too I guess.
TAD is an alternate of the official TCD mnemonic I think. I guess the official mnemonics are supported too?
Re: asm6 + 65816 = asm16
Posted: Sun Apr 23, 2017 8:37 am
by nicklausw
dougeff wrote:There should be a way to cast a value to direct-page, absolute, or absolute long.
Yeah, that would be a good addition...I'm thinking ending the opcodes with ".b",".w" or ".l"? ca65's way might be easier, just depends on how the colon would be handled by asm16.
Please don't try to guess that the user wants a direct page (based on D values). I would rather that you use direct page if the address (or label) is < 0x100. Absolute if the address is between 0x100 and 0xffff. Long if the address is >= 0x10000.
Your preferred functionality is what the assembler does currently, since it doesn't really know what direct page is (it just guesses that everything below 0x100 is "zero page"). Why not let the assembler guess if the user wants direct page, though?
And, now that I think of it, how would you force a long address back to absolute ? With & operator, maybe ?
I always do that with
lda #bla & $ffff. $ff to set to 8-bit.
tepples wrote:I guess you'd need a default data bank register for instructions that use absolute addressing mode.
You mean to use on long addresses?
Pokun wrote:Even if you can track DP, I think a directive for manually setting DP is good to have. That way, adding HuC6280 support would be easy too I guess.
Oh yeah, I wouldn't implement automatic DP if there wasn't a manual alternative.
TAD is an alternate of the official TCD mnemonic I think. I guess the official mnemonics are supported too?
Yep, all official opcodes and aliases should be supported.
Re: asm6 + 65816 = asm16
Posted: Sun Apr 23, 2017 9:52 am
by tepples
nicklausw wrote:And, now that I think of it, how would you force a long address back to absolute ? With & operator, maybe ?
I always do that with
lda #bla & $ffff. $ff to set to 8-bit.
With PRG bank set to $7E and direct page set to $2100, what should LDA $7E2100 do? Doing LDA $7E2100 & $FFFF would change it to $2100, which automatically gets recognized as zero page.
nicklausw wrote:tepples wrote:I guess you'd need a default data bank register for instructions that use absolute addressing mode.
You mean to use on long addresses?
Yes.
Re: asm6 + 65816 = asm16
Posted: Sun Apr 23, 2017 10:08 am
by nicklausw
That's a tricky situation. And just when I pushed the commit on my computer, too...

Maybe automatic direct page shouldn't be a thing.
If I do end up putting it in anyway (probably not at this point) then the data bank will be handled by the assembler too. asm16 would solve the $7e2000 program fine if you put in the entire value. Using
& $ffff makes it clueless.