mirror of
https://github.com/mre/mos6502.git
synced 2024-11-28 22:51:26 +00:00
first stab at implementing the JSR instruction
This commit is contained in:
parent
8e797b70fa
commit
239992ea6c
@ -352,6 +352,13 @@ impl<M: Bus> CPU<M> {
|
|||||||
|
|
||||||
(Instruction::JMP, OpInput::UseAddress(addr)) => self.jump(addr),
|
(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() {
|
||||||
|
self.push_on_stack(b);
|
||||||
|
}
|
||||||
|
self.jump(addr);
|
||||||
|
}
|
||||||
|
|
||||||
(Instruction::LDA, OpInput::UseImmediate(val)) => {
|
(Instruction::LDA, OpInput::UseImmediate(val)) => {
|
||||||
debug!("load A immediate: {}", val);
|
debug!("load A immediate: {}", val);
|
||||||
self.load_accumulator(val as i8);
|
self.load_accumulator(val as i8);
|
||||||
|
Loading…
Reference in New Issue
Block a user