wiz-lang / wiz

A high-level assembly language for writing homebrew software and games on retro console platforms.
http://wiz-lang.org/
Other
409 stars 40 forks source link

65c02: wrong opcode for jmp (addr, X) #138

Closed est77 closed 2 years ago

est77 commented 2 years ago

In src/wiz/platform/mos6502_platform.cpp:

builtins.createInstruction(InstructionSignature(BranchKind::Goto, 0, {patternAtLeast0, patternIndirectJumpIndexedByX}), encodingU16Operand, InstructionOptions({0x6C}, {1}, {}));

But 0x6c is the opcode for jmp (addr). The correct opcode for jmp (addr, X) is 0x7C according to http://www.6502.org/tutorials/65c02opcodes.html

est77 commented 2 years ago

I think that the last commit that fixes zp $ n reintroduced this bug: https://github.com/wiz-lang/wiz/commit/4625c29ee4842b7d63e183149c37c69e024d479a#diff-7744eaa157ef71a64645b81480de1a5807f6639cda900e88790e9e3db1e7cd16R516

Bananattack commented 2 years ago

Whoops! I'll look into this one.

est77 commented 2 years ago

Thanks!