asm6 + 65816 = asm16

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: asm6 + 65816 = asm16

Post 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.
Pokun
Posts: 2681
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: asm6 + 65816 = asm16

Post 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?
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: asm6 + 65816 = asm16

Post 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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: asm6 + 65816 = asm16

Post 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.
User avatar
nicklausw
Posts: 376
Joined: Sat Jan 03, 2015 5:58 pm
Location: ...
Contact:

Re: asm6 + 65816 = asm16

Post 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.
Post Reply