summary refs log tree commit diff
path: root/instructions
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2025-04-03 10:04:09 +0300
committerWlodekM <[email protected]>2025-04-03 10:04:09 +0300
commit22bf543c4feca33cfcd68c57de516761bb64a553 (patch)
tree88600a6cde308d907bfecb8d5e0b0588670b198f /instructions
parent0424cc4e5b5aeffd56f680f36333a4a27fc43a76 (diff)
wdc65c02 memory bit instructions
Diffstat (limited to 'instructions')
-rw-r--r--instructions/CMB0.ts10
-rw-r--r--instructions/CMB1.ts10
-rw-r--r--instructions/CMB2.ts10
-rw-r--r--instructions/CMB3.ts10
-rw-r--r--instructions/CMB4.ts10
-rw-r--r--instructions/CMB5.ts10
-rw-r--r--instructions/CMB6.ts10
-rw-r--r--instructions/CMB7.ts10
-rw-r--r--instructions/DEC.ts1
-rw-r--r--instructions/SMB0.ts10
-rw-r--r--instructions/SMB1.ts10
-rw-r--r--instructions/SMB2.ts10
-rw-r--r--instructions/SMB3.ts10
-rw-r--r--instructions/SMB4.ts10
-rw-r--r--instructions/SMB5.ts10
-rw-r--r--instructions/SMB6.ts10
-rw-r--r--instructions/SMB7.ts10
17 files changed, 161 insertions, 0 deletions
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