summaryrefslogtreecommitdiff
path: root/converter_blank_funs.py
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2024-06-09 13:11:05 +0530
committervin <git@vineetk.net>2024-06-09 13:11:05 +0530
commit76b9059b2e299dca5a96cf94f21038002f4dad3a (patch)
tree13057c696da6140f2bf8569578a9ef4e2494a2b6 /converter_blank_funs.py
parent207c6903f57f2364770c466dbe9807581ef96dc5 (diff)
add blank todo opcode functions based on opcode json
Diffstat (limited to 'converter_blank_funs.py')
-rw-r--r--converter_blank_funs.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/converter_blank_funs.py b/converter_blank_funs.py
new file mode 100644
index 0000000..9502ca8
--- /dev/null
+++ b/converter_blank_funs.py
@@ -0,0 +1,31 @@
+import json
+
+address_mode_table = {
+ 'Implied': 'AM_ACC',
+ 'Immediate': 'AM_IMM',
+ 'Zero Page': 'AM_ZP',
+ 'Zero Page, X': 'AM_ZP_X',
+ 'Zero Page, Y': 'AM_ZP_Y',
+ 'Absolute': 'AM_ABS',
+ 'Absolute, X': 'AM_ABS_X',
+ 'Absolute, Y': 'AM_ABS_Y',
+ 'Indirect': 'AM_IND',
+ '(Indirect)': 'AM_IND',
+ '(Indirect, X)': 'AM_IND_X',
+ '(Indirect), Y': 'AM_IND_Y',
+}
+
+# https://github.com/ericTheEchidna/65C02-JSON/
+j = json.load(open('opcodes_65c02.json', 'r'))
+
+#print(j)
+
+for i in j:
+ #print(i)
+ instruction = str.lower(i["instruction"])
+ print('''
+static void
+''' + instruction + '''(uint8_t arg)
+{
+/* TODO: complete this */
+}''')