diff options
author | WlodekM <[email protected]> | 2025-04-05 08:59:56 +0300 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-04-05 08:59:56 +0300 |
commit | 5b26ed42a61f8cfb057b050257d77920ea41e3f3 (patch) | |
tree | ea0b759a304ec62bd95c84406e0869c88f9b33d4 /65c02.ts | |
parent | 562e6237bb58919d800f431cb38de1784efbbe98 (diff) |
fix some stack stuff, not sure if it should be 0xFF or 0x0 on startup but whatever
Diffstat (limited to '65c02.ts')
-rw-r--r-- | 65c02.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/65c02.ts b/65c02.ts index 9805d50..7fa0516 100644 --- a/65c02.ts +++ b/65c02.ts @@ -190,7 +190,7 @@ export default class The65c02 { //SECTION - utils /** push stuff onto stack */ push(val: number) { - if (this.stackPointer.num() >= 0xFF) + if (this.stackPointer.num() == 0) console.error('stack overflow (no, not like the website)'); this.stackPointer.increment(); this.io.address.set(0x01FF - this.stackPointer.num()); @@ -198,7 +198,7 @@ export default class The65c02 { this.write(); } pop(): number { - if (this.stackPointer.num() <= 0) + if (this.stackPointer.num() == 0xFF) console.error('stack underflow'); this.io.address.set(0x01FF - this.stackPointer.num()); this.read() |