From 2f63e169edb3ba1e95a33719c021e1bab9d9ac8c Mon Sep 17 00:00:00 2001 From: WlodekM Date: Wed, 2 Apr 2025 20:59:59 +0300 Subject: stuff --- instructions/ORA.ts | 11 +++++++++++ instructions/PHA.ts | 6 ++++++ instructions/PHP.ts | 6 ++++++ instructions/PLA.ts | 6 ++++++ instructions/PLP.ts | 6 ++++++ 5 files changed, 35 insertions(+) create mode 100644 instructions/ORA.ts create mode 100644 instructions/PHA.ts create mode 100644 instructions/PHP.ts create mode 100644 instructions/PLA.ts create mode 100644 instructions/PLP.ts diff --git a/instructions/ORA.ts b/instructions/ORA.ts new file mode 100644 index 0000000..a9bd407 --- /dev/null +++ b/instructions/ORA.ts @@ -0,0 +1,11 @@ +import type The65c02 from "../65c02.ts"; + +export default function (this: The65c02, mode: string) { + const addr = this.getAddr(mode) + this.io.address.set(addr); + this.read() + const mem = this.io.data.num(); + const result = this.regA.num() | mem + this.flagZN(result); + this.regA.set(result & 0xFF); +} \ No newline at end of file diff --git a/instructions/PHA.ts b/instructions/PHA.ts new file mode 100644 index 0000000..0156db1 --- /dev/null +++ b/instructions/PHA.ts @@ -0,0 +1,6 @@ +import type The65c02 from "../65c02.ts"; + +export default function (this: The65c02) { + this.push(this.regA.num()); + this.programCounter.increment() +} \ No newline at end of file diff --git a/instructions/PHP.ts b/instructions/PHP.ts new file mode 100644 index 0000000..3f00c3d --- /dev/null +++ b/instructions/PHP.ts @@ -0,0 +1,6 @@ +import type The65c02 from "../65c02.ts"; + +export default function (this: The65c02) { + this.push(this.status.num()); + this.programCounter.increment() +} \ No newline at end of file diff --git a/instructions/PLA.ts b/instructions/PLA.ts new file mode 100644 index 0000000..586a0e9 --- /dev/null +++ b/instructions/PLA.ts @@ -0,0 +1,6 @@ +import type The65c02 from "../65c02.ts"; + +export default function (this: The65c02) { + this.regA.set(this.pop()); + this.programCounter.increment() +} \ No newline at end of file diff --git a/instructions/PLP.ts b/instructions/PLP.ts new file mode 100644 index 0000000..255ed32 --- /dev/null +++ b/instructions/PLP.ts @@ -0,0 +1,6 @@ +import type The65c02 from "../65c02.ts"; + +export default function (this: The65c02) { + this.status.set(this.pop()); + this.programCounter.increment() +} \ No newline at end of file -- cgit 1.4.1-2-gfad0