You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the provided code does this, to someone newer at this kind of thing, it looks like it doesn't
I'd recommend changing the implementation to the following:
uint8_tolc6502::ASL()
{
fetch();
SetFlag(C, (fetched & 0x80)); //this will return either a 1 or a 0, so we don't need > 0 here
fetched = (uint8_t)(fetched << 1); //could also be replaced with fetched *= 2. the cast is to prevent the possibility of the compiler upgrading fetched to uint16_t)SetFlag(Z, (fetched & 0xFF) == 0x00);
SetFlag(N, fetched & 0x80); //funnily enough, this is the same code we use to initially set the carry flag since bit 7 is the signif (lookup[opcode].addrmode == &olc6502::IMP)
a = fetched;
elsewrite(addr_abs, fetched);
return0;
}
This is pretty much my implementation of this opcode, and I was checking against the source code provided and initially thought I was doing something wrong (even though I'm not newer to this, I've written a full CHIP 8 emulator and done some other things using binary for a private server project). It took longer than I'd like to admit to realise that the code provided does the same thing, it just does some extra things that could be removed (yay optimization).
The text was updated successfully, but these errors were encountered:
Per: http://www.obelisk.me.uk/6502/reference.html#TSX
C = the contents of the old bit 7
While the provided code does this, to someone newer at this kind of thing, it looks like it doesn't
I'd recommend changing the implementation to the following:
This is pretty much my implementation of this opcode, and I was checking against the source code provided and initially thought I was doing something wrong (even though I'm not newer to this, I've written a full CHIP 8 emulator and done some other things using binary for a private server project). It took longer than I'd like to admit to realise that the code provided does the same thing, it just does some extra things that could be removed (yay optimization).
The text was updated successfully, but these errors were encountered: