1
0
mirror of https://github.com/pevans/erc-c.git synced 2026-04-25 12:17:19 +00:00

Fix stack in several ways

1. The stack should descend, not ascend;
2. The stack should be pushed byte for byte; meaning, when pushing P or
A, those should consume one byte, not two;
3. The MSB should be pushed first when doing JSR and BRK, which makes
some sense if you were reading the stack from $0100 - $01FF.
This commit is contained in:
Peter Evans
2018-01-21 01:09:42 -06:00
parent 42c7fcbb47
commit 0581ed6b44
4 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -136,13 +136,13 @@ extern int mos6502_instruction(vm_8bit);
extern mos6502 *mos6502_create(vm_segment *, vm_segment *);
extern mos6502_instruction_handler mos6502_get_instruction_handler(vm_8bit);
extern vm_16bit mos6502_get16(mos6502 *, size_t);
extern vm_16bit mos6502_pop_stack(mos6502 *);
extern vm_8bit mos6502_get(mos6502 *, size_t);
extern vm_8bit mos6502_pop_stack(mos6502 *);
extern void mos6502_execute(mos6502 *);
extern void mos6502_free(mos6502 *);
extern void mos6502_last_executed(mos6502 *, vm_8bit *, vm_8bit *, vm_16bit *);
extern void mos6502_modify_status(mos6502 *, vm_8bit, int, int);
extern void mos6502_push_stack(mos6502 *, vm_16bit);
extern void mos6502_push_stack(mos6502 *, vm_8bit);
extern void mos6502_set(mos6502 *, size_t, vm_8bit);
extern void mos6502_set16(mos6502 *, size_t, vm_16bit);
extern void mos6502_set_memory(mos6502 *, vm_segment *, vm_segment *);