1
0
mirror of https://github.com/mre/mos6502.git synced 2024-11-28 07:49:19 +00:00

correct endianness for program counter push

This commit is contained in:
Sam M W 2023-04-15 21:01:08 +01:00
parent 239992ea6c
commit 1c31a73a2b

View File

@ -353,7 +353,7 @@ impl<M: Bus> CPU<M> {
(Instruction::JMP, OpInput::UseAddress(addr)) => self.jump(addr),
(Instruction::JSR, OpInput::UseAddress(addr)) => {
for b in self.registers.program_counter.wrapping_sub(1).to_le_bytes() {
for b in self.registers.program_counter.wrapping_sub(1).to_be_bytes() {
self.push_on_stack(b);
}
self.jump(addr);