diff options
author | WlodekM <[email protected]> | 2025-04-03 10:29:58 +0300 |
---|---|---|
committer | WlodekM <[email protected]> | 2025-04-03 10:29:58 +0300 |
commit | c50e619bef9ecd2266ee904b87c6401cb0572660 (patch) | |
tree | 4b25b2daba31d9f542ed5dcb3d61e95c5d186bec /instructions/BRK.ts | |
parent | 22bf543c4feca33cfcd68c57de516761bb64a553 (diff) |
fix stuff
Diffstat (limited to 'instructions/BRK.ts')
-rw-r--r-- | instructions/BRK.ts | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/instructions/BRK.ts b/instructions/BRK.ts index 419eeef..6a2f4e1 100644 --- a/instructions/BRK.ts +++ b/instructions/BRK.ts @@ -1,25 +1,18 @@ import type The65c02 from "../65c02.ts"; -export default function (this: The65c02, mode: string) { - switch (mode) { - case 'implied': - this.io.interruptRequest.HI() - //TODO: push shit onto stack - this.push(this.programCounter.num() & 0x00FF) - this.push(this.programCounter.num() & 0xFF00) - this.push(this.status.num()) - this.io.data.set(this.programCounter.num() & 0x00FF) - this.io.address.set(0xFFFF) - this.write() - this.io.data.set(this.programCounter.num() & 0xFF00) - this.io.address.set(0xFFFE) - this.write() - this.BRK = true - this.programCounter.increment(); - this.programCounter.increment(); - break; - - default: - throw 'wha'; - } +export default function (this: The65c02) { + this.io.interruptRequest.HI() + //TODO: push shit onto stack + this.push(this.programCounter.num() & 0x00FF) + this.push(this.programCounter.num() & 0xFF00) + this.push(this.status.num()) + this.io.data.set(this.programCounter.num() & 0x00FF) + this.io.address.set(0xFFFF) + this.write() + this.io.data.set(this.programCounter.num() & 0xFF00) + this.io.address.set(0xFFFE) + this.write() + this.BRK = true + this.programCounter.increment(); + this.programCounter.increment(); } \ No newline at end of file |