summaryrefslogtreecommitdiff
path: root/cpu_dsl.py
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2019-02-04 22:20:51 -0800
committerMichael Pavone <pavone@retrodev.com>2019-02-04 22:20:51 -0800
commitd0d4e82bb1bf7c8f61093566dbb2588580fa2860 (patch)
treeb09ded35d4a5bf3060ae9d2f0318ee5b73dfbf4b /cpu_dsl.py
parente8c201a05d2ce6a8ca693b1b1d1cefe5737c7688 (diff)
Implement DD/FD prefixes for instructions that don't reference HL
Diffstat (limited to 'cpu_dsl.py')
-rwxr-xr-xcpu_dsl.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/cpu_dsl.py b/cpu_dsl.py
index 859521b..a5016b6 100755
--- a/cpu_dsl.py
+++ b/cpu_dsl.py
@@ -1316,7 +1316,6 @@ class Program:
opmap[val] = inst.generateName(val)
bodymap[val] = inst.generateBody(val, self, otype)
- pieces.append('\ntypedef void (*impl_fun)({pre}context *context);'.format(pre=self.prefix))
pieces.append('\nstatic impl_fun impl_{name}[{sz}] = {{'.format(name = table, sz=len(opmap)))
for inst in range(0, len(opmap)):
op = opmap[inst]
@@ -1335,8 +1334,12 @@ class Program:
body.append('#include "{0}"\n'.format(include))
body.append('\nstatic void unimplemented({pre}context *context)'.format(pre = self.prefix))
body.append('\n{')
- body.append('\n\tfatal_error("Unimplemented instruction");')
+ body.append('\n\tfatal_error("Unimplemented instruction\\n");')
body.append('\n}\n')
+ body.append('\ntypedef void (*impl_fun)({pre}context *context);'.format(pre=self.prefix))
+ for table in self.extra_tables:
+ body.append('\nstatic impl_fun impl_{name}[{sz}];'.format(name = table, sz=(1 << self.opsize)))
+ body.append('\nstatic impl_fun impl_main[{sz}];'.format(sz=(1 << self.opsize)))
for table in self.extra_tables:
self._buildTable(otype, table, body)
self._buildTable(otype, 'main', body)