bugzmanov / nes_ebook

A mini book on writing NES emulator using rust lang

Home Page:https://bugzmanov.github.io/nes_ebook/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why is stack reset at 0x10FD?

yunxing opened this issue · comments

Hi... looking at the code https://github.com/bugzmanov/nes_ebook/blob/master/code/ch8/src/cpu.rs#L31 I wonder why the stack is reset at 0x10FD, shouldn't it start at 0x10FF according to the spec?

Hey @yunxing . Thanks for reading! :)
Good question. This nesdev forum might bring some light: https://forums.nesdev.com/viewtopic.php?f=3&t=19858.
So I believe the proper way would be to start 0x10FF and they to execute reset interrupt that will put zeros to 0x10FF and 0x10FE, but looks like I took a shortcut and just start stack from 0x10FD.

If you'll create a PR that clarifies this POINT in the chapter on interrupts, I would be very grateful :)

Thanks for replying!

If you'll create a PR that clarifies this POINT in the chapter on interrupts

Guess I will have to read that chapter first :)