From 22bf543c4feca33cfcd68c57de516761bb64a553 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Thu, 3 Apr 2025 10:04:09 +0300 Subject: wdc65c02 memory bit instructions --- instructions/CMB0.ts | 10 ++++++++++ instructions/CMB1.ts | 10 ++++++++++ instructions/CMB2.ts | 10 ++++++++++ instructions/CMB3.ts | 10 ++++++++++ instructions/CMB4.ts | 10 ++++++++++ instructions/CMB5.ts | 10 ++++++++++ instructions/CMB6.ts | 10 ++++++++++ instructions/CMB7.ts | 10 ++++++++++ instructions/DEC.ts | 1 + instructions/SMB0.ts | 10 ++++++++++ instructions/SMB1.ts | 10 ++++++++++ instructions/SMB2.ts | 10 ++++++++++ instructions/SMB3.ts | 10 ++++++++++ instructions/SMB4.ts | 10 ++++++++++ instructions/SMB5.ts | 10 ++++++++++ instructions/SMB6.ts | 10 ++++++++++ instructions/SMB7.ts | 10 ++++++++++ 17 files changed, 161 insertions(+) create mode 100644 instructions/CMB0.ts create mode 100644 instructions/CMB1.ts create mode 100644 instructions/CMB2.ts create mode 100644 instructions/CMB3.ts create mode 100644 instructions/CMB4.ts create mode 100644 instructions/CMB5.ts create mode 100644 instructions/CMB6.ts create mode 100644 instructions/CMB7.ts create mode 100644 instructions/SMB0.ts create mode 100644 instructions/SMB1.ts create mode 100644 instructions/SMB2.ts create mode 100644 instructions/SMB3.ts create mode 100644 instructions/SMB4.ts create mode 100644 instructions/SMB5.ts create mode 100644 instructions/SMB6.ts create mode 100644 instructions/SMB7.ts diff --git a/instructions/CMB0.ts b/instructions/CMB0.ts new file mode 100644 index 0000000..587ea49 --- /dev/null +++ b/instructions/CMB0.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(0, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB1.ts b/instructions/CMB1.ts new file mode 100644 index 0000000..7b95fee --- /dev/null +++ b/instructions/CMB1.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(1, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB2.ts b/instructions/CMB2.ts new file mode 100644 index 0000000..8d154df --- /dev/null +++ b/instructions/CMB2.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(2, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB3.ts b/instructions/CMB3.ts new file mode 100644 index 0000000..a3b77df --- /dev/null +++ b/instructions/CMB3.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(3, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB4.ts b/instructions/CMB4.ts new file mode 100644 index 0000000..3e21bad --- /dev/null +++ b/instructions/CMB4.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(4, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB5.ts b/instructions/CMB5.ts new file mode 100644 index 0000000..b842b05 --- /dev/null +++ b/instructions/CMB5.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(5, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB6.ts b/instructions/CMB6.ts new file mode 100644 index 0000000..872cdec --- /dev/null +++ b/instructions/CMB6.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(6, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/CMB7.ts b/instructions/CMB7.ts new file mode 100644 index 0000000..ad8d0a5 --- /dev/null +++ b/instructions/CMB7.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(7, false) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/DEC.ts b/instructions/DEC.ts index 9f14487..2f9d7a9 100644 --- a/instructions/DEC.ts +++ b/instructions/DEC.ts @@ -6,5 +6,6 @@ export default function (this: The65c02, mode: string) { this.read(); const res = this.io.data.num() - 1; this.io.data.set(res & 0xFF); + this.write(); this.flagZN(res & 0xFF) } \ No newline at end of file diff --git a/instructions/SMB0.ts b/instructions/SMB0.ts new file mode 100644 index 0000000..dbc1205 --- /dev/null +++ b/instructions/SMB0.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(0, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB1.ts b/instructions/SMB1.ts new file mode 100644 index 0000000..90fd057 --- /dev/null +++ b/instructions/SMB1.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(1, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB2.ts b/instructions/SMB2.ts new file mode 100644 index 0000000..a2e743d --- /dev/null +++ b/instructions/SMB2.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(2, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB3.ts b/instructions/SMB3.ts new file mode 100644 index 0000000..84bdbe6 --- /dev/null +++ b/instructions/SMB3.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(3, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB4.ts b/instructions/SMB4.ts new file mode 100644 index 0000000..d3c720b --- /dev/null +++ b/instructions/SMB4.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(4, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB5.ts b/instructions/SMB5.ts new file mode 100644 index 0000000..cf39a01 --- /dev/null +++ b/instructions/SMB5.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(5, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB6.ts b/instructions/SMB6.ts new file mode 100644 index 0000000..81c10d3 --- /dev/null +++ b/instructions/SMB6.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(6, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file diff --git a/instructions/SMB7.ts b/instructions/SMB7.ts new file mode 100644 index 0000000..9a6e95c --- /dev/null +++ b/instructions/SMB7.ts @@ -0,0 +1,10 @@ +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(); + this.io.data.setBit(7, true) + this.write(); + // this.flagZN(res & 0xFF) +} \ No newline at end of file -- cgit 1.4.1-2-gfad0