Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6502 stack pointer is 8 bits #1

Closed
wants to merge 1 commit into from
Closed

6502 stack pointer is 8 bits #1

wants to merge 1 commit into from

Conversation

BigEd
Copy link
Collaborator

@BigEd BigEd commented Oct 22, 2017

Untested - but it seems wrong to me and a simple fix. Unless I missed something.

@hoglet67
Copy link
Owner

It is actually exposed by the hardware as a 16 bit value:
https://github.com/hoglet67/AtomBusMon/blob/master/src/T6502/T65.vhd#L209
and
https://github.com/hoglet67/AtomBusMon/blob/master/src/AlanD/R65Cx2.vhd#L1522

I'm not sure why in the T65 core S is 16-bits; possibly because the core also claims some degree of 65C816 compatibility.

I stuck with 16 bits so the value displayed to the user is actually the memory address being pointed at.

Dave

@hoglet67 hoglet67 closed this Oct 22, 2017
@BigEd
Copy link
Collaborator Author

BigEd commented Oct 22, 2017

Ah, right, the '816 - support for which in T65 is very slight, AFAICT, but the intention is there.

(In the stardot thread the value displayed is not a normal 6502 stack value, which would always be in page one. That seems odd. Perhaps the T65 masks the high byte when in '02 mode and it is essentially uninitialised.)

@hoglet67
Copy link
Owner

Ah, in that case this is a bug....
#2

I think the best solution is for the C code to force the upper 8 bits to 0x01, i.e. ignore what the hardware is telling it.

@BigEd BigEd deleted the BigEd-patch-1 branch October 22, 2017 15:11
@BigEd
Copy link
Collaborator Author

BigEd commented Oct 22, 2017

Sounds like a plan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants