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

Op LDmmSP isn't implemented #6

Open
elvishfiend opened this issue Dec 2, 2016 · 2 comments
Open

Op LDmmSP isn't implemented #6

elvishfiend opened this issue Dec 2, 2016 · 2 comments

Comments

@elvishfiend
Copy link

elvishfiend commented Dec 2, 2016

LDmmSP appears in _map but doesn't appear to be implemented anywhere.

@Ayymoose
Copy link

Ayymoose commented Apr 5, 2018

Yeah I noticed this too. According to a manual for the gameboy, it just loads a 16-bit address to the stack pointer.

@Akhil841
Copy link

Akhil841 commented Aug 8, 2022

It actually writes the value of the stack pointer to a memory address and the location that follows, with the first memory address being passed as an imm16.

For more information, see
Game Boy Opcode Periodic Table
The Pan Docs

I'll include the pseudocode for my implementation here, for anyone who's reading this issue and is stumped on how to implement it, like I was.

pseudocode (C++):

void STR_IMM16_SP()
{
    unsigned short value = mmu.rw(pc);
    mmu.ww(value, sp);
    pc += 2;
    m = 5;
}

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

No branches or pull requests

3 participants