Comments (3)
This one has been tested on real hardware, which was found to conform to its documentation — which annoyingly I can't immediately find the primary source for, but which is retained in e.g. https://www.nesdev.org/6502_cpu.txt :
JSR
# address R/W description
--- ------- --- -------------------------------------------------
1 PC R fetch opcode, increment PC
2 PC R fetch low address byte, increment PC
3 $0100,S R internal operation (predecrement S?)
4 $0100,S W push PCH on stack, decrement S
5 $0100,S W push PCL on stack, decrement S
6 PC R copy low address byte to PCL, fetch high address
byte to PCH
So I don't know what Ghidra thinks is going on but the sequence of events in that test is:
- read opcode and low byte of destination address;
- push current program counter to the stack, which modifies the instruction in-flight;
- read high byte of destination address, which is now what was just written to the stack.
I feel like the original WDC specification of the above was in an application note rather than the original data sheet, so I'll keep looking and update if I can find the primary source.
from processortests.
Thanks, you answered my question. I appreciate it.
from processortests.
Such as it helps; I found a contemporary primary source: the Synertek hardware manual on page A-10 (page 174 of the PDF) which indicates the same thing — that 'Fetch high order byte of Subroutine Address' occurs after both of the stack pushes.
from processortests.
Related Issues (20)
- JSR high byte issue HOT 3
- 65816: DBR should not be reset on BRK/COP in emulation mode
- 65816: Emulation mode stack wrapping HOT 2
- 65816: (dp,x) emulation mode page wrapping
- 65816: More emulation mode stack wrapping HOT 2
- Possible wrong cycle count for NES 6502 0C and 1/3/5/7/D/FC HOT 4
- 8088 Test Suite HOT 4
- Inconsistency of the negative flag in decimal mode across 6502 emulators HOT 2
- nes6502 README.md has incorrect sample HOT 1
- 8088 8D instruction (LEA) test has LEA r, r forms. HOT 4
- The 6502 tests assume the P register has bits 4 & 5.
- Opcode 6B Respects D Flag on NES Tests
- Opcode 9C/9E: nes6502 Result Inconsistent with Test ROM HOT 2
- 8088: some `name`s refer to `si` but should refer to `di` HOT 7
- Possibly wrong test case d133 [ADD.b D0, (d8, A3, Xn)] HOT 2
- 68000: Suggestion for additional DIVS/DIVU test cases
- Test case issue `5ca0` `ADD.l Q, -(A0)` HOT 2
- 65816: missing coverage for zero flag in 16-bit adds
- 6502 CMOS (rockwell and WDC) have incorrect tests for BBR/BBS? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from processortests.