65816 nuances

Programming the 6502 microprocessor and its relatives in assembly and other languages.
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: 65816 nuances

Post by whartung »

Regarding page wrapping behavior of "new" vs "old" instructions in emulation mode.

Does this occur only for new instructions, or old instructions with new addressing modes as well?

i.e. does it happen with LDA depending on the addressing mode? or simply not at all?
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: 65816 nuances

Post by Dr Jefyll »

I think it's safe to assume the designers created the big, shiny "full power" processor first; with 16-bit everything, and free of any page-wrapping behavior. Then they went to work implementing Emulation Mode, which selectively cripples certain stuff in order to reproduce 6502 behaviors. Crippling stuff takes extra effort, so they would minimize that. As Chromatix remarked upthread, it's the minimum hobbling they could do to ensure backwards compatibility.

In cases where the '816 has a new address mode, or even a whole new instruction, these new functions will never be invoked in code intended for a 6502. Thus the specification for Emulation Mode has no applicability. It's alright if some or all of the new functions are affected, and it's also alright if they aren't.

So, the designers wouldn't deliberately try make Emulation Mode affect the new functions. If there's any effect, it would be unintended -- an accidental and harmless side effect. That's not impossible, but it seems unlikely.

Hope that helps -- it's a fairly general observation.

-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: 65816 nuances

Post by Chromatix »

When you encounter questions like that, possibly the best answer is to obtain a real '816 and run some test code.
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: 65816 nuances

Post by whartung »

Chromatix wrote:
When you encounter questions like that, possibly the best answer is to obtain a real '816 and run some test code.
For sure, but that's far away. I don't have one. And the only one I can honestly think of that would qualify for all the situations is a Apple II GS, as I don't know of any other off the shelf '816 that has more than 64K of RAM (so you can test all of the banking and other shenanigans).

Uplifting one of the WDC boards is a larger project for someone like me.

If I had a logic analyzer, I wouldn't necessarily need all that RAM. That's an even larger project.
User avatar
BitWise
In Memoriam
Posts: 996
Joined: 02 Mar 2004
Location: Berkshire, UK
Contact:

Re: 65816 nuances

Post by BitWise »

whartung wrote:
Uplifting one of the WDC boards is a larger project for someone like me.
I have some spare PCBs for my W65C265SXB 1MB SRAM expansion card (somewhere). I think I have the 512Kx8 and GAL chips as well.
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs
whartung
Posts: 1004
Joined: 13 Dec 2003

Re: 65816 nuances

Post by whartung »

BitWise wrote:
whartung wrote:
Uplifting one of the WDC boards is a larger project for someone like me.
I have some spare PCBs for my W65C265SXB 1MB SRAM expansion card (somewhere). I think I have the 512Kx8 and GAL chips as well.
Thanks, I'll keep that in mind.

Getting a new house, so my next six months are "indeterminate" right now as to what gets time.
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: 65816 nuances

Post by Chromatix »

You don't need a whole computer for this. Just an '816 CPU, a logic analyser to watch how it responds, some switches to set the data bus manually and toggle the Phi2 clock, some resistors to avoid short-circuiting the bus, and a reset controller (which could also be manual). Stick all that in a decent breadboard.
Post Reply