1
0
mirror of https://github.com/lefticus/6502-cpp.git synced 2025-07-09 22:24:11 +00:00

Better stack handling. We now require -mtiny-stack from GCC

This commit is contained in:
Jason Turner
2021-05-08 22:58:55 -06:00
parent baf9c092ea
commit a4edf7194e
5 changed files with 49 additions and 13 deletions

View File

@ -103,6 +103,10 @@ bool optimize(std::vector<mos6502> &instructions)
}
}
// todo: fix this ldy redundant move, right now it doesn't
// take into account if Y has been used
/*
for (size_t op = 0; op < instructions.size() - 1; ++op) {
if (instructions[op].opcode == mos6502::OpCode::ldy && instructions[op].op.type == Operand::Type::literal) {
auto op2 = op + 1;
@ -116,7 +120,9 @@ bool optimize(std::vector<mos6502> &instructions)
++op2;
}
}
}
}
*/
for (size_t op = 0; op < instructions.size() - 1; ++op) {
if (instructions[op].opcode == mos6502::OpCode::lda