From 74342149b52ff715c66d25216e32b7689490cbdb Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:41:39 +0000 Subject: [PATCH 01/69] Create new branch named "ab22" From 68fd6b48893714903068c9c81bac9664cf6a8eb5 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:38 +0000 Subject: [PATCH 02/69] First very prototype version of ab2. --- Makefile | 16 ++-- build.py | 19 ++++ build/ab2.py | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 285 insertions(+), 7 deletions(-) create mode 100644 build.py create mode 100644 build/ab2.py diff --git a/Makefile b/Makefile index 3b604023..de561ab8 100644 --- a/Makefile +++ b/Makefile @@ -4,17 +4,19 @@ export CFLAGS = -g -O0 export LDFLAGS = -g export NINJAFLAGS = -all: $(OBJ)/build.ninja - @ninja -f $(OBJ)/build.ninja $(NINJAFLAGS) +all: $(OBJ)/build.mk + @make -f $(OBJ)/build.mk hide= y clean: @echo CLEAN @rm -rf $(OBJ) bin -lua-files = $(shell find . -name 'build*.lua') $(wildcard build/*.lua) toolchains.lua -$(OBJ)/build.ninja: mkninja.lua Makefile $(lua-files) - @echo MKNINJA +build-files = $(shell find . -name 'build.py') +$(OBJ)/build.mk: build/ab2.py Makefile $(build-files) + @echo ACKBUILDER @mkdir -p $(OBJ) - @$(LUA) \ - mkninja.lua \ + @python3 \ + build/ab2.py \ + -m make \ + build.py \ > $@ diff --git a/build.py b/build.py new file mode 100644 index 00000000..75e5b532 --- /dev/null +++ b/build.py @@ -0,0 +1,19 @@ +simplerule( + name="main", + ins=["README.md"], + outs=["x"], + commands=[ + "cp {ins} {outs}" + ] +) + +simplerule( + name="y", + ins=["+main"], + outs=["y"], + commands=[ + "cp {ins} {outs}" + ], + label="Y" +) + diff --git a/build/ab2.py b/build/ab2.py new file mode 100644 index 00000000..d01d5b41 --- /dev/null +++ b/build/ab2.py @@ -0,0 +1,257 @@ +from collections.abc import Iterable +import argparse +import functools +import inspect +import os.path +import re +import sys + +defaultGlobals = {} +targets = {} +cwd = "." +unmaterialisedTargets = set() +emitter = None + + +class ABException(BaseException): + pass + + +class Invocation: + name = None + callback = None + types = None + ins = [] + outs = [] + rawArgs = {} + + def materialise(self): + if self in unmaterialisedTargets: + self.args = {} + for k, v in self.rawArgs.items(): + t = self.types.get(k, None) + if t: + v = t.convert(v) + self.args[k] = v + + self.callback.__globals__["self"] = self + self.callback(**self.args) + unmaterialisedTargets.remove(self) + + +class Type: + pass + + +class String(Type): + def convert(self, value): + if type(value) != "string": + raise ABException("rule wanted a String, but got a "+type(value)) + return value + + +class Strings(Type): + def convert(self, value): + if type(value) == "string": + value = [value] + return value + + +class Targets(Type): + def convert(self, value): + if type(value) is str: + value = [value] + if type(value) is list: + value = [targetof(v) for v in value] + return value + + +def debug(*s): + print(*s, file=sys.stderr) + + +def flatten(*xs): + def recurse(xs): + for x in xs: + if isinstance(x, Iterable) and not isinstance(x, (str, bytes)): + yield from recurse(x) + else: + yield x + + return list(recurse(xs)) + + +def targetof(s): + if isinstance(s, Invocation): + return s + + if s.startswith("+"): + s = cwd + s + if s.startswith("./"): + s = cwd + "/" + s + + if s in targets: + t = targets[s] + t.materialise() + return t + + if "+" in s: + raise ABException("target reference %s not supported yet" % s) + else: + i = Invocation() + i.outs = [s] + targets[s] = i + return i + + +def targetsof(*xs): + return flatten([targetof(x) for x in flatten(xs)]) + + +def filenamesof(*xs): + xs = targetsof(xs) + + f = [] + for t in xs: + f += t.outs + return f + + +def emit(*args): + print(*flatten(args)) + + +def unmake(ss): + return ss + + +def templateexpand(s, invocation): + class Converter: + def __getitem__(self, key): + f = filenamesof(invocation.args[key]) + if type(f) is list: + return " ".join(f) + return f + + return eval("f%r" % s, invocation.callback.__globals__, Converter()) + + +class MakeEmitter: + def begin(self): + emit("hide = @") + + def end(self): + pass + + def var(self, name, value): + # Don't let emit insert spaces. + emit(name+"="+value) + + def rule(self, name, ins, outs): + if outs: + emit(".PHONY:", name) + emit(name, ":", outs) + emit(outs, "&:", ins) + else: + emit(name, ":", ins) + + def exec(self, command): + emit("\t$(hide)", command) + + +class NinjaEmitter: + def begin(self): + emit("rule build\n") + emit(" command = $command\n") + emit("\n") + + def var(self, name, value): + # Don't let emit insert spaces. + emit(name+"="+unmake(value)) + + def rule(self, name, ins, outs): + if outs: + emit("build", name, ": phony", unmake(outs)) + emit("build", unmake(outs), ": build", unmake(ins)) + else: + emit("build", name, ": phony", unmake(ins)) + + +def Rule(func): + name = func.__name__ + sig = inspect.signature(func) + + @functools.wraps(func) + def wrapper(*, name, **kwargs): + bound = sig.bind(name=name, **kwargs) + bound.apply_defaults() + + i = Invocation() + i.fullname = cwd + "+" + name + i.name = name + i.rawArgs = bound.arguments + i.types = func.__annotations__ + i.callback = func + + targets[i.fullname] = i + unmaterialisedTargets.add(i) + + defaultGlobals[name] = wrapper + return wrapper + + +@Rule +def simplerule( + name=None, + ins: Targets() = [], + outs: Strings() = [], + deps: Targets() = [], + commands: Strings() = [], + label="RULE"): + + self.ins = ins + self.outs = outs + emitter.rule(self.fullname, filenamesof(ins, deps), outs) + emitter.exec(templateexpand("@echo {label} {ins}", self)) + for c in commands: + emitter.exec(templateexpand(c, self)) + + +def loadbuildfile(filename): + with open(filename, "r") as fp: + global cwd + code = compile(fp.read(), filename, + mode="exec") + oldCwd = cwd + cwd = os.path.dirname(filename) + if cwd == "": + cwd = "." + exec(code, dict(defaultGlobals, CWD=cwd)) + cwd = oldCwd + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument( + "-m", "--mode", choices=["make", "ninja"], default="make") + parser.add_argument("files", nargs="+") + args = parser.parse_args() + + global emitter + if args.mode == "make": + emitter = MakeEmitter() + else: + emitter = NinjaEmitter() + emitter.begin() + + for f in args.files: + loadbuildfile(f) + + while unmaterialisedTargets: + debug(len(unmaterialisedTargets)) + next(iter(unmaterialisedTargets)).materialise() + + emitter.end() + + +main() From 73a210794127e86156556eb1e5ba3336e87c7019 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:39 +0000 Subject: [PATCH 03/69] Most of the rule engine seems to work, including inherited variables. --- Makefile | 2 +- build.py | 30 +++---- build/ab2.py | 179 ++++++++++++++++++++++++++++++++++++----- build/c.py | 22 +++++ tools/tubeemu/build.py | 0 5 files changed, 193 insertions(+), 40 deletions(-) create mode 100644 build/c.py create mode 100644 tools/tubeemu/build.py diff --git a/Makefile b/Makefile index de561ab8..e1148c41 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export LDFLAGS = -g export NINJAFLAGS = all: $(OBJ)/build.mk - @make -f $(OBJ)/build.mk hide= y + @make -f $(OBJ)/build.mk hide= +cfile clean: @echo CLEAN diff --git a/build.py b/build.py index 75e5b532..6d3a84b0 100644 --- a/build.py +++ b/build.py @@ -1,19 +1,15 @@ -simplerule( - name="main", - ins=["README.md"], - outs=["x"], - commands=[ - "cp {ins} {outs}" - ] -) +from os.path import * -simplerule( - name="y", - ins=["+main"], - outs=["y"], - commands=[ - "cp {ins} {outs}" - ], - label="Y" -) +installable( + name="all", + items={ + "bbctube.o": "tools/tubeemu+bbctube", + }) +cfile( + name="cfile", + srcs=["tools/tubeemu/bbctube.c"], + vars={ + "+cflags": ["-Ithird_party/lib6502"] + } +) diff --git a/build/ab2.py b/build/ab2.py index d01d5b41..3dd4cd02 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -1,22 +1,67 @@ -from collections.abc import Iterable +from collections.abc import Iterable, Sequence +from os.path import * import argparse import functools import inspect -import os.path import re import sys +import copy defaultGlobals = {} targets = {} -cwd = "." +cwd = "" unmaterialisedTargets = set() emitter = None +currentVars = None class ABException(BaseException): pass +class ParameterList(Sequence): + def __init__(self, parent=[]): + self.data = parent + + def __getitem__(self, i): + return self.data[i] + + def __len__(self): + return len(self.data) + + def __str__(self): + return " ".join(self.data) + + def __add__(self, other): + newdata = self.data.copy() + other + return ParameterList(newdata) + + def __repr__(self): + return f"" + + +def Vars(parent=None): + data = {} + + class VarsImpl: + def __setattr__(self, k, v): + data[k] = v + + def __getattr__(self, k): + if k in data: + return data[k] + if parent: + return getattr(parent, k) + return ParameterList() + + def __repr__(self): + return f" {parent}>" + + __setitem__ = __setattr__ + __getitem__ = __getattr__ + + return VarsImpl() + class Invocation: name = None callback = None @@ -24,6 +69,8 @@ class Invocation: ins = [] outs = [] rawArgs = {} + vars = None + varsettings = None def materialise(self): if self in unmaterialisedTargets: @@ -34,10 +81,34 @@ def materialise(self): v = t.convert(v) self.args[k] = v + global currentVars + self.vars = Vars(self.callerVars) + oldVars = currentVars + currentVars = self.vars + + if self.varsettings: + for k, v in self.varsettings.items(): + if k.startswith("+"): + k = k[1:] + self.vars[k] = self.vars[k] + flatten(v) + else: + self.vars[k] = ParameterList(v) + self.callback.__globals__["self"] = self - self.callback(**self.args) + newInvocation = self.callback(**self.args) + newInvocation = newInvocation or self + if newInvocation != self: + for k in dir(newInvocation): + if not k.startswith("_"): + setattr(self, k, getattr(newInvocation, k)) + self.materialise() + + currentVars = oldVars unmaterialisedTargets.remove(self) + def __str__(self): + return "" % self.fullname + class Type: pass @@ -128,9 +199,11 @@ def unmake(ss): def templateexpand(s, invocation): class Converter: def __getitem__(self, key): + if key == "vars": + return invocation.vars f = filenamesof(invocation.args[key]) - if type(f) is list: - return " ".join(f) + if isinstance(f, Sequence): + f = ParameterList(f) return f return eval("f%r" % s, invocation.callback.__globals__, Converter()) @@ -145,18 +218,18 @@ def end(self): def var(self, name, value): # Don't let emit insert spaces. - emit(name+"="+value) + emit(name+"="+unmake(value)) def rule(self, name, ins, outs): if outs: emit(".PHONY:", name) - emit(name, ":", outs) - emit(outs, "&:", ins) + emit(name, ":", unmake(outs)) + emit(outs, "&:", unmake(ins)) else: - emit(name, ":", ins) + emit(name, ":", unmake(ins)) def exec(self, command): - emit("\t$(hide)", command) + emit("\t$(hide)", unmake(command)) class NinjaEmitter: @@ -180,21 +253,29 @@ def rule(self, name, ins, outs): def Rule(func): name = func.__name__ sig = inspect.signature(func) + if "self" in func.__globals__: + os.exit() @functools.wraps(func) def wrapper(*, name, **kwargs): - bound = sig.bind(name=name, **kwargs) - bound.apply_defaults() - i = Invocation() + i.cwd = cwd i.fullname = cwd + "+" + name i.name = name - i.rawArgs = bound.arguments i.types = func.__annotations__ i.callback = func + i.callerVars = currentVars + i.varsettings = kwargs.get("vars", None) + if i.varsettings: + kwargs.pop("vars") + + bound = sig.bind(name=name, **kwargs) + bound.apply_defaults() + i.rawArgs = bound.arguments targets[i.fullname] = i unmaterialisedTargets.add(i) + return i defaultGlobals[name] = wrapper return wrapper @@ -204,28 +285,72 @@ def wrapper(*, name, **kwargs): def simplerule( name=None, ins: Targets() = [], - outs: Strings() = [], + outs=[], deps: Targets() = [], commands: Strings() = [], label="RULE"): - self.ins = ins self.outs = outs emitter.rule(self.fullname, filenamesof(ins, deps), outs) - emitter.exec(templateexpand("@echo {label} {ins}", self)) + emitter.exec(templateexpand("echo {label} {ins}", self)) + + for out in filenamesof(outs): + dir = dirname(out) + if dir: + emitter.exec("mkdir -p "+dir) + for c in commands: emitter.exec(templateexpand(c, self)) +@Rule +def normalrule( + name=None, + ins: Targets() = [], + deps: Targets() = [], + outleaves=[], + label="RULE", + objdir=None, + commands=[]): + objdir = objdir or join("$(OBJ)", self.cwd, name) + + return simplerule( + name=name, + ins=ins, + deps=deps, + outs=[join(objdir, f) for f in outleaves], + label=label, + commands=commands) + + +@Rule +def installable( + name=None, + items={}): + + emitter.rule(self.fullname, filenamesof(items.values()), items.keys()) + emitter.exec(templateexpand("echo EXPORT {name}", self)) + + for dest, src in items.items(): + dir = dirname(dest) + if dir: + emitter.exec("mkdir -p "+dir) + + srcs = filenamesof(src) + if len(srcs) != 1: + raise ABException( + "a dependency of an installable must have exactly one output file") + + emitter.exec("cp %s %s" % (srcs[0], dest)) + + def loadbuildfile(filename): with open(filename, "r") as fp: global cwd code = compile(fp.read(), filename, mode="exec") oldCwd = cwd - cwd = os.path.dirname(filename) - if cwd == "": - cwd = "." + cwd = dirname(filename) exec(code, dict(defaultGlobals, CWD=cwd)) cwd = oldCwd @@ -244,12 +369,22 @@ def main(): emitter = NinjaEmitter() emitter.begin() + global currentVars + currentVars = Vars() + + for k in ("Rule", "Targets"): + defaultGlobals[k] = globals()[k] + defaultGlobals["print"] = debug + for f in args.files: loadbuildfile(f) while unmaterialisedTargets: - debug(len(unmaterialisedTargets)) + total = len(targets) + finished = total - len(unmaterialisedTargets) + sys.stderr.write("%d/%d\r" % (finished, total)) next(iter(unmaterialisedTargets)).materialise() + sys.stderr.write("%d/%d\n" % (total, total)) emitter.end() diff --git a/build/c.py b/build/c.py new file mode 100644 index 00000000..07d71fcf --- /dev/null +++ b/build/c.py @@ -0,0 +1,22 @@ +@Rule +def cfile(name, + srcs: Targets() = [], + deps: Targets() = [], + suffix=".o", + commands=[ + "$(CC) -c -o {outs[0]} {ins[0]} {deps} {vars.cflags}" + ], + label="CC"): + if not name: + name = filenamesof(srcs)[1] + + outleaf = basename(name) + suffix + + return normalrule( + name=name, + ins=srcs, + deps=deps, + outleaves=[outleaf], + label=label, + commands=commands) + diff --git a/tools/tubeemu/build.py b/tools/tubeemu/build.py new file mode 100644 index 00000000..e69de29b From f845fadc3d3c65b0b87c14c96266cd6142201459 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:39 +0000 Subject: [PATCH 04/69] I think the new build system may actually be working! --- Makefile | 6 +- build.py | 11 +- build/ab2.py | 259 ++++++++++++++++++++++++++--------- build/c.py | 83 ++++++++++- third_party/lib6502/build.py | 7 + tools/tubeemu/build.py | 9 ++ 6 files changed, 291 insertions(+), 84 deletions(-) create mode 100644 third_party/lib6502/build.py diff --git a/Makefile b/Makefile index e1148c41..2bf97b45 100644 --- a/Makefile +++ b/Makefile @@ -5,14 +5,14 @@ export LDFLAGS = -g export NINJAFLAGS = all: $(OBJ)/build.mk - @make -f $(OBJ)/build.mk hide= +cfile + @make -f $(OBJ)/build.mk +all clean: @echo CLEAN @rm -rf $(OBJ) bin -build-files = $(shell find . -name 'build.py') -$(OBJ)/build.mk: build/ab2.py Makefile $(build-files) +build-files = $(shell find . -name 'build.py') build/*.py +$(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) @python3 \ diff --git a/build.py b/build.py index 6d3a84b0..96713e25 100644 --- a/build.py +++ b/build.py @@ -1,15 +1,8 @@ +from build.ab2 import Rule, installable from os.path import * installable( name="all", items={ - "bbctube.o": "tools/tubeemu+bbctube", + "bbctube": "tools/tubeemu+bbctube", }) - -cfile( - name="cfile", - srcs=["tools/tubeemu/bbctube.c"], - vars={ - "+cflags": ["-Ithird_party/lib6502"] - } -) diff --git a/build/ab2.py b/build/ab2.py index 3dd4cd02..88f6e410 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -1,19 +1,48 @@ from collections.abc import Iterable, Sequence from os.path import * +from types import SimpleNamespace import argparse +import copy import functools +import importlib +import importlib.abc +import importlib.util import inspect import re import sys -import copy +import types +import pathlib +import builtins defaultGlobals = {} targets = {} -cwd = "" +currentInvocation = None unmaterialisedTargets = set() emitter = None currentVars = None +sys.path += ["."] +old_import = builtins.__import__ + + +def new_import(name, *args, **kwargs): + if name not in sys.modules: + path = name.replace(".", "/")+".py" + if isfile(path): + sys.stderr.write(f"loading {path}\n") + loader = importlib.machinery.SourceFileLoader(name, path) + + spec = importlib.util.spec_from_loader( + name, loader, origin="built-in") + module = importlib.util.module_from_spec(spec) + sys.modules[name] = module + spec.loader.exec_module(module) + + return old_import(name, *args, **kwargs) + + +builtins.__import__ = new_import + class ABException(BaseException): pass @@ -62,25 +91,36 @@ def __repr__(self): return VarsImpl() + class Invocation: name = None callback = None types = None - ins = [] - outs = [] - rawArgs = {} + ins = None + outs = None + rawArgs = None vars = None varsettings = None def materialise(self): if self in unmaterialisedTargets: + # Create a new invocation frame. + + global currentInvocation + oldInvocation = currentInvocation + currentInvocation = self + + # Perform type conversion to the declared rule parameter types. + self.args = {} for k, v in self.rawArgs.items(): t = self.types.get(k, None) if t: - v = t.convert(v) + v = t.convert(v, self) self.args[k] = v + # Create a new variable frame and set any variables. + global currentVars self.vars = Vars(self.callerVars) oldVars = currentVars @@ -94,20 +134,32 @@ def materialise(self): else: self.vars[k] = ParameterList(v) - self.callback.__globals__["self"] = self - newInvocation = self.callback(**self.args) - newInvocation = newInvocation or self - if newInvocation != self: - for k in dir(newInvocation): - if not k.startswith("_"): - setattr(self, k, getattr(newInvocation, k)) - self.materialise() + # Actually call the callback. If it returns another invocation, + # then replace the current one with it. + + proxy = self.callback(**self.args) + currentInvocation = oldInvocation + + if proxy: + if self.ins or self.outs: + raise ABException( + f"{self.name} is a proxy, but sets self.ins or self.outs") + proxy.materialise() + self.ins = [proxy] + self.outs = proxy.outs + else: + if not self.outs: + raise ABException( + f"{self.name} is not a proxy, but didn't set self.outs") + + # Destack the variable and invocation frame. currentVars = oldVars unmaterialisedTargets.remove(self) + currentInvocation = oldInvocation - def __str__(self): - return "" % self.fullname + def __repr__(self): + return "" % self.name class Type: @@ -115,28 +167,36 @@ class Type: class String(Type): - def convert(self, value): + def convert(self, value, invocation): if type(value) != "string": raise ABException("rule wanted a String, but got a "+type(value)) return value class Strings(Type): - def convert(self, value): + def convert(self, value, invocation): if type(value) == "string": value = [value] return value class Targets(Type): - def convert(self, value): + def convert(self, value, invocation): if type(value) is str: value = [value] if type(value) is list: - value = [targetof(v) for v in value] + value = targetsof(value, cwd=invocation.cwd) return value +class TargetsMap(Type): + def convert(self, value, invocation): + if type(value) is dict: + return { + targetof(k, cwd=invocation.cwd): targetof(v, cwd=invocation.cwd) for k, v in value.items()} + raise ABException(f"wanted a dict of targets, got a {type(value)}") + + def debug(*s): print(*s, file=sys.stderr) @@ -152,40 +212,78 @@ def recurse(xs): return list(recurse(xs)) -def targetof(s): +def massagefilename(s): + callername = inspect.stack()[1][0].f_globals["__name__"] + cwd = dirname(callername.replace(".", "/")) + + if ("+" in name) and not name.startswith("+"): + (cwd, target) = name.split("+", 1) + + i = Invocation() + if name.startswith("./"): + name = join(cwd, name) + elif "+" not in name: + name = cwd + "+" + name + + +def targetof(s, cwd): if isinstance(s, Invocation): + s.materialise() return s - if s.startswith("+"): - s = cwd + s - if s.startswith("./"): - s = cwd + "/" + s - if s in targets: t = targets[s] t.materialise() return t - if "+" in s: - raise ABException("target reference %s not supported yet" % s) - else: - i = Invocation() - i.outs = [s] - targets[s] = i - return i + if s.startswith("+"): + s = cwd + s + if s.startswith("./"): + s = join(cwd, s) + + if "+" not in s: + if isdir(s): + s = s + "+" + basename(s) + else: + i = Invocation() + i.name = "(anonymous)" + i.outs = [s] + targets[s] = i + return i + (path, target) = s.split("+", 2) + loadbuildfile(join(path, "build.py")) + if not s in targets: + raise ABException( + f"build file at {path} doesn't contain +{target}") + i = targets[s] + i.materialise() + return i -def targetsof(*xs): - return flatten([targetof(x) for x in flatten(xs)]) + +def targetsof(*xs, cwd): + return flatten([targetof(x, cwd) for x in flatten(xs)]) def filenamesof(*xs): - xs = targetsof(xs) + fs = [] + for t in flatten(xs): + if type(t) == str: + fs += [t] + else: + fs += [normpath(f) for f in t.outs] + return fs + - f = [] - for t in xs: - f += t.outs - return f +def filenameof(x): + xs = filenamesof(x) + if len(xs) != 1: + raise ABException("expected a single item") + return xs[0] + + +def stripext(path): + return splitext(path)[0] def emit(*args): @@ -251,39 +349,51 @@ def rule(self, name, ins, outs): def Rule(func): - name = func.__name__ sig = inspect.signature(func) - if "self" in func.__globals__: - os.exit() @functools.wraps(func) def wrapper(*, name, **kwargs): + callername = inspect.stack()[1][0].f_globals["__name__"] + cwd = dirname(callername.replace(".", "/")) + + if ("+" in name) and not name.startswith("+"): + (cwd, target) = name.split("+", 1) + i = Invocation() - i.cwd = cwd - i.fullname = cwd + "+" + name + if name.startswith("./"): + name = join(cwd, name) + elif "+" not in name: + name = cwd + "+" + name + i.name = name + i.cwd = cwd i.types = func.__annotations__ i.callback = func i.callerVars = currentVars i.varsettings = kwargs.get("vars", None) - if i.varsettings: - kwargs.pop("vars") + setattr(i, func.__name__, SimpleNamespace()) - bound = sig.bind(name=name, **kwargs) + kwargs.pop("vars", None) + + bound = sig.bind(name=name, self=i, **kwargs) bound.apply_defaults() i.rawArgs = bound.arguments - targets[i.fullname] = i + if name in targets: + raise ABException(f"target {i.name} has already been defined") + + targets[name] = i unmaterialisedTargets.add(i) return i - defaultGlobals[name] = wrapper + defaultGlobals[func.__name__] = wrapper return wrapper @Rule def simplerule( - name=None, + self, + name, ins: Targets() = [], outs=[], deps: Targets() = [], @@ -291,7 +401,7 @@ def simplerule( label="RULE"): self.ins = ins self.outs = outs - emitter.rule(self.fullname, filenamesof(ins, deps), outs) + emitter.rule(self.name, filenamesof(ins, deps), outs) emitter.exec(templateexpand("echo {label} {ins}", self)) for out in filenamesof(outs): @@ -305,6 +415,7 @@ def simplerule( @Rule def normalrule( + self, name=None, ins: Targets() = [], deps: Targets() = [], @@ -312,10 +423,10 @@ def normalrule( label="RULE", objdir=None, commands=[]): - objdir = objdir or join("$(OBJ)", self.cwd, name) + objdir = objdir or join("$(OBJ)", name) return simplerule( - name=name, + name=name+"/simplerule", ins=ins, deps=deps, outs=[join(objdir, f) for f in outleaves], @@ -325,14 +436,19 @@ def normalrule( @Rule def installable( + self, name=None, - items={}): + items: TargetsMap() = {}): - emitter.rule(self.fullname, filenamesof(items.values()), items.keys()) - emitter.exec(templateexpand("echo EXPORT {name}", self)) + emitter.rule(self.name, filenamesof( + items.values()), filenamesof(items.keys())) + emitter.exec(f"echo EXPORT {self.name}") + self.ins = items.values() + self.outs = [] for dest, src in items.items(): - dir = dirname(dest) + destf = filenameof(dest) + dir = dirname(destf) if dir: emitter.exec("mkdir -p "+dir) @@ -341,18 +457,20 @@ def installable( raise ABException( "a dependency of an installable must have exactly one output file") - emitter.exec("cp %s %s" % (srcs[0], dest)) + emitter.exec("cp %s %s" % (srcs[0], destf)) + self.outs += destf def loadbuildfile(filename): - with open(filename, "r") as fp: - global cwd - code = compile(fp.read(), filename, - mode="exec") - oldCwd = cwd - cwd = dirname(filename) - exec(code, dict(defaultGlobals, CWD=cwd)) - cwd = oldCwd + filename = filename.replace("/", ".").removesuffix(".py") + builtins.__import__(filename) + + +def load(filename): + loadbuildfile(filename) + callerglobals = inspect.stack()[1][0].f_globals + for k, v in defaultGlobals.items(): + callerglobals[k] = v def main(): @@ -372,13 +490,18 @@ def main(): global currentVars currentVars = Vars() - for k in ("Rule", "Targets"): + for k in ("Rule", "Targets", "load", "filenamesof", "stripext"): defaultGlobals[k] = globals()[k] defaultGlobals["print"] = debug + global __name__ + sys.modules["build.ab2"] = sys.modules[__name__] + __name__ = "build.ab2" + for f in args.files: loadbuildfile(f) + total = 0 while unmaterialisedTargets: total = len(targets) finished = total - len(unmaterialisedTargets) diff --git a/build/c.py b/build/c.py index 07d71fcf..c5f87c4b 100644 --- a/build/c.py +++ b/build/c.py @@ -1,22 +1,97 @@ +from build.ab2 import Rule, Targets, normalrule, filenamesof, stripext, debug, flatten +from os.path import * + + @Rule -def cfile(name, +def cfile(self, + name, srcs: Targets() = [], deps: Targets() = [], suffix=".o", commands=[ - "$(CC) -c -o {outs[0]} {ins[0]} {deps} {vars.cflags}" + "$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}" ], label="CC"): if not name: name = filenamesof(srcs)[1] - outleaf = basename(name) + suffix + headers = [filenamesof(d.clibrary.hdrs) for d in deps if d.clibrary] + headers = set(["-I"+dirname(f) for f in flatten(headers)]) + + outleaf = stripext(basename(name)) + suffix return normalrule( - name=name, + name=name + "/cfile", ins=srcs, deps=deps, outleaves=[outleaf], label=label, + commands=commands, + vars={ + "+cflags": flatten(headers) + } + ) + + +@Rule +def clibrary(self, + name, + srcs: Targets() = [], + deps: Targets() = [], + hdrs: Targets() = [], + commands=[ + "$(AR) cqs {outs[0]} {ins}" + ], + label="AR"): + + ins = [ + cfile( + name=name+"/"+basename(filenamesof(f)[0]), + srcs=[f], + deps=deps + ) + for f in srcs + ] + + r = normalrule( + name=name+"/clibrary", + ins=ins, + outleaves=[basename(name) + ".a"], + label=label, commands=commands) + r.materialise() + + self.ins = [r] + self.outs = r.outs + self.clibrary.hdrs = hdrs + + +@Rule +def cprogram(self, + name, + srcs: Targets() = [], + deps: Targets() = [], + commands=[ + "$(CC) -o {outs[0]} {ins} {vars.libraries}" + ], + label="CLINK"): + libraries = [d.outs for d in deps if d.clibrary] + + ins = [ + cfile( + name=name+"/"+basename(filenamesof(f)[0]), + srcs=[f], + deps=deps, + ) + for f in srcs + ] + return normalrule( + name=name+"/cprogram", + ins=ins, + outleaves=[basename(name)], + label=label, + commands=commands, + vars={ + "+libraries": libraries + }) diff --git a/third_party/lib6502/build.py b/third_party/lib6502/build.py new file mode 100644 index 00000000..1b39e44d --- /dev/null +++ b/third_party/lib6502/build.py @@ -0,0 +1,7 @@ +from build.c import clibrary + +clibrary( + name="lib6502", + srcs=["./lib6502.c"], + hdrs=["./lib6502.h"], +) diff --git a/tools/tubeemu/build.py b/tools/tubeemu/build.py index e69de29b..ca7130f3 100644 --- a/tools/tubeemu/build.py +++ b/tools/tubeemu/build.py @@ -0,0 +1,9 @@ +from build.c import cprogram + +cprogram( + name="bbctube", + srcs=["./bbctube.c"], + deps=[ + "third_party/lib6502" + ] +) From 411da4823bb4aa9135c7a14dc2b0791285759190 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:40 +0000 Subject: [PATCH 05/69] Actually start building some programs. --- Makefile | 8 +-- build.py | 11 +++- build/ab2.py | 9 +-- build/c.py | 120 ++++++++++++++++++++++-------------- third_party/apout/build.py | 30 +++++++++ third_party/djlink/build.py | 51 +++++++++++++++ tools/build.py | 11 ++++ tools/obpemu/build.py | 12 ++++ 8 files changed, 195 insertions(+), 57 deletions(-) create mode 100644 third_party/apout/build.py create mode 100644 third_party/djlink/build.py create mode 100644 tools/build.py create mode 100644 tools/obpemu/build.py diff --git a/Makefile b/Makefile index 2bf97b45..d3f703bc 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export LDFLAGS = -g export NINJAFLAGS = all: $(OBJ)/build.mk - @make -f $(OBJ)/build.mk +all + @+make -f $(OBJ)/build.mk +all clean: @echo CLEAN @@ -15,8 +15,4 @@ build-files = $(shell find . -name 'build.py') build/*.py $(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) - @python3 \ - build/ab2.py \ - -m make \ - build.py \ - > $@ + @python3 build/ab2.py -m make build.py > $@ diff --git a/build.py b/build.py index 96713e25..fcfecc63 100644 --- a/build.py +++ b/build.py @@ -4,5 +4,12 @@ installable( name="all", items={ - "bbctube": "tools/tubeemu+bbctube", - }) + "bin/bbctube": "tools/tubeemu+bbctube", + "bin/obpemu": "tools/obpemu", + "bin/mkadfs": "tools+mkadfs", + "bin/mkdfs": "tools+mkdfs", + "bin/apout": "third_party/apout", + }, + deps=[ + "third_party/djlink+djlink-programs" + ]) diff --git a/build/ab2.py b/build/ab2.py index 88f6e410..71453a44 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -402,7 +402,7 @@ def simplerule( self.ins = ins self.outs = outs emitter.rule(self.name, filenamesof(ins, deps), outs) - emitter.exec(templateexpand("echo {label} {ins}", self)) + emitter.exec(templateexpand("echo {label} {name}", self)) for out in filenamesof(outs): dir = dirname(out) @@ -438,10 +438,11 @@ def normalrule( def installable( self, name=None, - items: TargetsMap() = {}): + items: TargetsMap() = {}, + deps: Targets() = []): emitter.rule(self.name, filenamesof( - items.values()), filenamesof(items.keys())) + items.values(), deps), filenamesof(items.keys())) emitter.exec(f"echo EXPORT {self.name}") self.ins = items.values() @@ -458,7 +459,7 @@ def installable( "a dependency of an installable must have exactly one output file") emitter.exec("cp %s %s" % (srcs[0], destf)) - self.outs += destf + self.outs += [destf] def loadbuildfile(filename): diff --git a/build/c.py b/build/c.py index c5f87c4b..a624cc98 100644 --- a/build/c.py +++ b/build/c.py @@ -1,17 +1,8 @@ -from build.ab2 import Rule, Targets, normalrule, filenamesof, stripext, debug, flatten +from build.ab2 import Rule, Targets, normalrule, filenamesof, filenameof, stripext, debug, flatten from os.path import * -@Rule -def cfile(self, - name, - srcs: Targets() = [], - deps: Targets() = [], - suffix=".o", - commands=[ - "$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}" - ], - label="CC"): +def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): if not name: name = filenamesof(srcs)[1] @@ -21,18 +12,59 @@ def cfile(self, outleaf = stripext(basename(name)) + suffix return normalrule( - name=name + "/cfile", + name=name + "/" + kind, ins=srcs, deps=deps, outleaves=[outleaf], label=label, commands=commands, - vars={ - "+cflags": flatten(headers) - } - ) + vars={ + "+"+flags: flatten(headers) + } + ) + + +@Rule +def cfile(self, + name, + srcs: Targets() = [], + deps: Targets() = [], + suffix=".o", + commands=[ + "$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}" + ], + label="CC"): + return cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", "cflags") +@Rule +def cxxfile(self, + name, + srcs: Targets() = [], + deps: Targets() = [], + suffix=".o", + commands=[ + "$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}" + ], + label="CXX"): + return cfileimpl(self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags") + + +def findsources(name, srcs, deps): + ins = [] + for i in srcs: + f = filenameof(i) + if f.endswith(".c") or f.endswith(".cc"): + ins += [ + cfile( + name=name+"/"+basename(filenamesof(f)[0]), + srcs=[f], + deps=deps + ) + ] + return ins + + @Rule def clibrary(self, name, @@ -44,18 +76,9 @@ def clibrary(self, ], label="AR"): - ins = [ - cfile( - name=name+"/"+basename(filenamesof(f)[0]), - srcs=[f], - deps=deps - ) - for f in srcs - ] - r = normalrule( name=name+"/clibrary", - ins=ins, + ins=findsources(name, srcs, deps), outleaves=[basename(name) + ".a"], label=label, commands=commands) @@ -66,32 +89,39 @@ def clibrary(self, self.clibrary.hdrs = hdrs +def programimpl(self, name, srcs, deps, commands, label, filerule, kind): + libraries = [d.outs for d in deps if d.clibrary] + + return normalrule( + name=name+"/"+kind, + ins=findsources(name, srcs, deps), + outleaves=[basename(name)], + label=label, + commands=commands, + vars={ + "+ldflags": libraries + }) + + @Rule def cprogram(self, name, srcs: Targets() = [], deps: Targets() = [], commands=[ - "$(CC) -o {outs[0]} {ins} {vars.libraries}" + "$(CC) -o {outs[0]} {ins} {vars.ldflags}" ], label="CLINK"): - libraries = [d.outs for d in deps if d.clibrary] + return programimpl(self, name, srcs, deps, commands, label, cfile, "cprogram") - ins = [ - cfile( - name=name+"/"+basename(filenamesof(f)[0]), - srcs=[f], - deps=deps, - ) - for f in srcs - ] - return normalrule( - name=name+"/cprogram", - ins=ins, - outleaves=[basename(name)], - label=label, - commands=commands, - vars={ - "+libraries": libraries - }) +@Rule +def cxxprogram(self, + name, + srcs: Targets() = [], + deps: Targets() = [], + commands=[ + "$(CXX) -o {outs[0]} {ins} {vars.ldflags}" + ], + label="CXXLINK"): + return programimpl(self, name, srcs, deps, commands, label, cxxfile, "cxxprogram") diff --git a/third_party/apout/build.py b/third_party/apout/build.py new file mode 100644 index 00000000..a9249623 --- /dev/null +++ b/third_party/apout/build.py @@ -0,0 +1,30 @@ +from build.c import cprogram + +cprogram( + name="apout", + srcs=[ + "./aout.c", + "./branch.c", + "./bsd_ioctl.c", + "./bsd_signal.c", + "./bsdtrap.c", + "./cpu.c", + "./debug.c", + "./double.c", + "./ea.c", + "./fp.c", + "./itab.c", + "./ke11a.c", + "./magic.c", + "./main.c", + "./single.c", + "./v1trap.c", + "./v7trap.c", + ], + vars={ + "+ldflags": ["-lm"], + "+cflags": [ + "-DEMUV1", + "-DNATIVES", "-DRUN_V1_RAW", "-DDEBUG", "-DZERO_MEMORY", "-DWRITEBASE", "-DHEX", + ]} +) diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py new file mode 100644 index 00000000..72e50585 --- /dev/null +++ b/third_party/djlink/build.py @@ -0,0 +1,51 @@ +from build.c import cxxprogram +from build.ab2 import installable + +cxxprogram( + name="objdump", + srcs=["./objdump.cc"], +) + +cxxprogram( + name="bindiff", + srcs=["./bindiff.cc"], +) + +cxxprogram( + name="djlink", + srcs=[ + "./djlink.cc", + "./fixups.cc", + "./libs.cc", + "./list.cc", + "./map.cc", + "./objs.cc", + "./out.cc", + "./quark.cc", + "./segments.cc", + "./stricmp.cc", + "./symbols.cc", + "./fixups.h", + "./libs.h", + "./link.h", + "./list.h", + "./map.h", + "./objs.h", + "./omf.h", + "./out.h", + "./quark.h", + "./segments.h", + "./stricmp.h", + "./symbols.h", + "./vars.h", + ], +) + +installable( + name="djlink-programs", + items={ + "bin/objdump": "+objdump", + "bin/bindiff": "+bindiff", + "bin/djlink": "+djlink", + } +) diff --git a/tools/build.py b/tools/build.py new file mode 100644 index 00000000..0ff9dc39 --- /dev/null +++ b/tools/build.py @@ -0,0 +1,11 @@ +from build.c import cprogram + +cprogram( + name="mkadfs", + srcs=["./mkadfs.c"], +) + +cprogram( + name="mkdfs", + srcs=["./mkdfs.c"], +) diff --git a/tools/obpemu/build.py b/tools/obpemu/build.py new file mode 100644 index 00000000..11581875 --- /dev/null +++ b/tools/obpemu/build.py @@ -0,0 +1,12 @@ +from build.c import cprogram + +cprogram( + name="obpemu", + srcs=[ + "./emulator.c", + "./main.c" + ], + vars={ + "+ldflags": "-lreadline" + } +) From 9fce893af2003d7f1bb938402ff178ad9597ba96 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:40 +0000 Subject: [PATCH 06/69] Build more things. --- Makefile | 2 +- build.py | 2 ++ build/ab2.py | 16 +++++++++++----- build/c.py | 16 +++++++++------- build/yacc.py | 15 +++++++++++++++ third_party/emu2/build.py | 22 ++++++++++++++++++++++ third_party/lemon/build.py | 12 ++++++++++++ third_party/zmac/build.py | 20 ++++++++++++++++++++ tools/cpmemu/build.py | 14 ++++++++++++++ 9 files changed, 106 insertions(+), 13 deletions(-) create mode 100644 build/yacc.py create mode 100644 third_party/emu2/build.py create mode 100644 third_party/lemon/build.py create mode 100644 third_party/zmac/build.py create mode 100644 tools/cpmemu/build.py diff --git a/Makefile b/Makefile index d3f703bc..503e001e 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,4 @@ build-files = $(shell find . -name 'build.py') build/*.py $(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) - @python3 build/ab2.py -m make build.py > $@ + @python3 -B build/ab2.py -m make build.py > $@ diff --git a/build.py b/build.py index fcfecc63..0a5682eb 100644 --- a/build.py +++ b/build.py @@ -9,6 +9,8 @@ "bin/mkadfs": "tools+mkadfs", "bin/mkdfs": "tools+mkdfs", "bin/apout": "third_party/apout", + "bin/emu2": "third_party/emu2", + "bin/zmac": "third_party/zmac", }, deps=[ "third_party/djlink+djlink-programs" diff --git a/build/ab2.py b/build/ab2.py index 71453a44..bea217cd 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -226,6 +226,14 @@ def massagefilename(s): name = cwd + "+" + name +def fileinvocation(s): + i = Invocation() + i.name = "(anonymous)" + i.outs = [s] + targets[s] = i + return i + + def targetof(s, cwd): if isinstance(s, Invocation): s.materialise() @@ -240,16 +248,14 @@ def targetof(s, cwd): s = cwd + s if s.startswith("./"): s = join(cwd, s) + if s.startswith("$"): + return fileinvocation(s) if "+" not in s: if isdir(s): s = s + "+" + basename(s) else: - i = Invocation() - i.name = "(anonymous)" - i.outs = [s] - targets[s] = i - return i + return fileinvocation(s) (path, target) = s.split("+", 2) loadbuildfile(join(path, "build.py")) diff --git a/build/c.py b/build/c.py index a624cc98..5656b9ed 100644 --- a/build/c.py +++ b/build/c.py @@ -6,8 +6,8 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): if not name: name = filenamesof(srcs)[1] - headers = [filenamesof(d.clibrary.hdrs) for d in deps if d.clibrary] - headers = set(["-I"+dirname(f) for f in flatten(headers)]) + dirs = [d.clibrary.dirs for d in deps if hasattr(d, "clibrary")] + dirs = set(["-I"+f for f in filenamesof(dirs)]) outleaf = stripext(basename(name)) + suffix @@ -19,7 +19,7 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): label=label, commands=commands, vars={ - "+"+flags: flatten(headers) + "+"+flags: flatten(dirs) } ) @@ -52,9 +52,8 @@ def cxxfile(self, def findsources(name, srcs, deps): ins = [] - for i in srcs: - f = filenameof(i) - if f.endswith(".c") or f.endswith(".cc"): + for f in filenamesof(srcs): + if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp"): ins += [ cfile( name=name+"/"+basename(filenamesof(f)[0]), @@ -64,7 +63,7 @@ def findsources(name, srcs, deps): ] return ins - + @Rule def clibrary(self, name, @@ -84,9 +83,12 @@ def clibrary(self, commands=commands) r.materialise() + dirs = set([dirname(f) for f in filenamesof(hdrs)]) + self.ins = [r] self.outs = r.outs self.clibrary.hdrs = hdrs + self.clibrary.dirs = dirs def programimpl(self, name, srcs, deps, commands, label, filerule, kind): diff --git a/build/yacc.py b/build/yacc.py new file mode 100644 index 00000000..398b1231 --- /dev/null +++ b/build/yacc.py @@ -0,0 +1,15 @@ +from build.ab2 import normalrule, Rule, Targets + + +@Rule +def yacc(self, + name, + srcs: Targets() = []): + return normalrule( + name=name+"/yacc", + ins=srcs, + outleaves=["y.tab.c", "y.tab.h"], + commands=[ + "bison -y -t -o {outs[0]} --defines={outs[1]} {ins}" + ] + ) diff --git a/third_party/emu2/build.py b/third_party/emu2/build.py new file mode 100644 index 00000000..11fbff7c --- /dev/null +++ b/third_party/emu2/build.py @@ -0,0 +1,22 @@ +from build.c import cprogram + +cprogram( + name="emu2", + srcs=[ + "./src/cpu.c", + "./src/loader.c", + "./src/main.c", + "./src/codepage.c", + "./src/dosnames.c", + "./src/dis.c", + "./src/dos.c", + "./src/keyb.c", + "./src/dbg.c", + "./src/timer.c", + "./src/utils.c", + "./src/video.c", + ], + vars={ + "+ldflags": ["-lm"] + } +) diff --git a/third_party/lemon/build.py b/third_party/lemon/build.py new file mode 100644 index 00000000..46604695 --- /dev/null +++ b/third_party/lemon/build.py @@ -0,0 +1,12 @@ +from build.ab2 import Rule +from build.c import cprogram + +cprogram( + name="lemon", + srcs=["./lemon.c"], +) + +cprogram( + name="lemon-cowgol", + srcs=["./lemon-cowgol.c"], +) diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py new file mode 100644 index 00000000..679ce051 --- /dev/null +++ b/third_party/zmac/build.py @@ -0,0 +1,20 @@ +from build.yacc import yacc +from build.c import cprogram + +yacc( + name="parser", + srcs=["third_party/zmac/zmac.y"], +) + +cprogram( + name="zmac", + srcs=[ + "+parser", + "./mio.c", + "./zi80dis.cpp", + "./zi80dis.h" + ], + vars={ + "+cflags": ["-Ithird_party/zmac"], + } +) diff --git a/tools/cpmemu/build.py b/tools/cpmemu/build.py new file mode 100644 index 00000000..f479529f --- /dev/null +++ b/tools/cpmemu/build.py @@ -0,0 +1,14 @@ +from build.c import cprogram + +cprogram( + name="cpmemu" + srcs=[ + "./main.c", + "./emulator.c", + "./fileio.c", + "./biosbdos.c", + ], + vars={ + "+ldflags": ["-lz80ex", "-lz80ex_dasm", "-lreadline"] + } +) From f33b2697cde0d31950a51a9b4b0f575089a7e044 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:40 +0000 Subject: [PATCH 07/69] Build even more things. Better proxies, don't write to stdout. --- Makefile | 2 +- build.py | 8 +- build/ab2.py | 107 ++++++++++++++------------ build/c.py | 142 ++++++++++++++++++++--------------- build/yacc.py | 11 +-- third_party/apout/build.py | 10 ++- third_party/djlink/build.py | 2 +- third_party/emu2/build.py | 4 +- third_party/musashi/build.py | 30 ++++++++ third_party/zmac/build.py | 25 ++++-- tools/ataritosemu/build.py | 18 +++++ tools/build.py | 12 +++ tools/cpmemu/build.py | 13 +++- tools/lx68kemu/build.py | 17 +++++ tools/obpemu/build.py | 9 +-- tools/tubeemu/build.py | 8 +- 16 files changed, 266 insertions(+), 152 deletions(-) create mode 100644 third_party/musashi/build.py create mode 100644 tools/ataritosemu/build.py create mode 100644 tools/lx68kemu/build.py diff --git a/Makefile b/Makefile index 503e001e..9ff89745 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,4 @@ build-files = $(shell find . -name 'build.py') build/*.py $(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) - @python3 -B build/ab2.py -m make build.py > $@ + @python3 -B build/ab2.py -m make -o $@ build.py diff --git a/build.py b/build.py index 0a5682eb..0a78e3c8 100644 --- a/build.py +++ b/build.py @@ -11,7 +11,9 @@ "bin/apout": "third_party/apout", "bin/emu2": "third_party/emu2", "bin/zmac": "third_party/zmac", + "bin/cpmemu": "tools/cpmemu", + "bin/ataritosemu": "tools/ataritosemu", + "bin/lx68kemu": "tools/lx68kemu", }, - deps=[ - "third_party/djlink+djlink-programs" - ]) + deps=["third_party/djlink+djlink-programs"], +) diff --git a/build/ab2.py b/build/ab2.py index bea217cd..40b082c3 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -18,6 +18,7 @@ targets = {} currentInvocation = None unmaterialisedTargets = set() +outputFp = None emitter = None currentVars = None @@ -27,13 +28,12 @@ def new_import(name, *args, **kwargs): if name not in sys.modules: - path = name.replace(".", "/")+".py" + path = name.replace(".", "/") + ".py" if isfile(path): sys.stderr.write(f"loading {path}\n") loader = importlib.machinery.SourceFileLoader(name, path) - spec = importlib.util.spec_from_loader( - name, loader, origin="built-in") + spec = importlib.util.spec_from_loader(name, loader, origin="built-in") module = importlib.util.module_from_spec(spec) sys.modules[name] = module spec.loader.exec_module(module) @@ -143,14 +143,17 @@ def materialise(self): if proxy: if self.ins or self.outs: raise ABException( - f"{self.name} is a proxy, but sets self.ins or self.outs") + f"{self.name} is a proxy, but sets self.ins or self.outs" + ) proxy.materialise() - self.ins = [proxy] - self.outs = proxy.outs + for k in dir(proxy): + if not k.startswith("_"): + setattr(self, k, getattr(proxy, k)) else: if not self.outs: raise ABException( - f"{self.name} is not a proxy, but didn't set self.outs") + f"{self.name} is not a proxy, but didn't set self.outs" + ) # Destack the variable and invocation frame. @@ -169,7 +172,7 @@ class Type: class String(Type): def convert(self, value, invocation): if type(value) != "string": - raise ABException("rule wanted a String, but got a "+type(value)) + raise ABException("rule wanted a String, but got a " + type(value)) return value @@ -189,18 +192,21 @@ def convert(self, value, invocation): return value +class Target(Type): + def convert(self, value, invocation): + return targetof(value, cwd=invocation.cwd) + + class TargetsMap(Type): def convert(self, value, invocation): if type(value) is dict: return { - targetof(k, cwd=invocation.cwd): targetof(v, cwd=invocation.cwd) for k, v in value.items()} + targetof(k, cwd=invocation.cwd): targetof(v, cwd=invocation.cwd) + for k, v in value.items() + } raise ABException(f"wanted a dict of targets, got a {type(value)}") -def debug(*s): - print(*s, file=sys.stderr) - - def flatten(*xs): def recurse(xs): for x in xs: @@ -260,8 +266,7 @@ def targetof(s, cwd): (path, target) = s.split("+", 2) loadbuildfile(join(path, "build.py")) if not s in targets: - raise ABException( - f"build file at {path} doesn't contain +{target}") + raise ABException(f"build file at {path} doesn't contain +{target}") i = targets[s] i.materialise() return i @@ -293,7 +298,8 @@ def stripext(path): def emit(*args): - print(*flatten(args)) + outputFp.write(" ".join(flatten(args))) + outputFp.write("\n") def unmake(ss): @@ -322,7 +328,7 @@ def end(self): def var(self, name, value): # Don't let emit insert spaces. - emit(name+"="+unmake(value)) + emit(name + "=" + unmake(value)) def rule(self, name, ins, outs): if outs: @@ -344,7 +350,7 @@ def begin(self): def var(self, name, value): # Don't let emit insert spaces. - emit(name+"="+unmake(value)) + emit(name + "=" + unmake(value)) def rule(self, name, ins, outs): if outs: @@ -372,6 +378,7 @@ def wrapper(*, name, **kwargs): name = cwd + "+" + name i.name = name + i.localname = name.split("+")[-1] i.cwd = cwd i.types = func.__annotations__ i.callback = func @@ -398,13 +405,14 @@ def wrapper(*, name, **kwargs): @Rule def simplerule( - self, - name, - ins: Targets() = [], - outs=[], - deps: Targets() = [], - commands: Strings() = [], - label="RULE"): + self, + name, + ins: Targets() = [], + outs=[], + deps: Targets() = [], + commands: Strings() = [], + label="RULE", +): self.ins = ins self.outs = outs emitter.rule(self.name, filenamesof(ins, deps), outs) @@ -413,7 +421,7 @@ def simplerule( for out in filenamesof(outs): dir = dirname(out) if dir: - emitter.exec("mkdir -p "+dir) + emitter.exec("mkdir -p " + dir) for c in commands: emitter.exec(templateexpand(c, self)) @@ -421,34 +429,32 @@ def simplerule( @Rule def normalrule( - self, - name=None, - ins: Targets() = [], - deps: Targets() = [], - outleaves=[], - label="RULE", - objdir=None, - commands=[]): + self, + name=None, + ins: Targets() = [], + deps: Targets() = [], + outleaves=[], + label="RULE", + objdir=None, + commands=[], +): objdir = objdir or join("$(OBJ)", name) return simplerule( - name=name+"/simplerule", + name=name + "/simplerule", ins=ins, deps=deps, outs=[join(objdir, f) for f in outleaves], label=label, - commands=commands) + commands=commands, + ) @Rule -def installable( - self, - name=None, - items: TargetsMap() = {}, - deps: Targets() = []): - - emitter.rule(self.name, filenamesof( - items.values(), deps), filenamesof(items.keys())) +def installable(self, name=None, items: TargetsMap() = {}, deps: Targets() = []): + emitter.rule( + self.name, filenamesof(items.values(), deps), filenamesof(items.keys()) + ) emitter.exec(f"echo EXPORT {self.name}") self.ins = items.values() @@ -457,12 +463,13 @@ def installable( destf = filenameof(dest) dir = dirname(destf) if dir: - emitter.exec("mkdir -p "+dir) + emitter.exec("mkdir -p " + dir) srcs = filenamesof(src) if len(srcs) != 1: raise ABException( - "a dependency of an installable must have exactly one output file") + "a dependency of an installable must have exactly one output file" + ) emitter.exec("cp %s %s" % (srcs[0], destf)) self.outs += [destf] @@ -482,11 +489,14 @@ def load(filename): def main(): parser = argparse.ArgumentParser() - parser.add_argument( - "-m", "--mode", choices=["make", "ninja"], default="make") + parser.add_argument("-m", "--mode", choices=["make", "ninja"], default="make") + parser.add_argument("-o", "--output") parser.add_argument("files", nargs="+") args = parser.parse_args() + global outputFp + outputFp = open(args.output, "wt") + global emitter if args.mode == "make": emitter = MakeEmitter() @@ -499,7 +509,6 @@ def main(): for k in ("Rule", "Targets", "load", "filenamesof", "stripext"): defaultGlobals[k] = globals()[k] - defaultGlobals["print"] = debug global __name__ sys.modules["build.ab2"] = sys.modules[__name__] diff --git a/build/c.py b/build/c.py index 5656b9ed..957a49e5 100644 --- a/build/c.py +++ b/build/c.py @@ -1,4 +1,12 @@ -from build.ab2 import Rule, Targets, normalrule, filenamesof, filenameof, stripext, debug, flatten +from build.ab2 import ( + Rule, + Targets, + normalrule, + filenamesof, + filenameof, + stripext, + flatten, +) from os.path import * @@ -6,8 +14,17 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): if not name: name = filenamesof(srcs)[1] - dirs = [d.clibrary.dirs for d in deps if hasattr(d, "clibrary")] - dirs = set(["-I"+f for f in filenamesof(dirs)]) + dirs = [] + for d in deps: + for f in filenamesof(d): + if f.endswith(".h"): + dirs += [dirname(f)] + try: + dirs += d.clibrary.dirs + except: + pass + + includeflags = set(["-I" + f for f in filenamesof(dirs)]) outleaf = stripext(basename(name)) + suffix @@ -18,36 +35,36 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): outleaves=[outleaf], label=label, commands=commands, - vars={ - "+"+flags: flatten(dirs) - } + vars={"+" + flags: flatten(includeflags)}, ) @Rule -def cfile(self, - name, - srcs: Targets() = [], - deps: Targets() = [], - suffix=".o", - commands=[ - "$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}" - ], - label="CC"): +def cfile( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + suffix=".o", + commands=["$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}"], + label="CC", +): return cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", "cflags") @Rule -def cxxfile(self, - name, - srcs: Targets() = [], - deps: Targets() = [], - suffix=".o", - commands=[ - "$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}" - ], - label="CXX"): - return cfileimpl(self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags") +def cxxfile( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + suffix=".o", + commands=["$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}"], + label="CXX", +): + return cfileimpl( + self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags" + ) def findsources(name, srcs, deps): @@ -56,31 +73,33 @@ def findsources(name, srcs, deps): if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp"): ins += [ cfile( - name=name+"/"+basename(filenamesof(f)[0]), - srcs=[f], - deps=deps + name=name + "/" + basename(filenamesof(f)[0]), srcs=[f], deps=deps ) ] return ins @Rule -def clibrary(self, - name, - srcs: Targets() = [], - deps: Targets() = [], - hdrs: Targets() = [], - commands=[ - "$(AR) cqs {outs[0]} {ins}" - ], - label="AR"): +def clibrary( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + hdrs: Targets() = [], + commands=["$(AR) cqs {outs[0]} {ins}"], + label="AR", +): + for f in filenamesof(srcs): + if f.endswith(".h"): + deps += [f] r = normalrule( - name=name+"/clibrary", + name=name + "/clibrary", ins=findsources(name, srcs, deps), outleaves=[basename(name) + ".a"], label=label, - commands=commands) + commands=commands, + ) r.materialise() dirs = set([dirname(f) for f in filenamesof(hdrs)]) @@ -92,38 +111,41 @@ def clibrary(self, def programimpl(self, name, srcs, deps, commands, label, filerule, kind): - libraries = [d.outs for d in deps if d.clibrary] + libraries = [d.outs for d in deps if hasattr(d, "clibrary")] + + for f in filenamesof(srcs): + if f.endswith(".h"): + deps += [f] return normalrule( - name=name+"/"+kind, + name=name + "/" + kind, ins=findsources(name, srcs, deps), outleaves=[basename(name)], label=label, commands=commands, - vars={ - "+ldflags": libraries - }) + vars={"+ldflags": libraries}, + ) @Rule -def cprogram(self, - name, - srcs: Targets() = [], - deps: Targets() = [], - commands=[ - "$(CC) -o {outs[0]} {ins} {vars.ldflags}" - ], - label="CLINK"): +def cprogram( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + commands=["$(CC) -o {outs[0]} {ins} {vars.ldflags}"], + label="CLINK", +): return programimpl(self, name, srcs, deps, commands, label, cfile, "cprogram") @Rule -def cxxprogram(self, - name, - srcs: Targets() = [], - deps: Targets() = [], - commands=[ - "$(CXX) -o {outs[0]} {ins} {vars.ldflags}" - ], - label="CXXLINK"): +def cxxprogram( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + commands=["$(CXX) -o {outs[0]} {ins} {vars.ldflags}"], + label="CXXLINK", +): return programimpl(self, name, srcs, deps, commands, label, cxxfile, "cxxprogram") diff --git a/build/yacc.py b/build/yacc.py index 398b1231..12840473 100644 --- a/build/yacc.py +++ b/build/yacc.py @@ -2,14 +2,11 @@ @Rule -def yacc(self, - name, - srcs: Targets() = []): +def yacc(self, name, srcs: Targets() = []): return normalrule( - name=name+"/yacc", + name=name + "/yacc", ins=srcs, outleaves=["y.tab.c", "y.tab.h"], - commands=[ - "bison -y -t -o {outs[0]} --defines={outs[1]} {ins}" - ] + commands=["bison -y -t -o {outs[0]} --defines={outs[1]} {ins}"], + label="YACC", ) diff --git a/third_party/apout/build.py b/third_party/apout/build.py index a9249623..a94b3480 100644 --- a/third_party/apout/build.py +++ b/third_party/apout/build.py @@ -25,6 +25,12 @@ "+ldflags": ["-lm"], "+cflags": [ "-DEMUV1", - "-DNATIVES", "-DRUN_V1_RAW", "-DDEBUG", "-DZERO_MEMORY", "-DWRITEBASE", "-DHEX", - ]} + "-DNATIVES", + "-DRUN_V1_RAW", + "-DDEBUG", + "-DZERO_MEMORY", + "-DWRITEBASE", + "-DHEX", + ], + }, ) diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py index 72e50585..95885909 100644 --- a/third_party/djlink/build.py +++ b/third_party/djlink/build.py @@ -47,5 +47,5 @@ "bin/objdump": "+objdump", "bin/bindiff": "+bindiff", "bin/djlink": "+djlink", - } + }, ) diff --git a/third_party/emu2/build.py b/third_party/emu2/build.py index 11fbff7c..b731d236 100644 --- a/third_party/emu2/build.py +++ b/third_party/emu2/build.py @@ -16,7 +16,5 @@ "./src/utils.c", "./src/video.c", ], - vars={ - "+ldflags": ["-lm"] - } + vars={"+ldflags": ["-lm"]}, ) diff --git a/third_party/musashi/build.py b/third_party/musashi/build.py new file mode 100644 index 00000000..3ab430a1 --- /dev/null +++ b/third_party/musashi/build.py @@ -0,0 +1,30 @@ +from build.ab2 import Rule, Target, normalrule +from build.c import clibrary, cprogram + +cprogram(name="m68kmake", srcs=["./m68kmake.c"]) + +normalrule( + name="m68kops", + ins=["+m68kmake", "./m68k_in.c"], + outleaves=["m68kops.c", "m68kops.h"], + commands=["{ins[0]} {dirname(outs[0])} {ins[1]} > /dev/null"], + label="MUSASHILIB", +) + + +@Rule +def musashilib(self, name, m68kconf: Target() = None): + return clibrary( + name=name + "/musashilib", + srcs=[ + m68kconf, + "third_party/musashi/m68kcpu.c", + "third_party/musashi/m68kcpu.h", + "third_party/musashi/m68kdasm.c", + "third_party/musashi/m68k.h", + "third_party/musashi/m68kmmu.h", + "third_party/musashi/softfloat/softfloat.c", + "third_party/musashi/softfloat/softfloat.h", + "third_party/musashi+m68kops", + ], + ) diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index 679ce051..308f6f2e 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -1,5 +1,7 @@ from build.yacc import yacc from build.c import cprogram +from build.ab2 import Rule, Targets, normalrule, filenameof +from os.path import * yacc( name="parser", @@ -8,13 +10,22 @@ cprogram( name="zmac", - srcs=[ - "+parser", - "./mio.c", - "./zi80dis.cpp", - "./zi80dis.h" - ], + srcs=["+parser", "./mio.c", "./zi80dis.cpp", "./zi80dis.h"], vars={ "+cflags": ["-Ithird_party/zmac"], - } + }, ) + + +@Rule +def zmac(self, name, srcs: Targets() = []): + filename, ext = splitext(filenameof(srcs)) + archflag = "-z" if (ext == "z80") else "-8" + + return normalrule( + name=name + "/zmac", + ins=["third_party/zmac", srcs[0]], + outleaves=[self.localname + ".cim", self.localname + ".lst"], + commands=["{ins[0]} -j -m " + archflag + " -o {outs[0]} -o {outs[1]} {ins[1]}"], + label="ZMAC", + ) diff --git a/tools/ataritosemu/build.py b/tools/ataritosemu/build.py new file mode 100644 index 00000000..78c29574 --- /dev/null +++ b/tools/ataritosemu/build.py @@ -0,0 +1,18 @@ +from build.c import cprogram +from third_party.musashi.build import musashilib + +musashilib( + name="musashi", + m68kconf="tools/ataritosemu/m68kconf.h", +) + +cprogram( + name="ataritosemu", + srcs=[ + "./gemdos.c", + "./sim.c", + "./sim.h", + "third_party/musashi/m68k.h", + ], + deps=["+musashi"], +) diff --git a/tools/build.py b/tools/build.py index 0ff9dc39..deeddfde 100644 --- a/tools/build.py +++ b/tools/build.py @@ -1,4 +1,5 @@ from build.c import cprogram +from build.ab2 import Rule, Target, normalrule cprogram( name="mkadfs", @@ -9,3 +10,14 @@ name="mkdfs", srcs=["./mkdfs.c"], ) + + +@Rule +def objectify(self, name, src: Target() = None, symbol=None): + return normalrule( + name=name + "/objectify", + ins=["tools/objectify", src], + outleaves=[symbol + ".c"], + commands=["lua {ins[0]} " + symbol + " < {ins[1]} > {outs}"], + label="OBJECTIFY", + ) diff --git a/tools/cpmemu/build.py b/tools/cpmemu/build.py index f479529f..0fcb8888 100644 --- a/tools/cpmemu/build.py +++ b/tools/cpmemu/build.py @@ -1,14 +1,19 @@ from build.c import cprogram +from third_party.zmac.build import zmac +from tools.build import objectify + +zmac(name="biosbdos", srcs=["./biosbdos.z80"]) + +objectify(name="biosbdosdata", src="+biosbdos", symbol="biosbdosdata") cprogram( - name="cpmemu" + name="cpmemu", srcs=[ "./main.c", "./emulator.c", "./fileio.c", "./biosbdos.c", + "+biosbdosdata", ], - vars={ - "+ldflags": ["-lz80ex", "-lz80ex_dasm", "-lreadline"] - } + vars={"+ldflags": ["-lz80ex", "-lz80ex_dasm", "-lreadline"]}, ) diff --git a/tools/lx68kemu/build.py b/tools/lx68kemu/build.py new file mode 100644 index 00000000..85db496d --- /dev/null +++ b/tools/lx68kemu/build.py @@ -0,0 +1,17 @@ +from build.c import cprogram +from third_party.musashi.build import musashilib + +musashilib( + name="musashi", + m68kconf="tools/lx68kemu/m68kconf.h", +) + +cprogram( + name="lx68kemu", + srcs=[ + "./sim.c", + "./sim.h", + "third_party/musashi/m68k.h", + ], + deps=["+musashi"], +) diff --git a/tools/obpemu/build.py b/tools/obpemu/build.py index 11581875..c9975306 100644 --- a/tools/obpemu/build.py +++ b/tools/obpemu/build.py @@ -1,12 +1,5 @@ from build.c import cprogram cprogram( - name="obpemu", - srcs=[ - "./emulator.c", - "./main.c" - ], - vars={ - "+ldflags": "-lreadline" - } + name="obpemu", srcs=["./emulator.c", "./main.c"], vars={"+ldflags": "-lreadline"} ) diff --git a/tools/tubeemu/build.py b/tools/tubeemu/build.py index ca7130f3..c81391ae 100644 --- a/tools/tubeemu/build.py +++ b/tools/tubeemu/build.py @@ -1,9 +1,3 @@ from build.c import cprogram -cprogram( - name="bbctube", - srcs=["./bbctube.c"], - deps=[ - "third_party/lib6502" - ] -) +cprogram(name="bbctube", srcs=["./bbctube.c"], deps=["third_party/lib6502"]) From d4b88df4a731f53a4aa15e24bffa1fd8771f0b0f Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:40 +0000 Subject: [PATCH 08/69] Replace proxies with replacement. --- build/ab2.py | 81 ++++++++++++++++-------------------- build/c.py | 23 +++++----- build/yacc.py | 4 +- third_party/musashi/build.py | 4 +- third_party/zmac/build.py | 4 +- tools/build.py | 4 +- 6 files changed, 53 insertions(+), 67 deletions(-) diff --git a/build/ab2.py b/build/ab2.py index 40b082c3..2a1717f1 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -16,7 +16,6 @@ defaultGlobals = {} targets = {} -currentInvocation = None unmaterialisedTargets = set() outputFp = None emitter = None @@ -104,12 +103,6 @@ class Invocation: def materialise(self): if self in unmaterialisedTargets: - # Create a new invocation frame. - - global currentInvocation - oldInvocation = currentInvocation - currentInvocation = self - # Perform type conversion to the declared rule parameter types. self.args = {} @@ -134,32 +127,19 @@ def materialise(self): else: self.vars[k] = ParameterList(v) - # Actually call the callback. If it returns another invocation, - # then replace the current one with it. - - proxy = self.callback(**self.args) - currentInvocation = oldInvocation - - if proxy: - if self.ins or self.outs: - raise ABException( - f"{self.name} is a proxy, but sets self.ins or self.outs" - ) - proxy.materialise() - for k in dir(proxy): - if not k.startswith("_"): - setattr(self, k, getattr(proxy, k)) - else: - if not self.outs: - raise ABException( - f"{self.name} is not a proxy, but didn't set self.outs" - ) + # Actually call the callback. + + self.callback(**self.args) + if not self.outs: + raise ABException( + f"{self.name} didn't set self.outs" + ) # Destack the variable and invocation frame. currentVars = oldVars - unmaterialisedTargets.remove(self) - currentInvocation = oldInvocation + if self in unmaterialisedTargets: + unmaterialisedTargets.remove(self) def __repr__(self): return "" % self.name @@ -364,21 +344,32 @@ def Rule(func): sig = inspect.signature(func) @functools.wraps(func) - def wrapper(*, name, **kwargs): + def wrapper(*, name=None, replaces=None, **kwargs): callername = inspect.stack()[1][0].f_globals["__name__"] cwd = dirname(callername.replace(".", "/")) - if ("+" in name) and not name.startswith("+"): - (cwd, target) = name.split("+", 1) - - i = Invocation() - if name.startswith("./"): - name = join(cwd, name) - elif "+" not in name: - name = cwd + "+" + name + if name: + if ("+" in name) and not name.startswith("+"): + (cwd, target) = name.split("+", 1) + + i = Invocation() + if name.startswith("./"): + name = join(cwd, name) + elif "+" not in name: + name = cwd + "+" + name + + i.name = name + i.localname = name.split("+")[-1] + + if name in targets: + raise ABException(f"target {i.name} has already been defined") + targets[name] = i + elif replaces: + i = replaces + name = i.name + else: + raise ABException("you must supply either name or replaces") - i.name = name - i.localname = name.split("+")[-1] i.cwd = cwd i.types = func.__annotations__ i.callback = func @@ -392,11 +383,9 @@ def wrapper(*, name, **kwargs): bound.apply_defaults() i.rawArgs = bound.arguments - if name in targets: - raise ABException(f"target {i.name} has already been defined") - - targets[name] = i unmaterialisedTargets.add(i) + if replaces: + i.materialise() return i defaultGlobals[func.__name__] = wrapper @@ -440,8 +429,8 @@ def normalrule( ): objdir = objdir or join("$(OBJ)", name) - return simplerule( - name=name + "/simplerule", + simplerule( + replaces=self, ins=ins, deps=deps, outs=[join(objdir, f) for f in outleaves], diff --git a/build/c.py b/build/c.py index 957a49e5..edaec26e 100644 --- a/build/c.py +++ b/build/c.py @@ -28,8 +28,8 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): outleaf = stripext(basename(name)) + suffix - return normalrule( - name=name + "/" + kind, + normalrule( + replaces=self, ins=srcs, deps=deps, outleaves=[outleaf], @@ -49,7 +49,7 @@ def cfile( commands=["$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}"], label="CC", ): - return cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", "cflags") + cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", "cflags") @Rule @@ -62,7 +62,7 @@ def cxxfile( commands=["$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}"], label="CXX", ): - return cfileimpl( + cfileimpl( self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags" ) @@ -93,19 +93,16 @@ def clibrary( if f.endswith(".h"): deps += [f] - r = normalrule( - name=name + "/clibrary", + normalrule( + replaces=self, ins=findsources(name, srcs, deps), outleaves=[basename(name) + ".a"], label=label, commands=commands, ) - r.materialise() dirs = set([dirname(f) for f in filenamesof(hdrs)]) - self.ins = [r] - self.outs = r.outs self.clibrary.hdrs = hdrs self.clibrary.dirs = dirs @@ -117,8 +114,8 @@ def programimpl(self, name, srcs, deps, commands, label, filerule, kind): if f.endswith(".h"): deps += [f] - return normalrule( - name=name + "/" + kind, + normalrule( + replaces=self, ins=findsources(name, srcs, deps), outleaves=[basename(name)], label=label, @@ -136,7 +133,7 @@ def cprogram( commands=["$(CC) -o {outs[0]} {ins} {vars.ldflags}"], label="CLINK", ): - return programimpl(self, name, srcs, deps, commands, label, cfile, "cprogram") + programimpl(self, name, srcs, deps, commands, label, cfile, "cprogram") @Rule @@ -148,4 +145,4 @@ def cxxprogram( commands=["$(CXX) -o {outs[0]} {ins} {vars.ldflags}"], label="CXXLINK", ): - return programimpl(self, name, srcs, deps, commands, label, cxxfile, "cxxprogram") + programimpl(self, name, srcs, deps, commands, label, cxxfile, "cxxprogram") diff --git a/build/yacc.py b/build/yacc.py index 12840473..d55230bc 100644 --- a/build/yacc.py +++ b/build/yacc.py @@ -3,8 +3,8 @@ @Rule def yacc(self, name, srcs: Targets() = []): - return normalrule( - name=name + "/yacc", + normalrule( + replaces=self, ins=srcs, outleaves=["y.tab.c", "y.tab.h"], commands=["bison -y -t -o {outs[0]} --defines={outs[1]} {ins}"], diff --git a/third_party/musashi/build.py b/third_party/musashi/build.py index 3ab430a1..09694c53 100644 --- a/third_party/musashi/build.py +++ b/third_party/musashi/build.py @@ -14,8 +14,8 @@ @Rule def musashilib(self, name, m68kconf: Target() = None): - return clibrary( - name=name + "/musashilib", + clibrary( + replaces=self, srcs=[ m68kconf, "third_party/musashi/m68kcpu.c", diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index 308f6f2e..50f13eae 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -22,8 +22,8 @@ def zmac(self, name, srcs: Targets() = []): filename, ext = splitext(filenameof(srcs)) archflag = "-z" if (ext == "z80") else "-8" - return normalrule( - name=name + "/zmac", + normalrule( + replaces=self, ins=["third_party/zmac", srcs[0]], outleaves=[self.localname + ".cim", self.localname + ".lst"], commands=["{ins[0]} -j -m " + archflag + " -o {outs[0]} -o {outs[1]} {ins[1]}"], diff --git a/tools/build.py b/tools/build.py index deeddfde..edd564db 100644 --- a/tools/build.py +++ b/tools/build.py @@ -14,8 +14,8 @@ @Rule def objectify(self, name, src: Target() = None, symbol=None): - return normalrule( - name=name + "/objectify", + normalrule( + replaces=self, ins=["tools/objectify", src], outleaves=[symbol + ".c"], commands=["lua {ins[0]} " + symbol + " < {ins[1]} > {outs}"], From f683d43a7e969d857554aeacf57546a9ba85f721 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:41 +0000 Subject: [PATCH 09/69] Build more things. --- build.py | 1 + build/ab2.py | 4 +--- build/c.py | 4 +--- third_party/rc2014emu/build.py | 3 +++ tools/fuzix6303emu/build.py | 12 ++++++++++++ 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 third_party/rc2014emu/build.py create mode 100644 tools/fuzix6303emu/build.py diff --git a/build.py b/build.py index 0a78e3c8..f13f21e6 100644 --- a/build.py +++ b/build.py @@ -14,6 +14,7 @@ "bin/cpmemu": "tools/cpmemu", "bin/ataritosemu": "tools/ataritosemu", "bin/lx68kemu": "tools/lx68kemu", + "bin/fuzix6303emu": "tools/fuzix6303emu", }, deps=["third_party/djlink+djlink-programs"], ) diff --git a/build/ab2.py b/build/ab2.py index 2a1717f1..e8f5828c 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -131,9 +131,7 @@ def materialise(self): self.callback(**self.args) if not self.outs: - raise ABException( - f"{self.name} didn't set self.outs" - ) + raise ABException(f"{self.name} didn't set self.outs") # Destack the variable and invocation frame. diff --git a/build/c.py b/build/c.py index edaec26e..066e3c90 100644 --- a/build/c.py +++ b/build/c.py @@ -62,9 +62,7 @@ def cxxfile( commands=["$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}"], label="CXX", ): - cfileimpl( - self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags" - ) + cfileimpl(self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags") def findsources(name, srcs, deps): diff --git a/third_party/rc2014emu/build.py b/third_party/rc2014emu/build.py new file mode 100644 index 00000000..e1bae79d --- /dev/null +++ b/third_party/rc2014emu/build.py @@ -0,0 +1,3 @@ +from build.c import clibrary + +clibrary(name="rc2014emu", srcs=["./6800.c"], hdrs=["./6800.h"]) diff --git a/tools/fuzix6303emu/build.py b/tools/fuzix6303emu/build.py new file mode 100644 index 00000000..ec38bc68 --- /dev/null +++ b/tools/fuzix6303emu/build.py @@ -0,0 +1,12 @@ +from build.c import cprogram + +cprogram( + name="fuzix6303emu", + srcs=[ + "./main.c", + "./disasm.c", + "./globals.h", + ], + deps=["third_party/rc2014emu"], + vars={"+ldflags": ["-lreadline"]}, +) From 7f86e0a5ff09dbeddce9c17ecbeed53866c53eb8 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:41 +0000 Subject: [PATCH 10/69] Start thinking about toolchains. --- bootstrap/build.py | 6 ++++++ build.py | 22 +++++++++++++++++++++- src/build.py | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 bootstrap/build.py create mode 100644 src/build.py diff --git a/bootstrap/build.py b/bootstrap/build.py new file mode 100644 index 00000000..7951ef97 --- /dev/null +++ b/bootstrap/build.py @@ -0,0 +1,6 @@ +from src.build import cgen + +cgen(name="cowfe", srcs=["./cowfe-cgen.bootstrap.c"]) +cgen(name="cowbe", srcs=["./cowbe-cgen.bootstrap.c"]) +cgen(name="cowlink", srcs=["./cowlink-cgen.bootstrap.c"]) +cgen(name="cowwrap", srcs=["./cowwrap.bootstrap.c"]) diff --git a/build.py b/build.py index f13f21e6..8c9b9279 100644 --- a/build.py +++ b/build.py @@ -1,5 +1,25 @@ from build.ab2 import Rule, installable from os.path import * +from src.build import toolchain + +toolchains = [ + toolchain( + name="ncgen", + id="ncgen", + cowfe="bootstrap+cowfe", + cowbe="bootstrap+cowbe", + cowlink="bootstrap+cowlink", + cowwrap="bootstrap+cowwrap", + ), + toolchain( + name="nncgen", + id="nncgen", + cowfe="bootstrap+cowfe", + cowbe="bootstrap+cowbe", + cowlink="bootstrap+cowlink", + cowwrap="bootstrap+cowwrap", + ), +] installable( name="all", @@ -16,5 +36,5 @@ "bin/lx68kemu": "tools/lx68kemu", "bin/fuzix6303emu": "tools/fuzix6303emu", }, - deps=["third_party/djlink+djlink-programs"], + deps=["third_party/djlink+djlink-programs"] + toolchains, ) diff --git a/src/build.py b/src/build.py new file mode 100644 index 00000000..af9504cb --- /dev/null +++ b/src/build.py @@ -0,0 +1,33 @@ +from build.ab2 import Rule, Target, Targets, installable +from build.c import cprogram + + +@Rule +def cgen(self, name, srcs: Targets() = []): + cprogram(replaces=self, srcs=srcs + ["rt/cgen/cowgol.h"]) + + +@Rule +def toolchain( + self, + name, + id, + cowfe: Target() = None, + cowbe: Target() = None, + cowlink: Target() = None, + cowwrap: Target() = None, +): + self.toolchain.cowfe = cowfe + self.toolchain.cowbe = cowbe + self.toolchain.cowlink = cowlink + self.toolchain.cowwrap = cowwrap + + installable( + replaces=self, + items={ + "bin/cowfe-" + id: cowfe, + "bin/cowbe-" + id: cowbe, + "bin/cowlink-" + id: cowlink, + "bin/cowwrap-" + id: cowwrap, + }, + ) From fa0a26548c4346a90e78d1d51a21d5bf6b224083 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:41 +0000 Subject: [PATCH 11/69] Finally update to emit .coh files. --- third_party/lemon/lemon-cowgol.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/third_party/lemon/lemon-cowgol.c b/third_party/lemon/lemon-cowgol.c index 760d7031..4c2f3242 100644 --- a/third_party/lemon/lemon-cowgol.c +++ b/third_party/lemon/lemon-cowgol.c @@ -4104,7 +4104,7 @@ void ReportTable( in = tplt_open(lemp); if( in==0 ) return; - out = file_open(lemp,".c","wb"); + out = file_open(lemp,".coh","wb"); if( out==0 ){ fclose(in); return; @@ -4115,7 +4115,7 @@ void ReportTable( /* Generate the include code, if any */ tplt_print(out,lemp,lemp->include,&lineno); if( mhflag ){ - char *incName = file_makename(lemp, ".h"); + char *incName = file_makename(lemp, ".tokens.coh"); fprintf(out,"#include \"%s\"\n", incName); lineno++; free(incName); } @@ -4625,22 +4625,7 @@ void ReportHeader(struct lemon *lemp) if( lemp->tokenprefix ) prefix = lemp->tokenprefix; else prefix = ""; - in = file_open(lemp,".h","rb"); - if( in ){ - int nextChar; - for(i=1; interminal && fgets(line,LINESIZE,in); i++){ - lemon_sprintf(pattern,"const %s%s := %d;\n", - prefix,lemp->symbols[i]->name,i); - if( strcmp(line,pattern) ) break; - } - nextChar = fgetc(in); - fclose(in); - if( i==lemp->nterminal && nextChar==EOF ){ - /* No change in the file. Don't rewrite it. */ - return; - } - } - out = file_open(lemp,".h","wb"); + out = file_open(lemp,".tokens.coh","wb"); if( out ){ for(i=1; interminal; i++){ fprintf(out,"const %s%s := %d;\n",prefix,lemp->symbols[i]->name,i); From e4b28acf9828a6a0a7a6ef453b25afcb2a684baa Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:42 +0000 Subject: [PATCH 12/69] Most of cowfe and cowbe build. --- build.py | 22 +----- build/ab2.py | 6 +- build/gpp.py | 18 +++++ build/yacc.py | 11 +++ src/build.py | 151 +++++++++++++++++++++++++++++++++---- src/cowbe/build.py | 55 ++++++++++++++ src/cowfe/build.py | 51 +++++++++++++ third_party/lemon/build.py | 24 +++++- tools/newgen/build.py | 35 +++++++++ 9 files changed, 335 insertions(+), 38 deletions(-) create mode 100644 build/gpp.py create mode 100644 src/cowbe/build.py create mode 100644 src/cowfe/build.py create mode 100644 tools/newgen/build.py diff --git a/build.py b/build.py index 8c9b9279..2d9fe478 100644 --- a/build.py +++ b/build.py @@ -1,25 +1,5 @@ from build.ab2 import Rule, installable from os.path import * -from src.build import toolchain - -toolchains = [ - toolchain( - name="ncgen", - id="ncgen", - cowfe="bootstrap+cowfe", - cowbe="bootstrap+cowbe", - cowlink="bootstrap+cowlink", - cowwrap="bootstrap+cowwrap", - ), - toolchain( - name="nncgen", - id="nncgen", - cowfe="bootstrap+cowfe", - cowbe="bootstrap+cowbe", - cowlink="bootstrap+cowlink", - cowwrap="bootstrap+cowwrap", - ), -] installable( name="all", @@ -36,5 +16,5 @@ "bin/lx68kemu": "tools/lx68kemu", "bin/fuzix6303emu": "tools/fuzix6303emu", }, - deps=["third_party/djlink+djlink-programs"] + toolchains, + deps=["third_party/djlink+djlink-programs", "src+toolchains"], ) diff --git a/build/ab2.py b/build/ab2.py index e8f5828c..c321e704 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -172,6 +172,8 @@ def convert(self, value, invocation): class Target(Type): def convert(self, value, invocation): + if not value: + return None return targetof(value, cwd=invocation.cwd) @@ -300,6 +302,8 @@ def __getitem__(self, key): class MakeEmitter: def begin(self): emit("hide = @") + emit(".DELETE_ON_ERROR:") + emit(".SECONDARY:") def end(self): pass @@ -445,7 +449,7 @@ def installable(self, name=None, items: TargetsMap() = {}, deps: Targets() = []) emitter.exec(f"echo EXPORT {self.name}") self.ins = items.values() - self.outs = [] + self.outs = filenamesof(deps) for dest, src in items.items(): destf = filenameof(dest) dir = dirname(destf) diff --git a/build/gpp.py b/build/gpp.py new file mode 100644 index 00000000..3bc57ee3 --- /dev/null +++ b/build/gpp.py @@ -0,0 +1,18 @@ +from build.ab2 import Rule, normalrule, Targets, filenamesof +from os.path import * + + +@Rule +def gpp(self, name, srcs: Targets() = []): + hdrs = set(["-I" + dirname(f) for f in filenamesof(srcs)]) + + normalrule( + replaces=self, + ins=srcs, + outleaves=[self.localname + ".i"], + commands=[ + "gpp --nostdinc -U '' '' '(' ',' ')' '(' ')' '$$' '' -M '$$' '\\n' ' ' ' ' '\\n' '(' ')' " + + (" ".join(hdrs)) + + " -o {outs} {ins[0]}" + ], + ) diff --git a/build/yacc.py b/build/yacc.py index d55230bc..5a25c710 100644 --- a/build/yacc.py +++ b/build/yacc.py @@ -10,3 +10,14 @@ def yacc(self, name, srcs: Targets() = []): commands=["bison -y -t -o {outs[0]} --defines={outs[1]} {ins}"], label="YACC", ) + + +@Rule +def flex(self, name, srcs: Targets() = []): + normalrule( + replaces=self, + ins=srcs, + outleaves=["lexer.c"], + commands=["flex -8 -Cem -s -t {ins[0]} > {outs[0]}"], + label="FLEX", + ) diff --git a/src/build.py b/src/build.py index af9504cb..136493de 100644 --- a/src/build.py +++ b/src/build.py @@ -1,5 +1,6 @@ -from build.ab2 import Rule, Target, Targets, installable +from build.ab2 import Rule, Target, Targets, installable, normalrule, filenamesof from build.c import cprogram +from os.path import * @Rule @@ -11,23 +12,143 @@ def cgen(self, name, srcs: Targets() = []): def toolchain( self, name, - id, cowfe: Target() = None, cowbe: Target() = None, cowlink: Target() = None, cowwrap: Target() = None, + runtime=None, + asmext=None, + assembler=None, ): - self.toolchain.cowfe = cowfe - self.toolchain.cowbe = cowbe - self.toolchain.cowlink = cowlink - self.toolchain.cowwrap = cowwrap - - installable( - replaces=self, - items={ - "bin/cowfe-" + id: cowfe, - "bin/cowbe-" + id: cowbe, - "bin/cowlink-" + id: cowlink, - "bin/cowwrap-" + id: cowwrap, - }, + id = self.localname + + for k, v in self.args.items(): + setattr(self, k, v) + + items = {} + if cowfe: + items["bin/cowfe-" + id] = cowfe + if cowbe: + items["bin/cowbe-" + id] = cowbe + if cowlink: + items["bin/cowlink-" + id] = cowlink + if cowwrap: + items["bin/cowwrap-" + id] = cowwrap + + installable(replaces=self, items=items) + + +@Rule +def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): + srcs += [ + "rt/common-file.coh", + "rt/common.coh", + "rt/fileio.coh", + "rt/malloc.coh", + "rt/strings.coh", + toolchain.runtime + "/cowgol.coh", + toolchain.runtime + "/file.coh", + toolchain.runtime + "/argv.coh", + ] + + cow = [f for f in filenamesof(srcs) if f.endswith(".cow")] + dirs = set([dirname(f) for f in filenamesof(srcs)]) + flags = [f"-I{dir}/" for dir in dirs] + + cob = normalrule( + name=name + "/cowfe", + ins=[toolchain.cowfe, cow] + srcs, + outleaves=[self.localname + ".cob"], + commands=[ + "scripts/quiet {ins[0]} " + (" ".join(flags)) + " {ins[1]} {outs[0]}" + ], + label="COWFE-" + toolchain.localname.upper(), ) + + coo = normalrule( + name=name + "/cowbe", + ins=[toolchain.cowbe, cob], + outleaves=[self.localname + ".coo"], + commands=["scripts/quiet {ins[0]} {ins[1]} {outs}"], + label="COWBE-" + toolchain.localname.upper(), + ) + + asm = normalrule( + name=name + "/cowlink", + ins=[toolchain.cowlink, coo], + outleaves=[self.localname + toolchain.asmext], + commands=["scripts/quiet {ins[0]} -o {outs} {' '.join(ins[1:])}"], + label="COWLINK-" + toolchain.localname.upper(), + ) + + toolchain.assembler(replaces=self, srcs=[asm]) + + +TOOLCHAINS = [ + toolchain( + name="ncgen", + cowfe="bootstrap+cowfe", + cowbe="bootstrap+cowbe", + cowlink="bootstrap+cowlink", + cowwrap="bootstrap+cowwrap", + runtime="rt/cgen", + asmext=".c", + assembler=cgen, + ), + toolchain( + name="nncgen", + cowfe="src/cowfe+cowfe-for-cgen-with-ncgen", + cowbe="src/cowbe+cowbe-for-cgen-with-ncgen", + cowlink="bootstrap+cowlink", + cowwrap="bootstrap+cowwrap", + runtime="rt/cgen", + asmext=".c", + assembler=cgen, + ), + #toolchain( + # name="ncpm", cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", runtime="rt/cpm", + # asmext=".asm", + #), +] + +installable(name="toolchains", deps=TOOLCHAINS) + +normalrule( + name="midcodesfecoh", + ins=["scripts/mkmidcodescoh.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + outleaves=["midcodesfe.coh"], + commands=["lua {ins[0]} -- {ins[2]} {outs[0]} fe"], + label="MKMIDCODESFE", +) + +normalrule( + name="midcodesbecoh", + ins=["scripts/mkmidcodescoh.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + outleaves=["midcodesbe.coh"], + commands=["lua {ins[0]} -- {ins[2]} {outs[0]} be"], + label="MKMIDCODESBE", +) + +normalrule( + name="coboutcoh", + ins=["scripts/mkcobout.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + outleaves=["cobout.coh"], + commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], + label="MKCOBOUT", +) + +normalrule( + name="iburgcodes", + ins=["scripts/mkiburgcodes.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + outleaves=["iburgcodes-coh.h"], + commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], + label="MKIBURGCODES", +) + +normalrule( + name="cobincoh", + ins=["scripts/mkcobin.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + outleaves=["cobin.coh"], + commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], + label="MKCOBIN", +) diff --git a/src/cowbe/build.py b/src/cowbe/build.py new file mode 100644 index 00000000..b77abf20 --- /dev/null +++ b/src/cowbe/build.py @@ -0,0 +1,55 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol +from tools.newgen.build import newgencowgol + +ARCHS = [ + "6303", + "6502", + "65c02", + "65c02-tiny", + "68000", + "80386", + "8080", + "8086", + "basic", + "cgen", + "pdp11", + "powerpc", + "thumb2", + "z80", +] + +extras = { + "65c02": ["src/cowbe/arch6502.cow.ng"], + "65c02-tiny": ["src/cowbe/arch6502.cow.ng"], +} + +for arch in ARCHS: + newgencowgol( + name="gen-" + arch, + srcs=["src/cowbe/arch" + arch + ".cow.ng"] + extras.get(arch, []), + ) + +for toolchain in TOOLCHAINS: + for arch in ARCHS: + cowgol( + name="cowbe-for-" + arch + "-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "+gen-" + arch, + "include/coodecls.coh", + "src+midcodesbecoh", + "src+cobincoh", + "./main.cow", + "./allocator.coh", + "./codegen.coh", + "./emitter.coh", + "./inputter.coh", + "./midcodec.coh", + "./processor.coh", + "./regcache.coh", + "./treewalker.coh", + "./types.coh", + "./utils.coh", + ], + ) diff --git a/src/cowfe/build.py b/src/cowfe/build.py new file mode 100644 index 00000000..4c6d0df1 --- /dev/null +++ b/src/cowfe/build.py @@ -0,0 +1,51 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol +from third_party.lemon.build import lemoncowgol + +ARCHS = [ + "6502", + "80386", + "basic", + "cgen", + "pdp11", + "16bit", + "32bita2", + "32bita", +] + +lemoncowgol(name="parser", src="src/cowfe/parser.y") + +for arch in ARCHS: + normalrule( + name="arch-" + arch, + ins=["./arch" + arch + ".coh"], + outleaves=["arch.coh"], + commands=["cp {ins} {outs}"], + label="COPY", + ) + +for toolchain in TOOLCHAINS: + for arch in ARCHS: + cowgol( + name="cowfe-for-" + arch + "-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "+arch-" + arch, + "+parser", + "./allocator.coh", + "./codegen.coh", + "./emitter.coh", + "./expressions.coh", + "./lexer.coh", + "./main.cow", + "./midcodec.coh", + "./namespace.coh", + "./regcache.coh", + "./symbols.coh", + "./treewalker.coh", + "./types.coh", + "include/coodecls.coh", + "src+coboutcoh", + "src+midcodesfecoh", + ], + ) diff --git a/third_party/lemon/build.py b/third_party/lemon/build.py index 46604695..f5c0e5eb 100644 --- a/third_party/lemon/build.py +++ b/third_party/lemon/build.py @@ -1,4 +1,4 @@ -from build.ab2 import Rule +from build.ab2 import Rule, Target, normalrule from build.c import cprogram cprogram( @@ -10,3 +10,25 @@ name="lemon-cowgol", srcs=["./lemon-cowgol.c"], ) + + +@Rule +def lemon(self, name, src: Target() = None): + normalrule( + replaces=self, + ins=["+lemon", "./lempar.c", src], + outleaves=[self.localname + ".c", self.localname + ".h"], + commands=["{ins[0]} -T{ins[1]} -d{dirname(outs[0])} {ins[2]}"], + label="LEMON", + ) + + +@Rule +def lemoncowgol(self, name, src: Target() = None): + normalrule( + replaces=self, + ins=["+lemon-cowgol", "src/cowfe/lempar.coh", src], + outleaves=[self.localname + ".coh", self.localname + ".tokens.coh"], + commands=["{ins[0]} -T{ins[1]} -d{dirname(outs[0])} {ins[2]}"], + label="LEMON-COWGOL", + ) diff --git a/tools/newgen/build.py b/tools/newgen/build.py new file mode 100644 index 00000000..481f38e2 --- /dev/null +++ b/tools/newgen/build.py @@ -0,0 +1,35 @@ +from build.ab2 import Rule, Targets, normalrule +from build.c import cprogram +from build.yacc import flex +from build.gpp import gpp +from third_party.lemon.build import lemon + +lemon(name="parser", src="./parser.y") + +flex(name="lexer", srcs=["./lexer.l"]) + +cprogram( + name="newgen", + srcs=[ + "./main.c", + "./utils.c", + "./globals.h", + "+parser", + "+lexer", + "src+iburgcodes", + ], + vars={"+cflags": ["-DCOWGOL"], "+ldflags": ["-lfl"]}, +) + + +@Rule +def newgencowgol(self, name, srcs: Targets() = []): + preprocessed = gpp(name=name + "/preprocessed", srcs=srcs) + + normalrule( + replaces=self, + ins=["+newgen", preprocessed], + outleaves=["inssel.coh", "inssel.decl.coh"], + commands=["{ins[0]} {ins[1]} {outs[0]} {outs[1]}"], + label="NEWGEN", + ) From b38092e10c901e73503978e3e812d77e801c681d Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:42 +0000 Subject: [PATCH 13/69] Rename installable -> export. --- build.py | 4 ++-- build/ab2.py | 4 ++-- src/build.py | 6 +++--- third_party/djlink/build.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index 2d9fe478..06e2c330 100644 --- a/build.py +++ b/build.py @@ -1,7 +1,7 @@ -from build.ab2 import Rule, installable +from build.ab2 import Rule, export from os.path import * -installable( +export( name="all", items={ "bin/bbctube": "tools/tubeemu+bbctube", diff --git a/build/ab2.py b/build/ab2.py index c321e704..40925cdc 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -442,7 +442,7 @@ def normalrule( @Rule -def installable(self, name=None, items: TargetsMap() = {}, deps: Targets() = []): +def export(self, name=None, items: TargetsMap() = {}, deps: Targets() = []): emitter.rule( self.name, filenamesof(items.values(), deps), filenamesof(items.keys()) ) @@ -459,7 +459,7 @@ def installable(self, name=None, items: TargetsMap() = {}, deps: Targets() = []) srcs = filenamesof(src) if len(srcs) != 1: raise ABException( - "a dependency of an installable must have exactly one output file" + "a dependency of an export must have exactly one output file" ) emitter.exec("cp %s %s" % (srcs[0], destf)) diff --git a/src/build.py b/src/build.py index 136493de..3c3fbfee 100644 --- a/src/build.py +++ b/src/build.py @@ -1,4 +1,4 @@ -from build.ab2 import Rule, Target, Targets, installable, normalrule, filenamesof +from build.ab2 import Rule, Target, Targets, export, normalrule, filenamesof from build.c import cprogram from os.path import * @@ -35,7 +35,7 @@ def toolchain( if cowwrap: items["bin/cowwrap-" + id] = cowwrap - installable(replaces=self, items=items) + export(replaces=self, items=items) @Rule @@ -111,7 +111,7 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): #), ] -installable(name="toolchains", deps=TOOLCHAINS) +export(name="toolchains", deps=TOOLCHAINS) normalrule( name="midcodesfecoh", diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py index 95885909..f42df92a 100644 --- a/third_party/djlink/build.py +++ b/third_party/djlink/build.py @@ -1,5 +1,5 @@ from build.c import cxxprogram -from build.ab2 import installable +from build.ab2 import export cxxprogram( name="objdump", @@ -41,7 +41,7 @@ ], ) -installable( +export( name="djlink-programs", items={ "bin/objdump": "+objdump", From 5aca409e1ebff4cc8ad682c49e6ddc0a44cdc144 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:42 +0000 Subject: [PATCH 14/69] Build cowlink. --- src/build.py | 2 +- src/cowlink/build.py | 47 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/cowlink/build.py diff --git a/src/build.py b/src/build.py index 3c3fbfee..6465957e 100644 --- a/src/build.py +++ b/src/build.py @@ -99,7 +99,7 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): name="nncgen", cowfe="src/cowfe+cowfe-for-cgen-with-ncgen", cowbe="src/cowbe+cowbe-for-cgen-with-ncgen", - cowlink="bootstrap+cowlink", + cowlink="src/cowlink+cowlink-for-cgen-with-ncgen", cowwrap="bootstrap+cowwrap", runtime="rt/cgen", asmext=".c", diff --git a/src/cowlink/build.py b/src/cowlink/build.py new file mode 100644 index 00000000..301c33cb --- /dev/null +++ b/src/cowlink/build.py @@ -0,0 +1,47 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol + +ARCHS = [ + "8080", + "ataritos", + "basic", + "bbct", + "bbctn", + "cgen", + "fuzix6303", + "lx386", + "lx68k", + "lxppc", + "lxthumb2", + "msdos", + "rt11", + "v7unix", +] + +for arch in ARCHS: + normalrule( + name="arch-" + arch, + ins=["./arch" + arch + ".coh"], + outleaves=["archlink.coh"], + commands=["cp {ins} {outs}"], + label="COPY", + ) + +for toolchain in TOOLCHAINS: + for arch in ARCHS: + cowgol( + name="cowlink-for-" + arch + "-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "include/coodecls.coh", + "+arch-"+arch, + "./main.cow", + "./asmwrite.coh", + "./cooread.coh", + "./emitter.coh", + "./graph.coh", + "./streams.coh", + "./types.coh", + "./utils.coh", + ], + ) From ba1aa0657c23e3cbf6fb25b83a2fa13e6536c438 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:43 +0000 Subject: [PATCH 15/69] Build cowwrap. --- src/build.py | 6 +++--- src/cowlink/build.py | 48 ++++++++++++++++++++++---------------------- src/cowwrap/build.py | 13 ++++++++++++ 3 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 src/cowwrap/build.py diff --git a/src/build.py b/src/build.py index 6465957e..a1c126cb 100644 --- a/src/build.py +++ b/src/build.py @@ -100,15 +100,15 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): cowfe="src/cowfe+cowfe-for-cgen-with-ncgen", cowbe="src/cowbe+cowbe-for-cgen-with-ncgen", cowlink="src/cowlink+cowlink-for-cgen-with-ncgen", - cowwrap="bootstrap+cowwrap", + cowwrap="src/cowwrap+cowwrap-with-ncgen", runtime="rt/cgen", asmext=".c", assembler=cgen, ), - #toolchain( + # toolchain( # name="ncpm", cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", runtime="rt/cpm", # asmext=".asm", - #), + # ), ] export(name="toolchains", deps=TOOLCHAINS) diff --git a/src/cowlink/build.py b/src/cowlink/build.py index 301c33cb..940f5811 100644 --- a/src/cowlink/build.py +++ b/src/cowlink/build.py @@ -2,20 +2,20 @@ from src.build import TOOLCHAINS, cowgol ARCHS = [ - "8080", - "ataritos", - "basic", - "bbct", - "bbctn", - "cgen", - "fuzix6303", - "lx386", - "lx68k", - "lxppc", - "lxthumb2", - "msdos", - "rt11", - "v7unix", + "8080", + "ataritos", + "basic", + "bbct", + "bbctn", + "cgen", + "fuzix6303", + "lx386", + "lx68k", + "lxppc", + "lxthumb2", + "msdos", + "rt11", + "v7unix", ] for arch in ARCHS: @@ -33,15 +33,15 @@ name="cowlink-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, srcs=[ - "include/coodecls.coh", - "+arch-"+arch, - "./main.cow", - "./asmwrite.coh", - "./cooread.coh", - "./emitter.coh", - "./graph.coh", - "./streams.coh", - "./types.coh", - "./utils.coh", + "include/coodecls.coh", + "+arch-" + arch, + "./main.cow", + "./asmwrite.coh", + "./cooread.coh", + "./emitter.coh", + "./graph.coh", + "./streams.coh", + "./types.coh", + "./utils.coh", ], ) diff --git a/src/cowwrap/build.py b/src/cowwrap/build.py new file mode 100644 index 00000000..a55e1df4 --- /dev/null +++ b/src/cowwrap/build.py @@ -0,0 +1,13 @@ +from src.build import TOOLCHAINS, cowgol + +for toolchain in TOOLCHAINS: + cowgol( + name="cowwrap-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "include/coodecls.coh", + "./main.cow", + "./emitter.coh", + "./reader.coh", + ], + ) From a10f9c62fc965e7341197434b0b0bcc79849c842 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:43 +0000 Subject: [PATCH 16/69] Finally build our first programs! --- build.py | 2 +- build/ab2.py | 8 ++- build/c.py | 12 +++- examples/build.py | 27 +++++++ rt/cgen/build.py | 3 + rt/cpm/build.py | 3 + rt/cpmz/build.py | 3 + rt/lxthumb2/build.py | 3 + src/build.py | 146 ++++++++++++++++++++++++++++++++++---- third_party/zmac/build.py | 10 ++- tools/obpemu/build.py | 4 +- 11 files changed, 197 insertions(+), 24 deletions(-) create mode 100644 examples/build.py create mode 100644 rt/cgen/build.py create mode 100644 rt/cpm/build.py create mode 100644 rt/cpmz/build.py create mode 100644 rt/lxthumb2/build.py diff --git a/build.py b/build.py index 06e2c330..cca144aa 100644 --- a/build.py +++ b/build.py @@ -16,5 +16,5 @@ "bin/lx68kemu": "tools/lx68kemu", "bin/fuzix6303emu": "tools/fuzix6303emu", }, - deps=["third_party/djlink+djlink-programs", "src+toolchains"], + deps=["third_party/djlink+djlink-programs", "src+toolchains", "examples"], ) diff --git a/build/ab2.py b/build/ab2.py index 40925cdc..12863875 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -32,7 +32,9 @@ def new_import(name, *args, **kwargs): sys.stderr.write(f"loading {path}\n") loader = importlib.machinery.SourceFileLoader(name, path) - spec = importlib.util.spec_from_loader(name, loader, origin="built-in") + spec = importlib.util.spec_from_loader( + name, loader, origin="built-in" + ) module = importlib.util.module_from_spec(spec) sys.modules[name] = module spec.loader.exec_module(module) @@ -480,7 +482,9 @@ def load(filename): def main(): parser = argparse.ArgumentParser() - parser.add_argument("-m", "--mode", choices=["make", "ninja"], default="make") + parser.add_argument( + "-m", "--mode", choices=["make", "ninja"], default="make" + ) parser.add_argument("-o", "--output") parser.add_argument("files", nargs="+") args = parser.parse_args() diff --git a/build/c.py b/build/c.py index 066e3c90..d04a4f13 100644 --- a/build/c.py +++ b/build/c.py @@ -49,7 +49,9 @@ def cfile( commands=["$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}"], label="CC", ): - cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", "cflags") + cfileimpl( + self, name, srcs, deps, suffix, commands, label, "cfile", "cflags" + ) @Rule @@ -62,7 +64,9 @@ def cxxfile( commands=["$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}"], label="CXX", ): - cfileimpl(self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags") + cfileimpl( + self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags" + ) def findsources(name, srcs, deps): @@ -71,7 +75,9 @@ def findsources(name, srcs, deps): if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp"): ins += [ cfile( - name=name + "/" + basename(filenamesof(f)[0]), srcs=[f], deps=deps + name=name + "/" + basename(filenamesof(f)[0]), + srcs=[f], + deps=deps, ) ] return ins diff --git a/examples/build.py b/examples/build.py new file mode 100644 index 00000000..14d648cc --- /dev/null +++ b/examples/build.py @@ -0,0 +1,27 @@ +from src.build import TOOLCHAINS, cowgol +from build.ab2 import export + +PROGRAMS = [ + "argv", + "cowcalc", + "file", + "filetester", + "helloworld", + "icando", + "mandel", +] + +items = {} +for toolchain in TOOLCHAINS: + for prog in PROGRAMS: + t = cowgol( + name=prog + "-for-" + toolchain.localname, + srcs="./" + prog + ".cow", + toolchain=toolchain, + ) + + items[ + f"bin/examples/{prog}-for-{toolchain.localname}{toolchain.binext}" + ] = t + +export(name="examples", items=items) diff --git a/rt/cgen/build.py b/rt/cgen/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/cgen/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/rt/cpm/build.py b/rt/cpm/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/cpm/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/rt/cpmz/build.py b/rt/cpmz/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/cpmz/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/rt/lxthumb2/build.py b/rt/lxthumb2/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/lxthumb2/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/src/build.py b/src/build.py index a1c126cb..9fd65064 100644 --- a/src/build.py +++ b/src/build.py @@ -1,6 +1,8 @@ from build.ab2 import Rule, Target, Targets, export, normalrule, filenamesof from build.c import cprogram from os.path import * +from third_party.zmac.build import zmac +from types import SimpleNamespace @Rule @@ -8,6 +10,24 @@ def cgen(self, name, srcs: Targets() = []): cprogram(replaces=self, srcs=srcs + ["rt/cgen/cowgol.h"]) +def buildgasimpl(self, prefix): + normalrule( + replaces=self, + ins=self.args["srcs"], + outleaves=[self.localname + ".elf"], + commands=[ + prefix + "-as -g {ins} -o {outs[0]}.s", + prefix + "-ld -g {outs[0]}.s -o {outs[0]}", + ], + label="ASM-" + prefix.upper(), + ) + + +@Rule +def buildgasarm(self, name, srcs: Targets() = None): + buildgasimpl(self, "arm-linux-gnueabihf") + + @Rule def toolchain( self, @@ -18,6 +38,7 @@ def toolchain( cowwrap: Target() = None, runtime=None, asmext=None, + binext=None, assembler=None, ): id = self.localname @@ -39,7 +60,13 @@ def toolchain( @Rule -def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): +def cowlib( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + toolchain: Target() = None, +): srcs += [ "rt/common-file.coh", "rt/common.coh", @@ -60,22 +87,32 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): ins=[toolchain.cowfe, cow] + srcs, outleaves=[self.localname + ".cob"], commands=[ - "scripts/quiet {ins[0]} " + (" ".join(flags)) + " {ins[1]} {outs[0]}" + "scripts/quiet {ins[0]} " + + (" ".join(flags)) + + " {ins[1]} {outs[0]}" ], label="COWFE-" + toolchain.localname.upper(), ) - coo = normalrule( - name=name + "/cowbe", + normalrule( + replaces=self, ins=[toolchain.cowbe, cob], outleaves=[self.localname + ".coo"], commands=["scripts/quiet {ins[0]} {ins[1]} {outs}"], label="COWBE-" + toolchain.localname.upper(), ) + +@Rule +def cowlink(self, name, deps: Targets() = [], toolchain: Target() = None): + coos = [] + for d in deps: + if hasattr(d, "cowlib"): + coos += filenamesof(d) + asm = normalrule( name=name + "/cowlink", - ins=[toolchain.cowlink, coo], + ins=[toolchain.cowlink] + [coos], outleaves=[self.localname + toolchain.asmext], commands=["scripts/quiet {ins[0]} -o {outs} {' '.join(ins[1:])}"], label="COWLINK-" + toolchain.localname.upper(), @@ -84,6 +121,36 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): toolchain.assembler(replaces=self, srcs=[asm]) +@Rule +def cowgol( + self, + name, + srcs: Targets() = [], + deps: Targets() = [], + toolchain: Target() = None, +): + coo = cowlib(name=name + "/main", srcs=srcs, toolchain=toolchain) + + cowlink( + replaces=self, + deps=[coo, toolchain.runtime + "+cowgolcoo"] + deps, + toolchain=toolchain, + ) + + +@Rule +def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): + self.cowlib = SimpleNamespace() + normalrule( + replaces=self, + ins=["bootstrap+cowwrap", src], + outleaves=["cowgol.coo"], + label="COWWRAP-"+toolchain.localname.upper(), + commands=[ + "{ins[0]} {ins[1]} {outs}" + ]) + + TOOLCHAINS = [ toolchain( name="ncgen", @@ -93,6 +160,7 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): cowwrap="bootstrap+cowwrap", runtime="rt/cgen", asmext=".c", + binext=".exe", assembler=cgen, ), toolchain( @@ -103,19 +171,53 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): cowwrap="src/cowwrap+cowwrap-with-ncgen", runtime="rt/cgen", asmext=".c", + binext=".exe", assembler=cgen, ), - # toolchain( - # name="ncpm", cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", runtime="rt/cpm", - # asmext=".asm", - # ), + toolchain( + name="ncpm", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-8080-with-ncgen", + cowlink="src/cowlink+cowlink-for-8080-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/cpm", + asmext=".asm", + binext=".com", + assembler=zmac, + ), + toolchain( + name="ncpmz", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-z80-with-ncgen", + cowlink="src/cowlink+cowlink-for-8080-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/cpmz", + asmext=".z80", + binext=".com", + assembler=zmac, + ), + toolchain( + name="lxthumb2", + cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", + cowbe="src/cowbe+cowbe-for-thumb2-with-ncgen", + cowlink="src/cowlink+cowlink-for-lxthumb2-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lxthumb2", + asmext=".s", + binext=".exe", + assembler=buildgasarm, + ), ] export(name="toolchains", deps=TOOLCHAINS) normalrule( name="midcodesfecoh", - ins=["scripts/mkmidcodescoh.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + ins=[ + "scripts/mkmidcodescoh.lua", + "scripts/libcowgol.lua", + "src/midcodes.coh.tab", + ], outleaves=["midcodesfe.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]} fe"], label="MKMIDCODESFE", @@ -123,7 +225,11 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): normalrule( name="midcodesbecoh", - ins=["scripts/mkmidcodescoh.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + ins=[ + "scripts/mkmidcodescoh.lua", + "scripts/libcowgol.lua", + "src/midcodes.coh.tab", + ], outleaves=["midcodesbe.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]} be"], label="MKMIDCODESBE", @@ -131,7 +237,11 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): normalrule( name="coboutcoh", - ins=["scripts/mkcobout.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + ins=[ + "scripts/mkcobout.lua", + "scripts/libcowgol.lua", + "src/midcodes.coh.tab", + ], outleaves=["cobout.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], label="MKCOBOUT", @@ -139,7 +249,11 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): normalrule( name="iburgcodes", - ins=["scripts/mkiburgcodes.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + ins=[ + "scripts/mkiburgcodes.lua", + "scripts/libcowgol.lua", + "src/midcodes.coh.tab", + ], outleaves=["iburgcodes-coh.h"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], label="MKIBURGCODES", @@ -147,7 +261,11 @@ def cowgol(self, name, srcs: Targets() = [], toolchain: Target() = None): normalrule( name="cobincoh", - ins=["scripts/mkcobin.lua", "scripts/libcowgol.lua", "src/midcodes.coh.tab"], + ins=[ + "scripts/mkcobin.lua", + "scripts/libcowgol.lua", + "src/midcodes.coh.tab", + ], outleaves=["cobin.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], label="MKCOBIN", diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index 50f13eae..aaddc68a 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -20,12 +20,16 @@ @Rule def zmac(self, name, srcs: Targets() = []): filename, ext = splitext(filenameof(srcs)) - archflag = "-z" if (ext == "z80") else "-8" + archflag = "-z" if (ext == ".z80") else "-8" normalrule( replaces=self, ins=["third_party/zmac", srcs[0]], - outleaves=[self.localname + ".cim", self.localname + ".lst"], - commands=["{ins[0]} -j -m " + archflag + " -o {outs[0]} -o {outs[1]} {ins[1]}"], + outleaves=[self.localname + ".cim"], + commands=[ + "{ins[0]} -j -m " + + archflag + + " -o {outs[0]} -o {outs[0]}.lst {ins[1]}" + ], label="ZMAC", ) diff --git a/tools/obpemu/build.py b/tools/obpemu/build.py index c9975306..78c9d0c9 100644 --- a/tools/obpemu/build.py +++ b/tools/obpemu/build.py @@ -1,5 +1,7 @@ from build.c import cprogram cprogram( - name="obpemu", srcs=["./emulator.c", "./main.c"], vars={"+ldflags": "-lreadline"} + name="obpemu", + srcs=["./emulator.c", "./main.c"], + vars={"+ldflags": "-lreadline"}, ) From 409897e6dea18e0194a108dbf42dca70c74c1b7c Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:43 +0000 Subject: [PATCH 17/69] Rename outleaves -> outs. --- build/ab2.py | 4 ++-- build/c.py | 6 +++--- build/gpp.py | 2 +- build/yacc.py | 4 ++-- src/build.py | 20 ++++++++++---------- src/cowfe/build.py | 2 +- src/cowlink/build.py | 2 +- third_party/lemon/build.py | 4 ++-- third_party/musashi/build.py | 2 +- third_party/zmac/build.py | 2 +- tools/build.py | 2 +- tools/newgen/build.py | 2 +- 12 files changed, 26 insertions(+), 26 deletions(-) diff --git a/build/ab2.py b/build/ab2.py index 12863875..7e1041a4 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -426,7 +426,7 @@ def normalrule( name=None, ins: Targets() = [], deps: Targets() = [], - outleaves=[], + outs=[], label="RULE", objdir=None, commands=[], @@ -437,7 +437,7 @@ def normalrule( replaces=self, ins=ins, deps=deps, - outs=[join(objdir, f) for f in outleaves], + outs=[join(objdir, f) for f in outs], label=label, commands=commands, ) diff --git a/build/c.py b/build/c.py index d04a4f13..9eae78f2 100644 --- a/build/c.py +++ b/build/c.py @@ -32,7 +32,7 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): replaces=self, ins=srcs, deps=deps, - outleaves=[outleaf], + outs=[outleaf], label=label, commands=commands, vars={"+" + flags: flatten(includeflags)}, @@ -100,7 +100,7 @@ def clibrary( normalrule( replaces=self, ins=findsources(name, srcs, deps), - outleaves=[basename(name) + ".a"], + outs=[basename(name) + ".a"], label=label, commands=commands, ) @@ -121,7 +121,7 @@ def programimpl(self, name, srcs, deps, commands, label, filerule, kind): normalrule( replaces=self, ins=findsources(name, srcs, deps), - outleaves=[basename(name)], + outs=[basename(name)], label=label, commands=commands, vars={"+ldflags": libraries}, diff --git a/build/gpp.py b/build/gpp.py index 3bc57ee3..ff95f0b2 100644 --- a/build/gpp.py +++ b/build/gpp.py @@ -9,7 +9,7 @@ def gpp(self, name, srcs: Targets() = []): normalrule( replaces=self, ins=srcs, - outleaves=[self.localname + ".i"], + outs=[self.localname + ".i"], commands=[ "gpp --nostdinc -U '' '' '(' ',' ')' '(' ')' '$$' '' -M '$$' '\\n' ' ' ' ' '\\n' '(' ')' " + (" ".join(hdrs)) diff --git a/build/yacc.py b/build/yacc.py index 5a25c710..e14f09ce 100644 --- a/build/yacc.py +++ b/build/yacc.py @@ -6,7 +6,7 @@ def yacc(self, name, srcs: Targets() = []): normalrule( replaces=self, ins=srcs, - outleaves=["y.tab.c", "y.tab.h"], + outs=["y.tab.c", "y.tab.h"], commands=["bison -y -t -o {outs[0]} --defines={outs[1]} {ins}"], label="YACC", ) @@ -17,7 +17,7 @@ def flex(self, name, srcs: Targets() = []): normalrule( replaces=self, ins=srcs, - outleaves=["lexer.c"], + outs=["lexer.c"], commands=["flex -8 -Cem -s -t {ins[0]} > {outs[0]}"], label="FLEX", ) diff --git a/src/build.py b/src/build.py index 9fd65064..46387968 100644 --- a/src/build.py +++ b/src/build.py @@ -14,7 +14,7 @@ def buildgasimpl(self, prefix): normalrule( replaces=self, ins=self.args["srcs"], - outleaves=[self.localname + ".elf"], + outs=[self.localname + ".elf"], commands=[ prefix + "-as -g {ins} -o {outs[0]}.s", prefix + "-ld -g {outs[0]}.s -o {outs[0]}", @@ -85,7 +85,7 @@ def cowlib( cob = normalrule( name=name + "/cowfe", ins=[toolchain.cowfe, cow] + srcs, - outleaves=[self.localname + ".cob"], + outs=[self.localname + ".cob"], commands=[ "scripts/quiet {ins[0]} " + (" ".join(flags)) @@ -97,7 +97,7 @@ def cowlib( normalrule( replaces=self, ins=[toolchain.cowbe, cob], - outleaves=[self.localname + ".coo"], + outs=[self.localname + ".coo"], commands=["scripts/quiet {ins[0]} {ins[1]} {outs}"], label="COWBE-" + toolchain.localname.upper(), ) @@ -113,7 +113,7 @@ def cowlink(self, name, deps: Targets() = [], toolchain: Target() = None): asm = normalrule( name=name + "/cowlink", ins=[toolchain.cowlink] + [coos], - outleaves=[self.localname + toolchain.asmext], + outs=[self.localname + toolchain.asmext], commands=["scripts/quiet {ins[0]} -o {outs} {' '.join(ins[1:])}"], label="COWLINK-" + toolchain.localname.upper(), ) @@ -144,7 +144,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): normalrule( replaces=self, ins=["bootstrap+cowwrap", src], - outleaves=["cowgol.coo"], + outs=["cowgol.coo"], label="COWWRAP-"+toolchain.localname.upper(), commands=[ "{ins[0]} {ins[1]} {outs}" @@ -218,7 +218,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): "scripts/libcowgol.lua", "src/midcodes.coh.tab", ], - outleaves=["midcodesfe.coh"], + outs=["midcodesfe.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]} fe"], label="MKMIDCODESFE", ) @@ -230,7 +230,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): "scripts/libcowgol.lua", "src/midcodes.coh.tab", ], - outleaves=["midcodesbe.coh"], + outs=["midcodesbe.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]} be"], label="MKMIDCODESBE", ) @@ -242,7 +242,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): "scripts/libcowgol.lua", "src/midcodes.coh.tab", ], - outleaves=["cobout.coh"], + outs=["cobout.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], label="MKCOBOUT", ) @@ -254,7 +254,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): "scripts/libcowgol.lua", "src/midcodes.coh.tab", ], - outleaves=["iburgcodes-coh.h"], + outs=["iburgcodes-coh.h"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], label="MKIBURGCODES", ) @@ -266,7 +266,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): "scripts/libcowgol.lua", "src/midcodes.coh.tab", ], - outleaves=["cobin.coh"], + outs=["cobin.coh"], commands=["lua {ins[0]} -- {ins[2]} {outs[0]}"], label="MKCOBIN", ) diff --git a/src/cowfe/build.py b/src/cowfe/build.py index 4c6d0df1..0bf00436 100644 --- a/src/cowfe/build.py +++ b/src/cowfe/build.py @@ -19,7 +19,7 @@ normalrule( name="arch-" + arch, ins=["./arch" + arch + ".coh"], - outleaves=["arch.coh"], + outs=["arch.coh"], commands=["cp {ins} {outs}"], label="COPY", ) diff --git a/src/cowlink/build.py b/src/cowlink/build.py index 940f5811..efbd366a 100644 --- a/src/cowlink/build.py +++ b/src/cowlink/build.py @@ -22,7 +22,7 @@ normalrule( name="arch-" + arch, ins=["./arch" + arch + ".coh"], - outleaves=["archlink.coh"], + outs=["archlink.coh"], commands=["cp {ins} {outs}"], label="COPY", ) diff --git a/third_party/lemon/build.py b/third_party/lemon/build.py index f5c0e5eb..5d865059 100644 --- a/third_party/lemon/build.py +++ b/third_party/lemon/build.py @@ -17,7 +17,7 @@ def lemon(self, name, src: Target() = None): normalrule( replaces=self, ins=["+lemon", "./lempar.c", src], - outleaves=[self.localname + ".c", self.localname + ".h"], + outs=[self.localname + ".c", self.localname + ".h"], commands=["{ins[0]} -T{ins[1]} -d{dirname(outs[0])} {ins[2]}"], label="LEMON", ) @@ -28,7 +28,7 @@ def lemoncowgol(self, name, src: Target() = None): normalrule( replaces=self, ins=["+lemon-cowgol", "src/cowfe/lempar.coh", src], - outleaves=[self.localname + ".coh", self.localname + ".tokens.coh"], + outs=[self.localname + ".coh", self.localname + ".tokens.coh"], commands=["{ins[0]} -T{ins[1]} -d{dirname(outs[0])} {ins[2]}"], label="LEMON-COWGOL", ) diff --git a/third_party/musashi/build.py b/third_party/musashi/build.py index 09694c53..cbb01345 100644 --- a/third_party/musashi/build.py +++ b/third_party/musashi/build.py @@ -6,7 +6,7 @@ normalrule( name="m68kops", ins=["+m68kmake", "./m68k_in.c"], - outleaves=["m68kops.c", "m68kops.h"], + outs=["m68kops.c", "m68kops.h"], commands=["{ins[0]} {dirname(outs[0])} {ins[1]} > /dev/null"], label="MUSASHILIB", ) diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index aaddc68a..a2df8554 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -25,7 +25,7 @@ def zmac(self, name, srcs: Targets() = []): normalrule( replaces=self, ins=["third_party/zmac", srcs[0]], - outleaves=[self.localname + ".cim"], + outs=[self.localname + ".cim"], commands=[ "{ins[0]} -j -m " + archflag diff --git a/tools/build.py b/tools/build.py index edd564db..bcb4882f 100644 --- a/tools/build.py +++ b/tools/build.py @@ -17,7 +17,7 @@ def objectify(self, name, src: Target() = None, symbol=None): normalrule( replaces=self, ins=["tools/objectify", src], - outleaves=[symbol + ".c"], + outs=[symbol + ".c"], commands=["lua {ins[0]} " + symbol + " < {ins[1]} > {outs}"], label="OBJECTIFY", ) diff --git a/tools/newgen/build.py b/tools/newgen/build.py index 481f38e2..10311d26 100644 --- a/tools/newgen/build.py +++ b/tools/newgen/build.py @@ -29,7 +29,7 @@ def newgencowgol(self, name, srcs: Targets() = []): normalrule( replaces=self, ins=["+newgen", preprocessed], - outleaves=["inssel.coh", "inssel.decl.coh"], + outs=["inssel.coh", "inssel.decl.coh"], commands=["{ins[0]} {ins[1]} {outs[0]} {outs[1]}"], label="NEWGEN", ) From b5aa4e1c6bd9cccaea23015f3eadef7c870fdb47 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:43 +0000 Subject: [PATCH 18/69] More toolchains. --- rt/lx386/build.py | 3 +++ src/build.py | 48 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 rt/lx386/build.py diff --git a/rt/lx386/build.py b/rt/lx386/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/lx386/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/src/build.py b/src/build.py index 46387968..af1a5c0f 100644 --- a/src/build.py +++ b/src/build.py @@ -28,6 +28,19 @@ def buildgasarm(self, name, srcs: Targets() = None): buildgasimpl(self, "arm-linux-gnueabihf") +@Rule +def buildgas386(self, name, srcs: Targets() = None): + buildgasimpl(self, "i686-linux-gnu") + +@Rule +def buildgas68k(self, name, srcs: Targets() = None): + buildgasimpl(self, "m68k-linux-gnu") + +@Rule +def buildgasppc(self, name, srcs: Targets() = None): + buildgasimpl(self, "powerpc-linux-gnu") + + @Rule def toolchain( self, @@ -143,7 +156,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): self.cowlib = SimpleNamespace() normalrule( replaces=self, - ins=["bootstrap+cowwrap", src], + ins=[toolchain.cowwrap, src], outs=["cowgol.coo"], label="COWWRAP-"+toolchain.localname.upper(), commands=[ @@ -207,6 +220,39 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): binext=".exe", assembler=buildgasarm, ), + toolchain( + name="lx386", + cowfe="src/cowfe+cowfe-for-80386-with-nncgen", + cowbe="src/cowbe+cowbe-for-80386-with-ncgen", + cowlink="src/cowlink+cowlink-for-lx386-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lx386", + asmext=".s", + binext=".exe", + assembler=buildgas386, + ), + toolchain( + name="lx68k", + cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", + cowbe="src/cowbe+cowbe-for-68000-with-ncgen", + cowlink="src/cowlink+cowlink-for-lx68k-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lx68k", + asmext=".s", + binext=".exe", + assembler=buildgas68k, + ), + toolchain( + name="lxppc", + cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", + cowbe="src/cowbe+cowbe-for-powerpc-with-ncgen", + cowlink="src/cowlink+cowlink-for-lxppc-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lxppc", + asmext=".s", + binext=".exe", + assembler=buildgasppc, + ), ] export(name="toolchains", deps=TOOLCHAINS) From e76ac50e170f8a92de3930ddac9f1c8d60cc0a17 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:44 +0000 Subject: [PATCH 19/69] Fix export dependencies. --- Makefile | 2 +- build/ab2.py | 19 ++++++++++--------- src/build.py | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 9ff89745..0f1b7bda 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,4 @@ build-files = $(shell find . -name 'build.py') build/*.py $(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) - @python3 -B build/ab2.py -m make -o $@ build.py + @python3 -B build/ab2.py -m make -t +all -o $@ build.py diff --git a/build/ab2.py b/build/ab2.py index 7e1041a4..1911c760 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -268,6 +268,10 @@ def filenamesof(*xs): return fs +def targetnamesof(*xs): + return [x.name for x in flatten(xs)] + + def filenameof(x): xs = filenamesof(x) if len(xs) != 1: @@ -315,7 +319,9 @@ def var(self, name, value): emit(name + "=" + unmake(value)) def rule(self, name, ins, outs): + ins = filenamesof(ins) if outs: + outs = filenamesof(outs) emit(".PHONY:", name) emit(name, ":", unmake(outs)) emit(outs, "&:", unmake(ins)) @@ -446,7 +452,7 @@ def normalrule( @Rule def export(self, name=None, items: TargetsMap() = {}, deps: Targets() = []): emitter.rule( - self.name, filenamesof(items.values(), deps), filenamesof(items.keys()) + self.name, flatten(items.values(), deps), filenamesof(items.keys()) ) emitter.exec(f"echo EXPORT {self.name}") @@ -487,6 +493,7 @@ def main(): ) parser.add_argument("-o", "--output") parser.add_argument("files", nargs="+") + parser.add_argument("-t", "--targets", nargs="+") args = parser.parse_args() global outputFp @@ -512,14 +519,8 @@ def main(): for f in args.files: loadbuildfile(f) - total = 0 - while unmaterialisedTargets: - total = len(targets) - finished = total - len(unmaterialisedTargets) - sys.stderr.write("%d/%d\r" % (finished, total)) - next(iter(unmaterialisedTargets)).materialise() - sys.stderr.write("%d/%d\n" % (total, total)) - + for t in args.targets: + targets[t].materialise() emitter.end() diff --git a/src/build.py b/src/build.py index af1a5c0f..3a512431 100644 --- a/src/build.py +++ b/src/build.py @@ -160,7 +160,7 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): outs=["cowgol.coo"], label="COWWRAP-"+toolchain.localname.upper(), commands=[ - "{ins[0]} {ins[1]} {outs}" + "scripts/quiet {ins[0]} {ins[1]} {outs}" ]) From 66f4dd1f434343485d51284eed9c07c764db3d01 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:44 +0000 Subject: [PATCH 20/69] Fix export dependencies... again. --- build/ab2.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build/ab2.py b/build/ab2.py index 1911c760..6bfd0553 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -318,15 +318,15 @@ def var(self, name, value): # Don't let emit insert spaces. emit(name + "=" + unmake(value)) - def rule(self, name, ins, outs): + def rule(self, name, ins, outs, deps=[]): ins = filenamesof(ins) if outs: outs = filenamesof(outs) emit(".PHONY:", name) - emit(name, ":", unmake(outs)) - emit(outs, "&:", unmake(ins)) + emit(name, ":", unmake(outs), unmake(deps)) + emit(outs, "&:", unmake(ins), unmake(deps)) else: - emit(name, ":", unmake(ins)) + emit(name, ":", unmake(ins), unmake(deps)) def exec(self, command): emit("\t$(hide)", unmake(command)) @@ -452,7 +452,10 @@ def normalrule( @Rule def export(self, name=None, items: TargetsMap() = {}, deps: Targets() = []): emitter.rule( - self.name, flatten(items.values(), deps), filenamesof(items.keys()) + self.name, + flatten(items.values()), + filenamesof(items.keys()), + filenamesof(deps), ) emitter.exec(f"echo EXPORT {self.name}") From 1f90e99a06c819e91037b371929c5dd18541d184 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:44 +0000 Subject: [PATCH 21/69] More toolchains. Add missing files. --- build.py | 2 +- build/tass64.py | 14 ++++++++++++ examples/build.py | 1 + rt/bbct/build.py | 3 +++ rt/lx68k/build.py | 3 +++ rt/lxppc/build.py | 3 +++ src/build.py | 54 +++++++++++++++++++++++++++++++++++++++++------ 7 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 build/tass64.py create mode 100644 rt/bbct/build.py create mode 100644 rt/lx68k/build.py create mode 100644 rt/lxppc/build.py diff --git a/build.py b/build.py index cca144aa..c1adfa54 100644 --- a/build.py +++ b/build.py @@ -16,5 +16,5 @@ "bin/lx68kemu": "tools/lx68kemu", "bin/fuzix6303emu": "tools/fuzix6303emu", }, - deps=["third_party/djlink+djlink-programs", "src+toolchains", "examples"], + deps=["third_party/djlink+djlink-programs", "examples"], ) diff --git a/build/tass64.py b/build/tass64.py new file mode 100644 index 00000000..f0a31283 --- /dev/null +++ b/build/tass64.py @@ -0,0 +1,14 @@ +from build.ab2 import normalrule, Rule, Targets, filenameof + + +@Rule +def tass64(self, name, srcs: Targets() = []): + normalrule( + replaces=self, + ins=srcs, + outs=[self.localname + ".bin"], + commands=[ + "64tass --quiet --long-branch --ascii --case-sensitive --nostart -o {outs} {ins}" + ], + label="TASS64", + ) diff --git a/examples/build.py b/examples/build.py index 14d648cc..7aeb5c8f 100644 --- a/examples/build.py +++ b/examples/build.py @@ -13,6 +13,7 @@ items = {} for toolchain in TOOLCHAINS: + toolchain.materialise() for prog in PROGRAMS: t = cowgol( name=prog + "-for-" + toolchain.localname, diff --git a/rt/bbct/build.py b/rt/bbct/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/bbct/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/rt/lx68k/build.py b/rt/lx68k/build.py new file mode 100644 index 00000000..1bedc025 --- /dev/null +++ b/rt/lx68k/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="rt/common-68000/cowgol.cos") diff --git a/rt/lxppc/build.py b/rt/lxppc/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/lxppc/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/src/build.py b/src/build.py index 3a512431..32f1ec63 100644 --- a/src/build.py +++ b/src/build.py @@ -3,6 +3,7 @@ from os.path import * from third_party.zmac.build import zmac from types import SimpleNamespace +from build.tass64 import tass64 @Rule @@ -32,15 +33,22 @@ def buildgasarm(self, name, srcs: Targets() = None): def buildgas386(self, name, srcs: Targets() = None): buildgasimpl(self, "i686-linux-gnu") + @Rule def buildgas68k(self, name, srcs: Targets() = None): buildgasimpl(self, "m68k-linux-gnu") + @Rule def buildgasppc(self, name, srcs: Targets() = None): buildgasimpl(self, "powerpc-linux-gnu") +@Rule +def buildtass64(self, name, srcs: Targets() = None): + tass64(replaces=self, srcs=srcs) + + @Rule def toolchain( self, @@ -152,16 +160,17 @@ def cowgol( @Rule -def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): +def cowwrap( + self, name, src: Target() = None, toolchain: Target() = "src+ncgen" +): self.cowlib = SimpleNamespace() normalrule( replaces=self, ins=[toolchain.cowwrap, src], outs=["cowgol.coo"], - label="COWWRAP-"+toolchain.localname.upper(), - commands=[ - "scripts/quiet {ins[0]} {ins[1]} {outs}" - ]) + label="COWWRAP-" + toolchain.localname.upper(), + commands=["scripts/quiet {ins[0]} {ins[1]} {outs}"], + ) TOOLCHAINS = [ @@ -253,10 +262,41 @@ def cowwrap(self, name, src: Target() = None, toolchain:Target()="src+ncgen"): binext=".exe", assembler=buildgasppc, ), + toolchain( + name="bbct", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-65c02-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + ), + toolchain( + name="bbctiny", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-65c02-tiny-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + ), + toolchain( + name="bbct6502", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-6502-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + ), ] -export(name="toolchains", deps=TOOLCHAINS) - normalrule( name="midcodesfecoh", ins=[ From fb119d5d458bc0a075a1259fe9c4179566abfc02 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:45 +0000 Subject: [PATCH 22/69] Add the rest of the toolchains. --- Makefile | 2 +- build/nasm.py | 12 ++++++ rt/ataritos/build.py | 3 ++ rt/fuzix6303/build.py | 3 ++ rt/msdos/build.py | 3 ++ rt/unixv7/build.py | 3 ++ src/build.py | 77 +++++++++++++++++++++++++++++++++++++ src/cowasm/build.py | 18 +++++++++ third_party/djlink/build.py | 13 ++++++- 9 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 build/nasm.py create mode 100644 rt/ataritos/build.py create mode 100644 rt/fuzix6303/build.py create mode 100644 rt/msdos/build.py create mode 100644 rt/unixv7/build.py create mode 100644 src/cowasm/build.py diff --git a/Makefile b/Makefile index 0f1b7bda..54c815f5 100644 --- a/Makefile +++ b/Makefile @@ -15,4 +15,4 @@ build-files = $(shell find . -name 'build.py') build/*.py $(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) - @python3 -B build/ab2.py -m make -t +all -o $@ build.py + @python3 -X pycache_prefix=$(OBJ) build/ab2.py -m make -t +all -o $@ build.py diff --git a/build/nasm.py b/build/nasm.py new file mode 100644 index 00000000..8e38a04c --- /dev/null +++ b/build/nasm.py @@ -0,0 +1,12 @@ +from build.ab2 import normalrule, Rule, Targets, filenameof + + +@Rule +def nasm(self, name, srcs: Targets() = []): + normalrule( + replaces=self, + ins=srcs, + outs=[self.localname + ".obj"], + commands=["nasm -f obj -o {outs} {ins}"], + label="NASM", + ) diff --git a/rt/ataritos/build.py b/rt/ataritos/build.py new file mode 100644 index 00000000..1bedc025 --- /dev/null +++ b/rt/ataritos/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="rt/common-68000/cowgol.cos") diff --git a/rt/fuzix6303/build.py b/rt/fuzix6303/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/fuzix6303/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/rt/msdos/build.py b/rt/msdos/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/msdos/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/rt/unixv7/build.py b/rt/unixv7/build.py new file mode 100644 index 00000000..b7594b3b --- /dev/null +++ b/rt/unixv7/build.py @@ -0,0 +1,3 @@ +from src.build import cowwrap + +cowwrap(name="cowgolcoo", src="./cowgol.cos") diff --git a/src/build.py b/src/build.py index 32f1ec63..f1dabb67 100644 --- a/src/build.py +++ b/src/build.py @@ -4,6 +4,8 @@ from third_party.zmac.build import zmac from types import SimpleNamespace from build.tass64 import tass64 +from build.nasm import nasm +from third_party.djlink.build import djlink @Rule @@ -44,11 +46,42 @@ def buildgasppc(self, name, srcs: Targets() = None): buildgasimpl(self, "powerpc-linux-gnu") +@Rule +def buildgasataritos(self, name, srcs: Targets() = None): + buildgasimpl(self, "m68k-atari-mint") + + @Rule def buildtass64(self, name, srcs: Targets() = None): tass64(replaces=self, srcs=srcs) +def buildcowasmimpl(self, asm): + normalrule( + replaces=self, + ins=[asm] + self.args["srcs"], + outs=[self.localname + ".bin"], + commands=["scripts/quiet {ins[0]} -o {outs[0]} {ins[1]}"], + label="ASM", + ) + + +@Rule +def buildcowasmpdp11(self, name, srcs: Targets() = None): + buildcowasmimpl(self, "src/cowasm+cowasm-for-pdp11-with-ncgen") + + +@Rule +def buildcowasm6303(self, name, srcs: Targets() = None): + buildcowasmimpl(self, "src/cowasm+cowasm-for-6303-with-ncgen") + + +@Rule +def buildnasm(self, name, srcs: Targets() = None): + o = nasm(name=name + "/obj", srcs=srcs) + djlink(replaces=self, srcs=[o]) + + @Rule def toolchain( self, @@ -295,6 +328,50 @@ def cowwrap( binext=".bin", assembler=buildtass64, ), + toolchain( + name="unixv7", + cowfe="src/cowfe+cowfe-for-pdp11-with-nncgen", + cowbe="src/cowbe+cowbe-for-pdp11-with-ncgen", + cowlink="src/cowlink+cowlink-for-v7unix-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/unixv7", + asmext=".asm", + binext=".exe", + assembler=buildcowasmpdp11, + ), + toolchain( + name="fuzix6303", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-6303-with-ncgen", + cowlink="src/cowlink+cowlink-for-fuzix6303-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/fuzix6303", + asmext=".asm", + binext=".exe", + assembler=buildcowasm6303, + ), + toolchain( + name="msdos", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-8086-with-ncgen", + cowlink="src/cowlink+cowlink-for-msdos-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/msdos", + asmext=".asm", + binext=".exe", + assembler=buildnasm, + ), + toolchain( + name="ataritos", + cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", + cowbe="src/cowbe+cowbe-for-68000-with-ncgen", + cowlink="src/cowlink+cowlink-for-ataritos-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/ataritos", + asmext=".asm", + binext=".tos", + assembler=buildgasataritos, + ), ] normalrule( diff --git a/src/cowasm/build.py b/src/cowasm/build.py new file mode 100644 index 00000000..b9a1eee4 --- /dev/null +++ b/src/cowasm/build.py @@ -0,0 +1,18 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol +from tools.newgen.build import newgencowgol + +ARCHS = ["8080", "pdp11", "6303", "tlcs90", "obp"] + +for toolchain in TOOLCHAINS: + toolchain.materialise() + for arch in ARCHS: + cowgol( + name="cowasm-for-" + arch + "-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "./arch" + arch + ".cow", + "./cowasm.coh", + "./stdsyms.coh", + ], + ) diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py index f42df92a..0208fe71 100644 --- a/third_party/djlink/build.py +++ b/third_party/djlink/build.py @@ -1,5 +1,5 @@ from build.c import cxxprogram -from build.ab2 import export +from build.ab2 import export, Rule, Targets, normalrule cxxprogram( name="objdump", @@ -49,3 +49,14 @@ "bin/djlink": "+djlink", }, ) + + +@Rule +def djlink(self, name, srcs: Targets() = []): + normalrule( + replaces=self, + ins=["+djlink"] + srcs, + outs=[self.localname + ".bin"], + commands=["{ins[0]} -o {outs} {ins[1]} > /dev/null"], + label="DJLINK", + ) From bb4f0374b52d3b9be98fb94e1917679fe5e7b812 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:45 +0000 Subject: [PATCH 23/69] Avoid a build cycle. Add tools to detect build cycles. --- build/ab2.py | 128 +++++++++++++++++++++++++-------------------- src/cowbe/build.py | 10 ++-- src/cowfe/build.py | 8 ++- 3 files changed, 85 insertions(+), 61 deletions(-) diff --git a/build/ab2.py b/build/ab2.py index 6bfd0553..e12a41e9 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -17,6 +17,7 @@ defaultGlobals = {} targets = {} unmaterialisedTargets = set() +materialisingStack = [] outputFp = None emitter = None currentVars = None @@ -99,16 +100,25 @@ class Invocation: types = None ins = None outs = None - rawArgs = None + binding = None vars = None varsettings = None - def materialise(self): + def materialise(self, replacing=False): if self in unmaterialisedTargets: + if not replacing and (self in materialisingStack): + print("Found dependency cycle:") + for i in materialisingStack: + print(f" {i.name}") + print(f" {self.name}") + sys.exit(1) + + materialisingStack.append(self) + # Perform type conversion to the declared rule parameter types. self.args = {} - for k, v in self.rawArgs.items(): + for k, v in self.binding.arguments.items(): t = self.types.get(k, None) if t: v = t.convert(v, self) @@ -131,7 +141,12 @@ def materialise(self): # Actually call the callback. - self.callback(**self.args) + try: + self.callback(**self.args) + except BaseException as e: + print(f"Error materialising {self} ({id(self)}): {self.callback}") + print(f"Arguments: {self.args}") + raise e if not self.outs: raise ABException(f"{self.name} didn't set self.outs") @@ -141,10 +156,63 @@ def materialise(self): if self in unmaterialisedTargets: unmaterialisedTargets.remove(self) + materialisingStack.pop() + def __repr__(self): return "" % self.name +def Rule(func): + sig = inspect.signature(func) + + @functools.wraps(func) + def wrapper(*, name=None, replaces=None, **kwargs): + callername = inspect.stack()[1][0].f_globals["__name__"] + cwd = dirname(callername.replace(".", "/")) + + if name: + if ("+" in name) and not name.startswith("+"): + (cwd, target) = name.split("+", 1) + + i = Invocation() + if name.startswith("./"): + name = join(cwd, name) + elif "+" not in name: + name = cwd + "+" + name + + i.name = name + i.localname = name.split("+")[-1] + + if name in targets: + raise ABException(f"target {i.name} has already been defined") + targets[name] = i + elif replaces: + i = replaces + name = i.name + else: + raise ABException("you must supply either name or replaces") + + i.cwd = cwd + i.types = func.__annotations__ + i.callback = func + i.callerVars = currentVars + i.varsettings = kwargs.get("vars", None) + setattr(i, func.__name__, SimpleNamespace()) + + kwargs.pop("vars", None) + + i.binding = sig.bind(name=name, self=i, **kwargs) + i.binding.apply_defaults() + + unmaterialisedTargets.add(i) + if replaces: + i.materialise(replacing=True) + return i + + defaultGlobals[func.__name__] = wrapper + return wrapper + + class Type: pass @@ -350,58 +418,6 @@ def rule(self, name, ins, outs): emit("build", name, ": phony", unmake(ins)) -def Rule(func): - sig = inspect.signature(func) - - @functools.wraps(func) - def wrapper(*, name=None, replaces=None, **kwargs): - callername = inspect.stack()[1][0].f_globals["__name__"] - cwd = dirname(callername.replace(".", "/")) - - if name: - if ("+" in name) and not name.startswith("+"): - (cwd, target) = name.split("+", 1) - - i = Invocation() - if name.startswith("./"): - name = join(cwd, name) - elif "+" not in name: - name = cwd + "+" + name - - i.name = name - i.localname = name.split("+")[-1] - - if name in targets: - raise ABException(f"target {i.name} has already been defined") - targets[name] = i - elif replaces: - i = replaces - name = i.name - else: - raise ABException("you must supply either name or replaces") - - i.cwd = cwd - i.types = func.__annotations__ - i.callback = func - i.callerVars = currentVars - i.varsettings = kwargs.get("vars", None) - setattr(i, func.__name__, SimpleNamespace()) - - kwargs.pop("vars", None) - - bound = sig.bind(name=name, self=i, **kwargs) - bound.apply_defaults() - i.rawArgs = bound.arguments - - unmaterialisedTargets.add(i) - if replaces: - i.materialise() - return i - - defaultGlobals[func.__name__] = wrapper - return wrapper - - @Rule def simplerule( self, diff --git a/src/cowbe/build.py b/src/cowbe/build.py index b77abf20..56c634bb 100644 --- a/src/cowbe/build.py +++ b/src/cowbe/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule +from build.ab2 import normalrule, export from src.build import TOOLCHAINS, cowgol from tools.newgen.build import newgencowgol @@ -30,10 +30,12 @@ srcs=["src/cowbe/arch" + arch + ".cow.ng"] + extras.get(arch, []), ) +items = {} for toolchain in TOOLCHAINS: for arch in ARCHS: - cowgol( - name="cowbe-for-" + arch + "-with-" + toolchain.localname, + name = "cowbe-for-" + arch + "-with-" + toolchain.localname + items["bin/" + name] = cowgol( + name=name, toolchain=toolchain, srcs=[ "+gen-" + arch, @@ -53,3 +55,5 @@ "./utils.coh", ], ) + +export(name="cowbe", items=items) diff --git a/src/cowfe/build.py b/src/cowfe/build.py index 0bf00436..6468693e 100644 --- a/src/cowfe/build.py +++ b/src/cowfe/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule +from build.ab2 import normalrule, export from src.build import TOOLCHAINS, cowgol from third_party.lemon.build import lemoncowgol @@ -24,9 +24,11 @@ label="COPY", ) +items = {} for toolchain in TOOLCHAINS: for arch in ARCHS: - cowgol( + name="cowfe-for-" + arch + "-with-" + toolchain.localname + items[name] = cowgol( name="cowfe-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, srcs=[ @@ -49,3 +51,5 @@ "src+midcodesfecoh", ], ) + + From b109e9655b5f510f85b2c169cd4acfc1e74a1c5f Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:45 +0000 Subject: [PATCH 24/69] Detect whether tools are available. --- Makefile | 6 +- build/ab2.py | 4 +- config.py | 14 +++ src/build.py | 264 +++++++++++++++++++++++++++------------------ src/cowfe/build.py | 4 +- 5 files changed, 180 insertions(+), 112 deletions(-) create mode 100644 config.py diff --git a/Makefile b/Makefile index 54c815f5..eb90513d 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,12 @@ clean: @echo CLEAN @rm -rf $(OBJ) bin -build-files = $(shell find . -name 'build.py') build/*.py +build-files = $(shell find . -name 'build.py') build/*.py config.py $(OBJ)/build.mk: Makefile $(build-files) @echo ACKBUILDER @mkdir -p $(OBJ) @python3 -X pycache_prefix=$(OBJ) build/ab2.py -m make -t +all -o $@ build.py + +.DELETE_ON_ERROR: +.SECONDARY: + diff --git a/build/ab2.py b/build/ab2.py index e12a41e9..ae1520e0 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -144,7 +144,9 @@ def materialise(self, replacing=False): try: self.callback(**self.args) except BaseException as e: - print(f"Error materialising {self} ({id(self)}): {self.callback}") + print( + f"Error materialising {self} ({id(self)}): {self.callback}" + ) print(f"Arguments: {self.args}") raise e if not self.outs: diff --git a/config.py b/config.py new file mode 100644 index 00000000..9020f2bd --- /dev/null +++ b/config.py @@ -0,0 +1,14 @@ +import os + + +def enable_if(command): + return os.system(f"command -v {command} > /dev/null") == 0 + + +has_gccataritos = enable_if("m68k-atari-mint-as") +has_nasm = enable_if("nasm") +has_gcc386 = enable_if("i686-linux-gnu-as") +has_gcc68k = enable_if("m68k-linux-gnu-as") +has_gccthumb2 = enable_if("arm-linux-gnueabihf-as") +has_gccpowerpc = enable_if("powerpc-linux-gnu-as") +has_tass64 = enable_if("64tass") diff --git a/src/build.py b/src/build.py index f1dabb67..089395f2 100644 --- a/src/build.py +++ b/src/build.py @@ -6,6 +6,7 @@ from build.tass64 import tass64 from build.nasm import nasm from third_party.djlink.build import djlink +import config @Rule @@ -206,7 +207,9 @@ def cowwrap( ) -TOOLCHAINS = [ +TOOLCHAINS = [] + +TOOLCHAINS.append( toolchain( name="ncgen", cowfe="bootstrap+cowfe", @@ -217,7 +220,10 @@ def cowwrap( asmext=".c", binext=".exe", assembler=cgen, - ), + ) +) + +TOOLCHAINS.append( toolchain( name="nncgen", cowfe="src/cowfe+cowfe-for-cgen-with-ncgen", @@ -228,7 +234,10 @@ def cowwrap( asmext=".c", binext=".exe", assembler=cgen, - ), + ) +) + +TOOLCHAINS.append( toolchain( name="ncpm", cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", @@ -239,7 +248,10 @@ def cowwrap( asmext=".asm", binext=".com", assembler=zmac, - ), + ) +) + +TOOLCHAINS.append( toolchain( name="ncpmz", cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", @@ -250,84 +262,111 @@ def cowwrap( asmext=".z80", binext=".com", assembler=zmac, - ), - toolchain( - name="lxthumb2", - cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", - cowbe="src/cowbe+cowbe-for-thumb2-with-ncgen", - cowlink="src/cowlink+cowlink-for-lxthumb2-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lxthumb2", - asmext=".s", - binext=".exe", - assembler=buildgasarm, - ), - toolchain( - name="lx386", - cowfe="src/cowfe+cowfe-for-80386-with-nncgen", - cowbe="src/cowbe+cowbe-for-80386-with-ncgen", - cowlink="src/cowlink+cowlink-for-lx386-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lx386", - asmext=".s", - binext=".exe", - assembler=buildgas386, - ), - toolchain( - name="lx68k", - cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", - cowbe="src/cowbe+cowbe-for-68000-with-ncgen", - cowlink="src/cowlink+cowlink-for-lx68k-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lx68k", - asmext=".s", - binext=".exe", - assembler=buildgas68k, - ), - toolchain( - name="lxppc", - cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", - cowbe="src/cowbe+cowbe-for-powerpc-with-ncgen", - cowlink="src/cowlink+cowlink-for-lxppc-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lxppc", - asmext=".s", - binext=".exe", - assembler=buildgasppc, - ), - toolchain( - name="bbct", - cowfe="src/cowfe+cowfe-for-6502-with-nncgen", - cowbe="src/cowbe+cowbe-for-65c02-with-ncgen", - cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/bbct", - asmext=".asm", - binext=".bin", - assembler=buildtass64, - ), - toolchain( - name="bbctiny", - cowfe="src/cowfe+cowfe-for-6502-with-nncgen", - cowbe="src/cowbe+cowbe-for-65c02-tiny-with-ncgen", - cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/bbct", - asmext=".asm", - binext=".bin", - assembler=buildtass64, - ), - toolchain( - name="bbct6502", - cowfe="src/cowfe+cowfe-for-6502-with-nncgen", - cowbe="src/cowbe+cowbe-for-6502-with-ncgen", - cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/bbct", - asmext=".asm", - binext=".bin", - assembler=buildtass64, - ), + ) +) + +if config.has_gccthumb2: + TOOLCHAINS.append( + toolchain( + name="lxthumb2", + cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", + cowbe="src/cowbe+cowbe-for-thumb2-with-ncgen", + cowlink="src/cowlink+cowlink-for-lxthumb2-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lxthumb2", + asmext=".s", + binext=".exe", + assembler=buildgasarm, + ) + ) + +if config.has_gcc386: + TOOLCHAINS.append( + toolchain( + name="lx386", + cowfe="src/cowfe+cowfe-for-80386-with-nncgen", + cowbe="src/cowbe+cowbe-for-80386-with-ncgen", + cowlink="src/cowlink+cowlink-for-lx386-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lx386", + asmext=".s", + binext=".exe", + assembler=buildgas386, + ) + ) + +if config.has_gcc68k: + TOOLCHAINS.append( + toolchain( + name="lx68k", + cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", + cowbe="src/cowbe+cowbe-for-68000-with-ncgen", + cowlink="src/cowlink+cowlink-for-lx68k-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lx68k", + asmext=".s", + binext=".exe", + assembler=buildgas68k, + ) + ) + +if config.has_gccpowerpc: + TOOLCHAINS.append( + toolchain( + name="lxppc", + cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", + cowbe="src/cowbe+cowbe-for-powerpc-with-ncgen", + cowlink="src/cowlink+cowlink-for-lxppc-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lxppc", + asmext=".s", + binext=".exe", + assembler=buildgasppc, + ) + ) + +if config.has_tass64: + TOOLCHAINS.append( + toolchain( + name="bbct", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-65c02-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + ) + ) + TOOLCHAINS.append( + toolchain( + name="bbctiny", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-65c02-tiny-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + ) + ) + TOOLCHAINS.append( + toolchain( + name="bbct6502", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-6502-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + ) + ) + +TOOLCHAINS.append( toolchain( name="unixv7", cowfe="src/cowfe+cowfe-for-pdp11-with-nncgen", @@ -338,7 +377,10 @@ def cowwrap( asmext=".asm", binext=".exe", assembler=buildcowasmpdp11, - ), + ) +) + +TOOLCHAINS.append( toolchain( name="fuzix6303", cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", @@ -349,30 +391,38 @@ def cowwrap( asmext=".asm", binext=".exe", assembler=buildcowasm6303, - ), - toolchain( - name="msdos", - cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", - cowbe="src/cowbe+cowbe-for-8086-with-ncgen", - cowlink="src/cowlink+cowlink-for-msdos-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/msdos", - asmext=".asm", - binext=".exe", - assembler=buildnasm, - ), - toolchain( - name="ataritos", - cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", - cowbe="src/cowbe+cowbe-for-68000-with-ncgen", - cowlink="src/cowlink+cowlink-for-ataritos-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/ataritos", - asmext=".asm", - binext=".tos", - assembler=buildgasataritos, - ), -] + ) +) + +if config.has_nasm: + TOOLCHAINS.append( + toolchain( + name="msdos", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-8086-with-ncgen", + cowlink="src/cowlink+cowlink-for-msdos-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/msdos", + asmext=".asm", + binext=".exe", + assembler=buildnasm, + ) + ) + +if config.has_gccataritos: + TOOLCHAINS.append( + toolchain( + name="ataritos", + cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", + cowbe="src/cowbe+cowbe-for-68000-with-ncgen", + cowlink="src/cowlink+cowlink-for-ataritos-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/ataritos", + asmext=".asm", + binext=".tos", + assembler=buildgasataritos, + ) + ) normalrule( name="midcodesfecoh", diff --git a/src/cowfe/build.py b/src/cowfe/build.py index 6468693e..88004c42 100644 --- a/src/cowfe/build.py +++ b/src/cowfe/build.py @@ -27,7 +27,7 @@ items = {} for toolchain in TOOLCHAINS: for arch in ARCHS: - name="cowfe-for-" + arch + "-with-" + toolchain.localname + name = "cowfe-for-" + arch + "-with-" + toolchain.localname items[name] = cowgol( name="cowfe-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, @@ -51,5 +51,3 @@ "src+midcodesfecoh", ], ) - - From ee02d1ffbbb2c64517609f25e86b92b0ed27e7f3 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:46 +0000 Subject: [PATCH 25/69] Update build script --- .github/workflows/ccpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 7c5811d0..d8af975a 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -4,7 +4,7 @@ on: [push] jobs: build-linux: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: apt update @@ -12,7 +12,7 @@ jobs: - name: add-apt-repository run: sudo add-apt-repository ppa:vriviere/ppa -y - name: apt - run: sudo apt install ninja-build lua5.1 pasmo libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm + run: sudo apt install ninja-build lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm - name: make run: make NINJAFLAGS=-k1 From bb23c082c30a7a96e9ffcf13f79856eb9f59af02 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:46 +0000 Subject: [PATCH 26/69] Actually run some tests. --- build.py | 4 +- src/build.py | 48 ++++++++++++++++++++++- tests/build.py | 87 ++++++++++++++++++++++++++++++++++++++++++ tools/tubeemu/build.py | 2 +- 4 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 tests/build.py diff --git a/build.py b/build.py index c1adfa54..adf90293 100644 --- a/build.py +++ b/build.py @@ -4,7 +4,7 @@ export( name="all", items={ - "bin/bbctube": "tools/tubeemu+bbctube", + "bin/tubeemu": "tools/tubeemu", "bin/obpemu": "tools/obpemu", "bin/mkadfs": "tools+mkadfs", "bin/mkdfs": "tools+mkdfs", @@ -16,5 +16,5 @@ "bin/lx68kemu": "tools/lx68kemu", "bin/fuzix6303emu": "tools/fuzix6303emu", }, - deps=["third_party/djlink+djlink-programs", "examples"], + deps=["third_party/djlink+djlink-programs", "examples", "tests"], ) diff --git a/src/build.py b/src/build.py index 089395f2..3130bb5c 100644 --- a/src/build.py +++ b/src/build.py @@ -1,4 +1,12 @@ -from build.ab2 import Rule, Target, Targets, export, normalrule, filenamesof +from build.ab2 import ( + Rule, + Target, + Targets, + export, + normalrule, + filenamesof, + filenameof, +) from build.c import cprogram from os.path import * from third_party.zmac.build import zmac @@ -83,6 +91,39 @@ def buildnasm(self, name, srcs: Targets() = None): djlink(replaces=self, srcs=[o]) +def testimpl(self, runner): + goodfile = self.args["goodfile"] + normalrule( + replaces=self, + ins=[self.args["exe"]], + outs=[self.localname + ".bad"], + commands=[ + "timeout 5s " + runner + " {ins} > {outs}; true", + "diff -u -w {outs[0]} " + filenameof(goodfile), + ], + label="TEST", + ) + + +@Rule +def nativetest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, "") + + +@Rule +def tubeemutest(self, name, goodfile: Target() = None, exe: Target() = None): + normalrule( + replaces=self, + ins=["tools/tubeemu", self.args["exe"], goodfile], + outs=[self.localname + ".bad"], + commands=[ + "timeout 5s {ins[0]} -l 0x400 -e 0x400 -f {ins[1]} > {outs}; true", + "diff -u -w {outs[0]} " + filenameof(goodfile), + ], + label="TEST", + ) + + @Rule def toolchain( self, @@ -95,6 +136,7 @@ def toolchain( asmext=None, binext=None, assembler=None, + tester=None, ): id = self.localname @@ -234,6 +276,7 @@ def cowwrap( asmext=".c", binext=".exe", assembler=cgen, + tester=nativetest, ) ) @@ -337,6 +380,7 @@ def cowwrap( asmext=".asm", binext=".bin", assembler=buildtass64, + tester=tubeemutest, ) ) TOOLCHAINS.append( @@ -350,6 +394,7 @@ def cowwrap( asmext=".asm", binext=".bin", assembler=buildtass64, + tester=tubeemutest, ) ) TOOLCHAINS.append( @@ -363,6 +408,7 @@ def cowwrap( asmext=".asm", binext=".bin", assembler=buildtass64, + tester=tubeemutest, ) ) diff --git a/tests/build.py b/tests/build.py new file mode 100644 index 00000000..1bfd7312 --- /dev/null +++ b/tests/build.py @@ -0,0 +1,87 @@ +from build.ab2 import normalrule, Rule, Target, export +from src.build import TOOLCHAINS, cowgol + +TESTS = [ + "addsub-16bit", + "addsub-32bit", + "addsub-8bit", + "atoi", + "arrayinitialisers", + "case", + "casts", + "conditionals", + "divrem-16bit-s", + "divrem-16bit-u", + "divrem-32bit-s", + "divrem-32bit-u", + "divrem-8bit-s", + "divrem-8bit-u", + # "empty", # causes qemu to crash, but works on real hardware + "fileio", + "folding", + "forwards", + "inputparams", + "interfaces", + "itoa", + "logic-16bit", + "logic-32bit", + "logic-8bit", + "loops", + "lvalues", + "malloc", + "mul-16bit-s", + "mul-16bit-u", + "mul-32bit-s", + "mul-32bit-u", + "mul-8bit-s", + "mul-8bit-u", + "nested-calls", + "outputparams", + "passto", + "pointers", + "rangetypes", + "recordinitialisers", + "records", + "regalloc", + "shifts-16bit", + "shifts-32bit", + "shifts-8bit", + "unions", +] + + +@Rule +def testsuite(self, name, toolchain: Target() = None): + tests = [] + if toolchain.tester: + for test in TESTS: + bin = cowgol( + name=name + "/" + test + "/bin", + srcs=["./" + test + ".test.cow"], + toolchain=toolchain, + ) + + tests.append( + toolchain.tester( + name=name + "/" + test, + goodfile="./" + test + ".good", + exe=bin, + ) + ) + + normalrule( + replaces=self, + ins=tests, + outs=["stamp"], + commands=["touch {outs}"], + label="TESTSUITE", + ) + + +export( + name="tests", + deps=[ + testsuite(name="tests-" + toolchain.localname, toolchain=toolchain) + for toolchain in TOOLCHAINS + ], +) diff --git a/tools/tubeemu/build.py b/tools/tubeemu/build.py index c81391ae..fee3995f 100644 --- a/tools/tubeemu/build.py +++ b/tools/tubeemu/build.py @@ -1,3 +1,3 @@ from build.c import cprogram -cprogram(name="bbctube", srcs=["./bbctube.c"], deps=["third_party/lib6502"]) +cprogram(name="tubeemu", srcs=["./bbctube.c"], deps=["third_party/lib6502"]) From 37683683fbd3acbbba9a60ac9e31c481dc9ae392 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:46 +0000 Subject: [PATCH 27/69] Don't use inspect in the critical path; massive performance boosts. This does change the semantics very slightly but I can live with that. --- build/ab2.py | 30 ++++++++++++------------------ third_party/djlink/build.py | 2 +- third_party/lemon/build.py | 4 ++-- tools/newgen/build.py | 2 +- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/build/ab2.py b/build/ab2.py index ae1520e0..fdae4622 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -13,6 +13,7 @@ import types import pathlib import builtins +import cProfile defaultGlobals = {} targets = {} @@ -21,6 +22,7 @@ outputFp = None emitter = None currentVars = None +cwdStack = [""] sys.path += ["."] old_import = builtins.__import__ @@ -38,7 +40,9 @@ def new_import(name, *args, **kwargs): ) module = importlib.util.module_from_spec(spec) sys.modules[name] = module + cwdStack.append(dirname(path)) spec.loader.exec_module(module) + cwdStack.pop() return old_import(name, *args, **kwargs) @@ -142,7 +146,9 @@ def materialise(self, replacing=False): # Actually call the callback. try: + cwdStack.append(self.cwd) self.callback(**self.args) + cwdStack.pop() except BaseException as e: print( f"Error materialising {self} ({id(self)}): {self.callback}" @@ -169,13 +175,14 @@ def Rule(func): @functools.wraps(func) def wrapper(*, name=None, replaces=None, **kwargs): - callername = inspect.stack()[1][0].f_globals["__name__"] - cwd = dirname(callername.replace(".", "/")) - + cwd = None if name: if ("+" in name) and not name.startswith("+"): - (cwd, target) = name.split("+", 1) + (cwd, _) = name.split("+", 1) + if not cwd: + cwd = cwdStack[-1] + if name: i = Invocation() if name.startswith("./"): name = join(cwd, name) @@ -270,20 +277,6 @@ def recurse(xs): return list(recurse(xs)) -def massagefilename(s): - callername = inspect.stack()[1][0].f_globals["__name__"] - cwd = dirname(callername.replace(".", "/")) - - if ("+" in name) and not name.startswith("+"): - (cwd, target) = name.split("+", 1) - - i = Invocation() - if name.startswith("./"): - name = join(cwd, name) - elif "+" not in name: - name = cwd + "+" + name - - def fileinvocation(s): i = Invocation() i.name = "(anonymous)" @@ -546,3 +539,4 @@ def main(): main() +#cProfile.run("main()", sort="tottime") diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py index 0208fe71..a41d68b3 100644 --- a/third_party/djlink/build.py +++ b/third_party/djlink/build.py @@ -55,7 +55,7 @@ def djlink(self, name, srcs: Targets() = []): normalrule( replaces=self, - ins=["+djlink"] + srcs, + ins=["third_party/djlink"] + srcs, outs=[self.localname + ".bin"], commands=["{ins[0]} -o {outs} {ins[1]} > /dev/null"], label="DJLINK", diff --git a/third_party/lemon/build.py b/third_party/lemon/build.py index 5d865059..43bae3f2 100644 --- a/third_party/lemon/build.py +++ b/third_party/lemon/build.py @@ -16,7 +16,7 @@ def lemon(self, name, src: Target() = None): normalrule( replaces=self, - ins=["+lemon", "./lempar.c", src], + ins=["third_party/lemon+lemon", "third_party/lemon/lempar.c", src], outs=[self.localname + ".c", self.localname + ".h"], commands=["{ins[0]} -T{ins[1]} -d{dirname(outs[0])} {ins[2]}"], label="LEMON", @@ -27,7 +27,7 @@ def lemon(self, name, src: Target() = None): def lemoncowgol(self, name, src: Target() = None): normalrule( replaces=self, - ins=["+lemon-cowgol", "src/cowfe/lempar.coh", src], + ins=["third_party/lemon+lemon-cowgol", "src/cowfe/lempar.coh", src], outs=[self.localname + ".coh", self.localname + ".tokens.coh"], commands=["{ins[0]} -T{ins[1]} -d{dirname(outs[0])} {ins[2]}"], label="LEMON-COWGOL", diff --git a/tools/newgen/build.py b/tools/newgen/build.py index 10311d26..f3c5541a 100644 --- a/tools/newgen/build.py +++ b/tools/newgen/build.py @@ -28,7 +28,7 @@ def newgencowgol(self, name, srcs: Targets() = []): normalrule( replaces=self, - ins=["+newgen", preprocessed], + ins=["tools/newgen", preprocessed], outs=["inssel.coh", "inssel.decl.coh"], commands=["{ins[0]} {ins[1]} {outs[0]} {outs[1]}"], label="NEWGEN", From 6a405b17cef744353252576043bbaafbe9021bee Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:46 +0000 Subject: [PATCH 28/69] Lots more test suites work. --- src/build.py | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/build.py b/src/build.py index 3130bb5c..cb1ad7f3 100644 --- a/src/build.py +++ b/src/build.py @@ -91,14 +91,14 @@ def buildnasm(self, name, srcs: Targets() = None): djlink(replaces=self, srcs=[o]) -def testimpl(self, runner): +def testimpl(self, dep, command): goodfile = self.args["goodfile"] normalrule( replaces=self, - ins=[self.args["exe"]], + ins=dep + [self.args["exe"]], outs=[self.localname + ".bad"], commands=[ - "timeout 5s " + runner + " {ins} > {outs}; true", + "timeout 5s " + command + " > {outs}; true", "diff -u -w {outs[0]} " + filenameof(goodfile), ], label="TEST", @@ -107,21 +107,32 @@ def testimpl(self, runner): @Rule def nativetest(self, name, goodfile: Target() = None, exe: Target() = None): - testimpl(self, "") + testimpl(self, [], "{ins[0]}") @Rule def tubeemutest(self, name, goodfile: Target() = None, exe: Target() = None): - normalrule( - replaces=self, - ins=["tools/tubeemu", self.args["exe"], goodfile], - outs=[self.localname + ".bad"], - commands=[ - "timeout 5s {ins[0]} -l 0x400 -e 0x400 -f {ins[1]} > {outs}; true", - "diff -u -w {outs[0]} " + filenameof(goodfile), - ], - label="TEST", - ) + testimpl(self, ["tools/tubeemu"], "{ins[0]} -l 0x400 -e 0x400 -f {ins[1]}") + + +@Rule +def cpmtest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, ["tools/cpmemu"], "{ins[0]} {ins[1]}") + + +@Rule +def apouttest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, ["third_party/apout"], "{ins[0]} {ins[1]}") + + +@Rule +def fuzix6303test(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, ["tools/fuzix6303emu"], "{ins[0]} -f {ins[1]}") + + +@Rule +def ataritostest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, ["tools/ataritosemu"], "{ins[0]} {ins[1]}") @Rule @@ -291,6 +302,7 @@ def cowwrap( asmext=".asm", binext=".com", assembler=zmac, + tester=cpmtest, ) ) @@ -305,6 +317,7 @@ def cowwrap( asmext=".z80", binext=".com", assembler=zmac, + tester=cpmtest, ) ) @@ -423,6 +436,7 @@ def cowwrap( asmext=".asm", binext=".exe", assembler=buildcowasmpdp11, + tester=apouttest, ) ) @@ -437,6 +451,7 @@ def cowwrap( asmext=".asm", binext=".exe", assembler=buildcowasm6303, + tester=fuzix6303test, ) ) @@ -467,6 +482,7 @@ def cowwrap( asmext=".asm", binext=".tos", assembler=buildgasataritos, + tester=ataritostest ) ) From d1acd90009881c9b04b6160769e996008e4c5987 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:47 +0000 Subject: [PATCH 29/69] Add the rest of the tests. Is it all done now? --- build/ab2.py | 2 +- config.py | 4 ++++ src/build.py | 32 +++++++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 2 deletions(-) diff --git a/build/ab2.py b/build/ab2.py index fdae4622..e104418f 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -539,4 +539,4 @@ def main(): main() -#cProfile.run("main()", sort="tottime") +# cProfile.run("main()", sort="tottime") diff --git a/config.py b/config.py index 9020f2bd..c3642d97 100644 --- a/config.py +++ b/config.py @@ -12,3 +12,7 @@ def enable_if(command): has_gccthumb2 = enable_if("arm-linux-gnueabihf-as") has_gccpowerpc = enable_if("powerpc-linux-gnu-as") has_tass64 = enable_if("64tass") +has_qemuarm = enable_if("qemu-arm") +has_qemu386 = enable_if("qemu-i386") +has_qemuppc = enable_if("qemu-ppc") +has_qemu68k = enable_if("qemu-m68k") diff --git a/src/build.py b/src/build.py index cb1ad7f3..a9710df7 100644 --- a/src/build.py +++ b/src/build.py @@ -135,6 +135,31 @@ def ataritostest(self, name, goodfile: Target() = None, exe: Target() = None): testimpl(self, ["tools/ataritosemu"], "{ins[0]} {ins[1]}") +@Rule +def qemuarmtest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, [], "qemu-arm {ins[0]}") + + +@Rule +def qemu386test(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, [], "qemu-i386 {ins[0]}") + + +@Rule +def qemu68ktest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, [], "qemu-m68k {ins[0]}") + + +@Rule +def qemuppctest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, [], "qemu-ppc {ins[0]}") + + +@Rule +def msdostest(self, name, goodfile: Target() = None, exe: Target() = None): + testimpl(self, ["third_party/emu2"], "{ins[0]} {ins[1]}") + + @Rule def toolchain( self, @@ -333,6 +358,7 @@ def cowwrap( asmext=".s", binext=".exe", assembler=buildgasarm, + tester=qemuarmtest if config.has_qemuarm else None, ) ) @@ -348,6 +374,7 @@ def cowwrap( asmext=".s", binext=".exe", assembler=buildgas386, + tester=qemu386test if config.has_qemu386 else None, ) ) @@ -363,6 +390,7 @@ def cowwrap( asmext=".s", binext=".exe", assembler=buildgas68k, + tester=qemu68ktest if config.has_qemu68k else None, ) ) @@ -378,6 +406,7 @@ def cowwrap( asmext=".s", binext=".exe", assembler=buildgasppc, + tester=qemuppctest if config.has_qemuppc else None, ) ) @@ -467,6 +496,7 @@ def cowwrap( asmext=".asm", binext=".exe", assembler=buildnasm, + tester=msdostest, ) ) @@ -482,7 +512,7 @@ def cowwrap( asmext=".asm", binext=".tos", assembler=buildgasataritos, - tester=ataritostest + tester=ataritostest, ) ) From da6c308e3d9581ec141bfab98c040a0a4067efc1 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:47 +0000 Subject: [PATCH 30/69] Build some more small things. --- build.py | 3 +++ src/cowbdmp/build.py | 14 ++++++++++++++ src/cowdis/build.py | 14 ++++++++++++++ src/misc/build.py | 14 ++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 src/cowbdmp/build.py create mode 100644 src/cowdis/build.py create mode 100644 src/misc/build.py diff --git a/build.py b/build.py index adf90293..ef8b4c63 100644 --- a/build.py +++ b/build.py @@ -15,6 +15,9 @@ "bin/ataritosemu": "tools/ataritosemu", "bin/lx68kemu": "tools/lx68kemu", "bin/fuzix6303emu": "tools/fuzix6303emu", + "bin/cowdis-tlcs90": "src/cowdis+cowdis-for-tlcs90-with-nncgen", + "bin/cowbdmp": "src/cowbdmp+cowbdmp-with-nncgen", + "bin/basicify": "src/misc+basicify-with-nncgen", }, deps=["third_party/djlink+djlink-programs", "examples", "tests"], ) diff --git a/src/cowbdmp/build.py b/src/cowbdmp/build.py new file mode 100644 index 00000000..81b97c7a --- /dev/null +++ b/src/cowbdmp/build.py @@ -0,0 +1,14 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol + +for toolchain in TOOLCHAINS: + cowgol( + name="cowbdmp-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "./main.cow", + "./types.coh", + "src+midcodesbecoh", + "src+cobincoh", + ], + ) diff --git a/src/cowdis/build.py b/src/cowdis/build.py new file mode 100644 index 00000000..09b7240f --- /dev/null +++ b/src/cowdis/build.py @@ -0,0 +1,14 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol + +ARCHS = ["tlcs90"] + +for toolchain in TOOLCHAINS: + for arch in ARCHS: + cowgol( + name="cowdis-for-" + arch + "-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "./arch" + arch + ".cow", + ], + ) diff --git a/src/misc/build.py b/src/misc/build.py new file mode 100644 index 00000000..7b8b84de --- /dev/null +++ b/src/misc/build.py @@ -0,0 +1,14 @@ +from build.ab2 import normalrule +from src.build import TOOLCHAINS, cowgol + +PROGRAMS = ["basicify"] + +for toolchain in TOOLCHAINS: + for program in PROGRAMS: + cowgol( + name=program + "-with-" + toolchain.localname, + toolchain=toolchain, + srcs=[ + "./" + program + ".cow", + ], + ) From d43a5074860a79dc03a207e9763392231e1d38b2 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:47 +0000 Subject: [PATCH 31/69] Build a bunch of distributions. --- build.py | 12 ++++++++++-- dist/ataritos/build.py | 17 +++++++++++++++++ dist/cpm/build.py | 18 ++++++++++++++++++ dist/cpmz/build.py | 18 ++++++++++++++++++ dist/cpmz/tocpm.lua | 5 ----- dist/msdos/build.py | 15 +++++++++++++++ tools/build.py | 11 +++++++++++ {dist/cpm => tools}/tocpm.lua | 0 8 files changed, 89 insertions(+), 7 deletions(-) create mode 100644 dist/ataritos/build.py create mode 100644 dist/cpm/build.py create mode 100644 dist/cpmz/build.py delete mode 100644 dist/cpmz/tocpm.lua create mode 100644 dist/msdos/build.py rename {dist/cpm => tools}/tocpm.lua (100%) diff --git a/build.py b/build.py index ef8b4c63..8a82b75c 100644 --- a/build.py +++ b/build.py @@ -1,5 +1,6 @@ from build.ab2 import Rule, export from os.path import * +import config export( name="all", @@ -19,5 +20,12 @@ "bin/cowbdmp": "src/cowbdmp+cowbdmp-with-nncgen", "bin/basicify": "src/misc+basicify-with-nncgen", }, - deps=["third_party/djlink+djlink-programs", "examples", "tests"], -) + deps=[ + "third_party/djlink+djlink-programs", + "examples", + "tests", + "dist/cpmz", + "dist/cpm", + ] + + (["dist/msdos"] if config.has_nasm else []) + + (["dist/ataritos"] if config.has_gcc68k else [])) diff --git a/dist/ataritos/build.py b/dist/ataritos/build.py new file mode 100644 index 00000000..8f5edcb6 --- /dev/null +++ b/dist/ataritos/build.py @@ -0,0 +1,17 @@ +from build.ab2 import export +from tools.build import tocpm + +tocpm(name="demosub", src="./demo.sub") + +export( + name="ataritos", + items={ + "bin/dist/ataritos/mandel.cow": "examples/mandel.cow", + "bin/dist/ataritos/cowgol.coh": "rt/ataritos/cowgol.coh", + "bin/dist/ataritos/common.coh": "rt/common.coh", + "bin/dist/ataritos/cowgol.coo": "rt/ataritos+cowgolcoo", + "bin/dist/ataritos/cowfe.com": "src/cowfe+cowfe-for-32bita2-with-ataritos", + "bin/dist/ataritos/cowbe.com": "src/cowbe+cowbe-for-68000-with-ataritos", + "bin/dist/ataritos/cowlink.com": "src/cowlink+cowlink-for-ataritos-with-ataritos", + }, +) diff --git a/dist/cpm/build.py b/dist/cpm/build.py new file mode 100644 index 00000000..4112cfdf --- /dev/null +++ b/dist/cpm/build.py @@ -0,0 +1,18 @@ +from build.ab2 import export +from tools.build import tocpm + +tocpm(name="demosub", src="./demo.sub") + +export( + name="cpm", + items={ + "bin/dist/cpm/demo.sub": "+demosub", + "bin/dist/cpm/mandel.cow": "examples/mandel.cow", + "bin/dist/cpm/cowgol.coh": "rt/cpm/cowgol.coh", + "bin/dist/cpm/common.coh": "rt/common.coh", + "bin/dist/cpm/cowgol.coo": "rt/cpm+cowgolcoo", + "bin/dist/cpm/cowfe.com": "src/cowfe+cowfe-for-16bit-with-ncpm", + "bin/dist/cpm/cowbe.com": "src/cowbe+cowbe-for-8080-with-ncpm", + "bin/dist/cpm/cowlink.com": "src/cowlink+cowlink-for-8080-with-ncpm", + }, +) diff --git a/dist/cpmz/build.py b/dist/cpmz/build.py new file mode 100644 index 00000000..d03a1a24 --- /dev/null +++ b/dist/cpmz/build.py @@ -0,0 +1,18 @@ +from build.ab2 import export +from tools.build import tocpm + +tocpm(name="demosub", src="./demo.sub") + +export( + name="cpmz", + items={ + "bin/dist/cpmz/demo.sub": "+demosub", + "bin/dist/cpmz/mandel.cow": "examples/mandel.cow", + "bin/dist/cpmz/cowgol.coh": "rt/cpmz/cowgol.coh", + "bin/dist/cpmz/common.coh": "rt/common.coh", + "bin/dist/cpmz/cowgol.coo": "rt/cpmz+cowgolcoo", + "bin/dist/cpmz/cowfe.com": "src/cowfe+cowfe-for-16bit-with-ncpmz", + "bin/dist/cpmz/cowbe.com": "src/cowbe+cowbe-for-z80-with-ncpmz", + "bin/dist/cpmz/cowlink.com": "src/cowlink+cowlink-for-8080-with-ncpmz", + }, +) diff --git a/dist/cpmz/tocpm.lua b/dist/cpmz/tocpm.lua deleted file mode 100644 index 1176c6f2..00000000 --- a/dist/cpmz/tocpm.lua +++ /dev/null @@ -1,5 +0,0 @@ -for l in io.stdin:lines() do - io.write(l, "\r\n") -end -io.write(string.char(26)) - diff --git a/dist/msdos/build.py b/dist/msdos/build.py new file mode 100644 index 00000000..f0ba8c9d --- /dev/null +++ b/dist/msdos/build.py @@ -0,0 +1,15 @@ +from build.ab2 import export + +export( + name="msdos", + items={ + "bin/dist/msdos/demo.bat": "./demo.bat", + "bin/dist/msdos/mandel.cow": "examples/mandel.cow", + "bin/dist/msdos/cowgol.coh": "rt/msdos/cowgol.coh", + "bin/dist/msdos/common.coh": "rt/common.coh", + "bin/dist/msdos/cowgol.coo": "rt/msdos+cowgolcoo", + "bin/dist/msdos/cowfe.exe": "src/cowfe+cowfe-for-16bit-with-msdos", + "bin/dist/msdos/cowbe.exe": "src/cowbe+cowbe-for-8086-with-msdos", + "bin/dist/msdos/cowlink.exe": "src/cowlink+cowlink-for-msdos-with-msdos", + }, +) diff --git a/tools/build.py b/tools/build.py index bcb4882f..c69bf232 100644 --- a/tools/build.py +++ b/tools/build.py @@ -21,3 +21,14 @@ def objectify(self, name, src: Target() = None, symbol=None): commands=["lua {ins[0]} " + symbol + " < {ins[1]} > {outs}"], label="OBJECTIFY", ) + + +@Rule +def tocpm(self, name, src: Target() = None): + normalrule( + replaces=self, + ins=["tools/tocpm.lua", src], + outs=[self.localname + ".txt"], + commands=["lua {ins[0]} < {ins[1]} > {outs}"], + label="TOCPM", + ) diff --git a/dist/cpm/tocpm.lua b/tools/tocpm.lua similarity index 100% rename from dist/cpm/tocpm.lua rename to tools/tocpm.lua From 45afd0cd012659bcde6585c1f38883d7659673cb Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:48 +0000 Subject: [PATCH 32/69] Rework types. Built the bbct distribution. --- build.py | 4 ++- build/ab2.py | 42 ++++++++-------------- build/c.py | 22 ++++++------ build/gpp.py | 2 +- build/nasm.py | 2 +- build/tass64.py | 2 +- build/yacc.py | 4 +-- dist/bbct/build.py | 68 ++++++++++++++++++++++++++++++++++++ src/build.py | 68 +++++++++++++++++------------------- tests/build.py | 2 +- third_party/djlink/build.py | 2 +- third_party/lemon/build.py | 4 +-- third_party/musashi/build.py | 2 +- third_party/zmac/build.py | 2 +- tools/build.py | 26 ++++++++++++-- tools/newgen/build.py | 2 +- 16 files changed, 165 insertions(+), 89 deletions(-) create mode 100644 dist/bbct/build.py diff --git a/build.py b/build.py index 8a82b75c..d29da7ed 100644 --- a/build.py +++ b/build.py @@ -28,4 +28,6 @@ "dist/cpm", ] + (["dist/msdos"] if config.has_nasm else []) - + (["dist/ataritos"] if config.has_gcc68k else [])) + + (["dist/ataritos"] if config.has_gcc68k else []) + + (["dist/bbct"] if config.has_tass64 else []), +) diff --git a/build/ab2.py b/build/ab2.py index e104418f..45b25e12 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -13,7 +13,6 @@ import types import pathlib import builtins -import cProfile defaultGlobals = {} targets = {} @@ -125,7 +124,7 @@ def materialise(self, replacing=False): for k, v in self.binding.arguments.items(): t = self.types.get(k, None) if t: - v = t.convert(v, self) + v = t(v).convert(self) self.args[k] = v # Create a new variable frame and set any variables. @@ -223,25 +222,13 @@ def wrapper(*, name=None, replaces=None, **kwargs): class Type: - pass - - -class String(Type): - def convert(self, value, invocation): - if type(value) != "string": - raise ABException("rule wanted a String, but got a " + type(value)) - return value - - -class Strings(Type): - def convert(self, value, invocation): - if type(value) == "string": - value = [value] - return value + def __init__(self, value): + self.value = value class Targets(Type): - def convert(self, value, invocation): + def convert(self, invocation): + value = self.value if type(value) is str: value = [value] if type(value) is list: @@ -250,14 +237,16 @@ def convert(self, value, invocation): class Target(Type): - def convert(self, value, invocation): + def convert(self, invocation): + value = self.value if not value: return None return targetof(value, cwd=invocation.cwd) class TargetsMap(Type): - def convert(self, value, invocation): + def convert(self, invocation): + value = self.value if type(value) is dict: return { targetof(k, cwd=invocation.cwd): targetof(v, cwd=invocation.cwd) @@ -417,10 +406,10 @@ def rule(self, name, ins, outs): def simplerule( self, name, - ins: Targets() = [], + ins: Targets = [], outs=[], - deps: Targets() = [], - commands: Strings() = [], + deps: Targets = [], + commands=[], label="RULE", ): self.ins = ins @@ -441,8 +430,8 @@ def simplerule( def normalrule( self, name=None, - ins: Targets() = [], - deps: Targets() = [], + ins: Targets = [], + deps: Targets = [], outs=[], label="RULE", objdir=None, @@ -461,7 +450,7 @@ def normalrule( @Rule -def export(self, name=None, items: TargetsMap() = {}, deps: Targets() = []): +def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): emitter.rule( self.name, flatten(items.values()), @@ -539,4 +528,3 @@ def main(): main() -# cProfile.run("main()", sort="tottime") diff --git a/build/c.py b/build/c.py index 9eae78f2..6ce13890 100644 --- a/build/c.py +++ b/build/c.py @@ -43,8 +43,8 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): def cfile( self, name, - srcs: Targets() = [], - deps: Targets() = [], + srcs: Targets = [], + deps: Targets = [], suffix=".o", commands=["$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}"], label="CC", @@ -58,8 +58,8 @@ def cfile( def cxxfile( self, name, - srcs: Targets() = [], - deps: Targets() = [], + srcs: Targets = [], + deps: Targets = [], suffix=".o", commands=["$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}"], label="CXX", @@ -87,9 +87,9 @@ def findsources(name, srcs, deps): def clibrary( self, name, - srcs: Targets() = [], - deps: Targets() = [], - hdrs: Targets() = [], + srcs: Targets = [], + deps: Targets = [], + hdrs: Targets = [], commands=["$(AR) cqs {outs[0]} {ins}"], label="AR", ): @@ -132,8 +132,8 @@ def programimpl(self, name, srcs, deps, commands, label, filerule, kind): def cprogram( self, name, - srcs: Targets() = [], - deps: Targets() = [], + srcs: Targets = [], + deps: Targets = [], commands=["$(CC) -o {outs[0]} {ins} {vars.ldflags}"], label="CLINK", ): @@ -144,8 +144,8 @@ def cprogram( def cxxprogram( self, name, - srcs: Targets() = [], - deps: Targets() = [], + srcs: Targets = [], + deps: Targets = [], commands=["$(CXX) -o {outs[0]} {ins} {vars.ldflags}"], label="CXXLINK", ): diff --git a/build/gpp.py b/build/gpp.py index ff95f0b2..4c87b5eb 100644 --- a/build/gpp.py +++ b/build/gpp.py @@ -3,7 +3,7 @@ @Rule -def gpp(self, name, srcs: Targets() = []): +def gpp(self, name, srcs: Targets = []): hdrs = set(["-I" + dirname(f) for f in filenamesof(srcs)]) normalrule( diff --git a/build/nasm.py b/build/nasm.py index 8e38a04c..74174ed1 100644 --- a/build/nasm.py +++ b/build/nasm.py @@ -2,7 +2,7 @@ @Rule -def nasm(self, name, srcs: Targets() = []): +def nasm(self, name, srcs: Targets = []): normalrule( replaces=self, ins=srcs, diff --git a/build/tass64.py b/build/tass64.py index f0a31283..28ae843f 100644 --- a/build/tass64.py +++ b/build/tass64.py @@ -2,7 +2,7 @@ @Rule -def tass64(self, name, srcs: Targets() = []): +def tass64(self, name, srcs: Targets = []): normalrule( replaces=self, ins=srcs, diff --git a/build/yacc.py b/build/yacc.py index e14f09ce..39481c54 100644 --- a/build/yacc.py +++ b/build/yacc.py @@ -2,7 +2,7 @@ @Rule -def yacc(self, name, srcs: Targets() = []): +def yacc(self, name, srcs: Targets = []): normalrule( replaces=self, ins=srcs, @@ -13,7 +13,7 @@ def yacc(self, name, srcs: Targets() = []): @Rule -def flex(self, name, srcs: Targets() = []): +def flex(self, name, srcs: Targets = []): normalrule( replaces=self, ins=srcs, diff --git a/dist/bbct/build.py b/dist/bbct/build.py new file mode 100644 index 00000000..a650bed3 --- /dev/null +++ b/dist/bbct/build.py @@ -0,0 +1,68 @@ +from build.ab2 import export, Rule, Target, normalrule +from tools.build import tocpm, mkdfs + + +@Rule +def bbcify(self, name, src: Target = None): + normalrule( + replaces=self, + ins=[src], + outs=[self.localname + ".txt"], + commands=[ + r"""sed -e 's/include "\(.*\)\.coh"/include "h.\1"/' < {ins} | expand -t4 | tr '\n' '\r' > {outs}""" + ], + label="BBCIFY", + ) + + +bbcify(name="mandelcow", src="examples/mandel.cow") +bbcify(name="cowgolcoh", src="rt/bbct/cowgol.coh") +bbcify(name="commoncoh", src="rt/common.coh") + +mkdfs( + name="ssd", + flags=[ + ["-f", Target("./!boot")], + [ + "-f", + Target("src/cowfe+cowfe-for-16bit-with-bbct"), + "-e0x400", + "-l0x400", + "-ncowfe", + ], + [ + "-f", + Target("src/cowbe+cowbe-for-6502-with-bbct"), + "-e0x400", + "-l0x400", + "-ncowbe", + ], + [ + "-f", + Target("src/cowlink+cowlink-for-bbct-with-bbct"), + "-e0x400", + "-l0x400", + "-ncowlink", + ], + ["-f", Target("rt/bbct+cowgolcoo"), "-no.cowgol"], + ["-f", Target("+cowgolcoh"), "-nh.cowgol"], + ["-f", Target("+commoncoh"), "-nh.common"], + ["-f", Target("+mandelcow"), "-nw.source"], + "-B3", + ], +) + +export( + name="bbct", + items={ + "bin/dist/bbct/!boot": "./!boot", + "bin/dist/bbct/mandel.cow": "+mandelcow", + "bin/dist/bbct/cowgol.coh": "+cowgolcoh", + "bin/dist/bbct/common.coh": "+commoncoh", + "bin/dist/bbct/cowgol.coo": "rt/bbct+cowgolcoo", + "bin/dist/bbct/cowfe.com": "src/cowfe+cowfe-for-16bit-with-bbct", + "bin/dist/bbct/cowbe.com": "src/cowbe+cowbe-for-6502-with-bbct", + "bin/dist/bbct/cowlink.com": "src/cowlink+cowlink-for-bbct-with-bbct", + "bin/dist/bbct.ssd": "+ssd", + }, +) diff --git a/src/build.py b/src/build.py index a9710df7..977e5501 100644 --- a/src/build.py +++ b/src/build.py @@ -18,7 +18,7 @@ @Rule -def cgen(self, name, srcs: Targets() = []): +def cgen(self, name, srcs: Targets = []): cprogram(replaces=self, srcs=srcs + ["rt/cgen/cowgol.h"]) @@ -36,32 +36,32 @@ def buildgasimpl(self, prefix): @Rule -def buildgasarm(self, name, srcs: Targets() = None): +def buildgasarm(self, name, srcs: Targets = None): buildgasimpl(self, "arm-linux-gnueabihf") @Rule -def buildgas386(self, name, srcs: Targets() = None): +def buildgas386(self, name, srcs: Targets = None): buildgasimpl(self, "i686-linux-gnu") @Rule -def buildgas68k(self, name, srcs: Targets() = None): +def buildgas68k(self, name, srcs: Targets = None): buildgasimpl(self, "m68k-linux-gnu") @Rule -def buildgasppc(self, name, srcs: Targets() = None): +def buildgasppc(self, name, srcs: Targets = None): buildgasimpl(self, "powerpc-linux-gnu") @Rule -def buildgasataritos(self, name, srcs: Targets() = None): +def buildgasataritos(self, name, srcs: Targets = None): buildgasimpl(self, "m68k-atari-mint") @Rule -def buildtass64(self, name, srcs: Targets() = None): +def buildtass64(self, name, srcs: Targets = None): tass64(replaces=self, srcs=srcs) @@ -76,17 +76,17 @@ def buildcowasmimpl(self, asm): @Rule -def buildcowasmpdp11(self, name, srcs: Targets() = None): +def buildcowasmpdp11(self, name, srcs: Targets = None): buildcowasmimpl(self, "src/cowasm+cowasm-for-pdp11-with-ncgen") @Rule -def buildcowasm6303(self, name, srcs: Targets() = None): +def buildcowasm6303(self, name, srcs: Targets = None): buildcowasmimpl(self, "src/cowasm+cowasm-for-6303-with-ncgen") @Rule -def buildnasm(self, name, srcs: Targets() = None): +def buildnasm(self, name, srcs: Targets = None): o = nasm(name=name + "/obj", srcs=srcs) djlink(replaces=self, srcs=[o]) @@ -106,57 +106,57 @@ def testimpl(self, dep, command): @Rule -def nativetest(self, name, goodfile: Target() = None, exe: Target() = None): +def nativetest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, [], "{ins[0]}") @Rule -def tubeemutest(self, name, goodfile: Target() = None, exe: Target() = None): +def tubeemutest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, ["tools/tubeemu"], "{ins[0]} -l 0x400 -e 0x400 -f {ins[1]}") @Rule -def cpmtest(self, name, goodfile: Target() = None, exe: Target() = None): +def cpmtest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, ["tools/cpmemu"], "{ins[0]} {ins[1]}") @Rule -def apouttest(self, name, goodfile: Target() = None, exe: Target() = None): +def apouttest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, ["third_party/apout"], "{ins[0]} {ins[1]}") @Rule -def fuzix6303test(self, name, goodfile: Target() = None, exe: Target() = None): +def fuzix6303test(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, ["tools/fuzix6303emu"], "{ins[0]} -f {ins[1]}") @Rule -def ataritostest(self, name, goodfile: Target() = None, exe: Target() = None): +def ataritostest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, ["tools/ataritosemu"], "{ins[0]} {ins[1]}") @Rule -def qemuarmtest(self, name, goodfile: Target() = None, exe: Target() = None): +def qemuarmtest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, [], "qemu-arm {ins[0]}") @Rule -def qemu386test(self, name, goodfile: Target() = None, exe: Target() = None): +def qemu386test(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, [], "qemu-i386 {ins[0]}") @Rule -def qemu68ktest(self, name, goodfile: Target() = None, exe: Target() = None): +def qemu68ktest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, [], "qemu-m68k {ins[0]}") @Rule -def qemuppctest(self, name, goodfile: Target() = None, exe: Target() = None): +def qemuppctest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, [], "qemu-ppc {ins[0]}") @Rule -def msdostest(self, name, goodfile: Target() = None, exe: Target() = None): +def msdostest(self, name, goodfile: Target = None, exe: Target = None): testimpl(self, ["third_party/emu2"], "{ins[0]} {ins[1]}") @@ -164,10 +164,10 @@ def msdostest(self, name, goodfile: Target() = None, exe: Target() = None): def toolchain( self, name, - cowfe: Target() = None, - cowbe: Target() = None, - cowlink: Target() = None, - cowwrap: Target() = None, + cowfe: Target = None, + cowbe: Target = None, + cowlink: Target = None, + cowwrap: Target = None, runtime=None, asmext=None, binext=None, @@ -196,9 +196,9 @@ def toolchain( def cowlib( self, name, - srcs: Targets() = [], - deps: Targets() = [], - toolchain: Target() = None, + srcs: Targets = [], + deps: Targets = [], + toolchain: Target = None, ): srcs += [ "rt/common-file.coh", @@ -237,7 +237,7 @@ def cowlib( @Rule -def cowlink(self, name, deps: Targets() = [], toolchain: Target() = None): +def cowlink(self, name, deps: Targets = [], toolchain: Target = None): coos = [] for d in deps: if hasattr(d, "cowlib"): @@ -258,9 +258,9 @@ def cowlink(self, name, deps: Targets() = [], toolchain: Target() = None): def cowgol( self, name, - srcs: Targets() = [], - deps: Targets() = [], - toolchain: Target() = None, + srcs: Targets = [], + deps: Targets = [], + toolchain: Target = None, ): coo = cowlib(name=name + "/main", srcs=srcs, toolchain=toolchain) @@ -272,9 +272,7 @@ def cowgol( @Rule -def cowwrap( - self, name, src: Target() = None, toolchain: Target() = "src+ncgen" -): +def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): self.cowlib = SimpleNamespace() normalrule( replaces=self, diff --git a/tests/build.py b/tests/build.py index 1bfd7312..a610b48e 100644 --- a/tests/build.py +++ b/tests/build.py @@ -51,7 +51,7 @@ @Rule -def testsuite(self, name, toolchain: Target() = None): +def testsuite(self, name, toolchain: Target = None): tests = [] if toolchain.tester: for test in TESTS: diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py index a41d68b3..cb16c0a4 100644 --- a/third_party/djlink/build.py +++ b/third_party/djlink/build.py @@ -52,7 +52,7 @@ @Rule -def djlink(self, name, srcs: Targets() = []): +def djlink(self, name, srcs: Targets = []): normalrule( replaces=self, ins=["third_party/djlink"] + srcs, diff --git a/third_party/lemon/build.py b/third_party/lemon/build.py index 43bae3f2..ad348e1c 100644 --- a/third_party/lemon/build.py +++ b/third_party/lemon/build.py @@ -13,7 +13,7 @@ @Rule -def lemon(self, name, src: Target() = None): +def lemon(self, name, src: Target = None): normalrule( replaces=self, ins=["third_party/lemon+lemon", "third_party/lemon/lempar.c", src], @@ -24,7 +24,7 @@ def lemon(self, name, src: Target() = None): @Rule -def lemoncowgol(self, name, src: Target() = None): +def lemoncowgol(self, name, src: Target = None): normalrule( replaces=self, ins=["third_party/lemon+lemon-cowgol", "src/cowfe/lempar.coh", src], diff --git a/third_party/musashi/build.py b/third_party/musashi/build.py index cbb01345..ae8db58a 100644 --- a/third_party/musashi/build.py +++ b/third_party/musashi/build.py @@ -13,7 +13,7 @@ @Rule -def musashilib(self, name, m68kconf: Target() = None): +def musashilib(self, name, m68kconf: Target = None): clibrary( replaces=self, srcs=[ diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index a2df8554..911ca726 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -18,7 +18,7 @@ @Rule -def zmac(self, name, srcs: Targets() = []): +def zmac(self, name, srcs: Targets = []): filename, ext = splitext(filenameof(srcs)) archflag = "-z" if (ext == ".z80") else "-8" diff --git a/tools/build.py b/tools/build.py index c69bf232..ed05a9ac 100644 --- a/tools/build.py +++ b/tools/build.py @@ -1,5 +1,5 @@ from build.c import cprogram -from build.ab2 import Rule, Target, normalrule +from build.ab2 import Rule, Target, Targets, normalrule, flatten, filenamesof cprogram( name="mkadfs", @@ -13,7 +13,7 @@ @Rule -def objectify(self, name, src: Target() = None, symbol=None): +def objectify(self, name, src: Target = None, symbol=None): normalrule( replaces=self, ins=["tools/objectify", src], @@ -24,7 +24,7 @@ def objectify(self, name, src: Target() = None, symbol=None): @Rule -def tocpm(self, name, src: Target() = None): +def tocpm(self, name, src: Target = None): normalrule( replaces=self, ins=["tools/tocpm.lua", src], @@ -32,3 +32,23 @@ def tocpm(self, name, src: Target() = None): commands=["lua {ins[0]} < {ins[1]} > {outs}"], label="TOCPM", ) + + +@Rule +def mkdfs(self, name, flags=[]): + srcs = [] + cmdline = ["{ins[0]}", "-O", "{outs}"] + for f in flatten(flags): + if isinstance(f, Target): + srcs += [f.convert(self)] + cmdline += filenamesof(f.convert(self)) + else: + cmdline += [f] + + normalrule( + replaces=self, + ins=["tools+mkdfs"] + srcs, + outs=[self.localname + ".ssd"], + commands=[" ".join(cmdline)], + label="MKDFS", + ) diff --git a/tools/newgen/build.py b/tools/newgen/build.py index f3c5541a..0ef8c248 100644 --- a/tools/newgen/build.py +++ b/tools/newgen/build.py @@ -23,7 +23,7 @@ @Rule -def newgencowgol(self, name, srcs: Targets() = []): +def newgencowgol(self, name, srcs: Targets = []): preprocessed = gpp(name=name + "/preprocessed", srcs=srcs) normalrule( From 9a2b27de0bf64cf8a74f793539294db9e2b1586d Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:48 +0000 Subject: [PATCH 33/69] Clean up the config stuff a bit. --- build.py | 6 ++-- config.py | 11 ++++++++ src/build.py | 78 +++++++++++++++++++++++++++------------------------- 3 files changed, 55 insertions(+), 40 deletions(-) diff --git a/build.py b/build.py index d29da7ed..b0876e46 100644 --- a/build.py +++ b/build.py @@ -27,7 +27,7 @@ "dist/cpmz", "dist/cpm", ] - + (["dist/msdos"] if config.has_nasm else []) - + (["dist/ataritos"] if config.has_gcc68k else []) - + (["dist/bbct"] if config.has_tass64 else []), + + (["dist/msdos"] if config.has_msdos else []) + + (["dist/ataritos"] if config.has_ataritos else []) + + (["dist/bbct"] if config.has_bbct else []), ) diff --git a/config.py b/config.py index c3642d97..3b2f6e10 100644 --- a/config.py +++ b/config.py @@ -16,3 +16,14 @@ def enable_if(command): has_qemu386 = enable_if("qemu-i386") has_qemuppc = enable_if("qemu-ppc") has_qemu68k = enable_if("qemu-m68k") + +has_ataritos = has_gccataritos +has_msdos = has_nasm +has_lx386 = has_gcc386 +has_lxthumb2 = has_gccthumb2 +has_lx68k = has_gcc68k +has_lxppc = has_gccpowerpc +has_bbct = has_tass64 +has_bbctiny = has_tass64 +has_bbct6502 = has_tass64 + diff --git a/src/build.py b/src/build.py index 977e5501..983a0b56 100644 --- a/src/build.py +++ b/src/build.py @@ -344,7 +344,37 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -if config.has_gccthumb2: +TOOLCHAINS.append( + toolchain( + name="unixv7", + cowfe="src/cowfe+cowfe-for-pdp11-with-nncgen", + cowbe="src/cowbe+cowbe-for-pdp11-with-ncgen", + cowlink="src/cowlink+cowlink-for-v7unix-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/unixv7", + asmext=".asm", + binext=".exe", + assembler=buildcowasmpdp11, + tester=apouttest, + ) +) + +TOOLCHAINS.append( + toolchain( + name="fuzix6303", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-6303-with-ncgen", + cowlink="src/cowlink+cowlink-for-fuzix6303-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/fuzix6303", + asmext=".asm", + binext=".exe", + assembler=buildcowasm6303, + tester=fuzix6303test, + ) +) + +if config.has_lxthumb2: TOOLCHAINS.append( toolchain( name="lxthumb2", @@ -360,7 +390,7 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -if config.has_gcc386: +if config.has_lx386: TOOLCHAINS.append( toolchain( name="lx386", @@ -376,7 +406,7 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -if config.has_gcc68k: +if config.has_lx68k: TOOLCHAINS.append( toolchain( name="lx68k", @@ -392,7 +422,7 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -if config.has_gccpowerpc: +if config.has_lxppc: TOOLCHAINS.append( toolchain( name="lxppc", @@ -408,7 +438,7 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -if config.has_tass64: +if config.has_bbct: TOOLCHAINS.append( toolchain( name="bbct", @@ -423,6 +453,8 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): tester=tubeemutest, ) ) + +if config.has_bbctiny: TOOLCHAINS.append( toolchain( name="bbctiny", @@ -437,6 +469,8 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): tester=tubeemutest, ) ) + +if config.has_bbct6502: TOOLCHAINS.append( toolchain( name="bbct6502", @@ -452,37 +486,7 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -TOOLCHAINS.append( - toolchain( - name="unixv7", - cowfe="src/cowfe+cowfe-for-pdp11-with-nncgen", - cowbe="src/cowbe+cowbe-for-pdp11-with-ncgen", - cowlink="src/cowlink+cowlink-for-v7unix-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/unixv7", - asmext=".asm", - binext=".exe", - assembler=buildcowasmpdp11, - tester=apouttest, - ) -) - -TOOLCHAINS.append( - toolchain( - name="fuzix6303", - cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", - cowbe="src/cowbe+cowbe-for-6303-with-ncgen", - cowlink="src/cowlink+cowlink-for-fuzix6303-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/fuzix6303", - asmext=".asm", - binext=".exe", - assembler=buildcowasm6303, - tester=fuzix6303test, - ) -) - -if config.has_nasm: +if config.has_msdos: TOOLCHAINS.append( toolchain( name="msdos", @@ -498,7 +502,7 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) ) -if config.has_gccataritos: +if config.has_ataritos: TOOLCHAINS.append( toolchain( name="ataritos", From 685d1ec0c06ce3c0a0217cdc9c642faca249a1f3 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:48 +0000 Subject: [PATCH 34/69] Generate ninjafiles instead of makefiles. --- Makefile | 17 ++++++++++-- build/ab2.py | 76 +++++++++++++++++++++++++++++++++++----------------- config.py | 1 - 3 files changed, 66 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index eb90513d..9d442d1b 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,18 @@ export OBJ = .obj export LUA = lua +export CC = gcc +export CXX = g++ +export AR = ar export CFLAGS = -g -O0 export LDFLAGS = -g export NINJAFLAGS = -all: $(OBJ)/build.mk - @+make -f $(OBJ)/build.mk +all +#all: $(OBJ)/build.mk +# @+make -f $(OBJ)/build.mk +all +all: $(OBJ)/build.ninja + @ninja -f $< +all + clean: @echo CLEAN @rm -rf $(OBJ) bin @@ -17,6 +23,13 @@ $(OBJ)/build.mk: Makefile $(build-files) @mkdir -p $(OBJ) @python3 -X pycache_prefix=$(OBJ) build/ab2.py -m make -t +all -o $@ build.py +$(OBJ)/build.ninja: Makefile $(build-files) + @echo ACKBUILDER + @mkdir -p $(OBJ) + @python3 -X pycache_prefix=$(OBJ) build/ab2.py -m ninja -t +all -o $@ \ + -v OBJ,CC,CXX,AR \ + build.py + .DELETE_ON_ERROR: .SECONDARY: diff --git a/build/ab2.py b/build/ab2.py index 45b25e12..ab164ee4 100644 --- a/build/ab2.py +++ b/build/ab2.py @@ -13,6 +13,7 @@ import types import pathlib import builtins +import os defaultGlobals = {} targets = {} @@ -340,10 +341,6 @@ def emit(*args): outputFp.write("\n") -def unmake(ss): - return ss - - def templateexpand(s, invocation): class Converter: def __getitem__(self, key): @@ -368,38 +365,56 @@ def end(self): def var(self, name, value): # Don't let emit insert spaces. - emit(name + "=" + unmake(value)) + emit(name + "=" + value) def rule(self, name, ins, outs, deps=[]): ins = filenamesof(ins) if outs: outs = filenamesof(outs) emit(".PHONY:", name) - emit(name, ":", unmake(outs), unmake(deps)) - emit(outs, "&:", unmake(ins), unmake(deps)) + emit(name, ":", outs, deps) + emit(outs, "&:", ins, deps) else: - emit(name, ":", unmake(ins), unmake(deps)) + emit(name, ":", ins, deps) + + def label(self, s): + emit("\t$(hide)echo", s) + + def exec(self, cs): + for c in cs: + emit("\t$(hide)", c) - def exec(self, command): - emit("\t$(hide)", unmake(command)) + +def unmake(*ss): + return [ + re.sub(r"\$\(([^)]*)\)", r"$\1", s) for s in flatten(filenamesof(ss)) + ] class NinjaEmitter: def begin(self): - emit("rule build\n") - emit(" command = $command\n") - emit("\n") + emit("rule build") + emit(" command = $command") + + def end(self): + pass def var(self, name, value): # Don't let emit insert spaces. - emit(name + "=" + unmake(value)) + emit(name + "=" + unmake(value)[0]) - def rule(self, name, ins, outs): + def rule(self, name, ins, outs, deps=[]): if outs: - emit("build", name, ": phony", unmake(outs)) + emit("build", name, ": phony", unmake(outs, deps)) emit("build", unmake(outs), ": build", unmake(ins)) else: - emit("build", name, ": phony", unmake(ins)) + emit("build", name, ": phony", unmake(ins, deps)) + + def label(self, s): + emit(" description=", s) + + def exec(self, cs): + emit(" command=", " && ".join(unmake(cs))) @Rule @@ -415,15 +430,17 @@ def simplerule( self.ins = ins self.outs = outs emitter.rule(self.name, filenamesof(ins, deps), outs) - emitter.exec(templateexpand("echo {label} {name}", self)) + emitter.label(templateexpand("{label} {name}", self)) + cs = [] for out in filenamesof(outs): dir = dirname(out) if dir: - emitter.exec("mkdir -p " + dir) + cs += ["mkdir -p " + dir] for c in commands: - emitter.exec(templateexpand(c, self)) + cs += [templateexpand(c, self)] + emitter.exec(cs) @Rule @@ -457,15 +474,16 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): filenamesof(items.keys()), filenamesof(deps), ) - emitter.exec(f"echo EXPORT {self.name}") + emitter.label(f"EXPORT {self.name}") + cs = [] self.ins = items.values() self.outs = filenamesof(deps) for dest, src in items.items(): destf = filenameof(dest) dir = dirname(destf) if dir: - emitter.exec("mkdir -p " + dir) + cs += ["mkdir -p " + dir] srcs = filenamesof(src) if len(srcs) != 1: @@ -473,9 +491,11 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): "a dependency of an export must have exactly one output file" ) - emitter.exec("cp %s %s" % (srcs[0], destf)) + cs += ["cp %s %s" % (srcs[0], destf)] self.outs += [destf] + emitter.exec(cs) + def loadbuildfile(filename): filename = filename.replace("/", ".").removesuffix(".py") @@ -496,7 +516,8 @@ def main(): ) parser.add_argument("-o", "--output") parser.add_argument("files", nargs="+") - parser.add_argument("-t", "--targets", nargs="+") + parser.add_argument("-t", "--targets", action="append") + parser.add_argument("-v", "--vars", action="append") args = parser.parse_args() global outputFp @@ -509,6 +530,11 @@ def main(): emitter = NinjaEmitter() emitter.begin() + for v in flatten([a.split(",") for a in args.vars]): + e = os.getenv(v) + if e: + emitter.var(v, e) + global currentVars currentVars = Vars() @@ -522,7 +548,7 @@ def main(): for f in args.files: loadbuildfile(f) - for t in args.targets: + for t in flatten([a.split(",") for a in args.targets]): targets[t].materialise() emitter.end() diff --git a/config.py b/config.py index 3b2f6e10..e3ed5441 100644 --- a/config.py +++ b/config.py @@ -26,4 +26,3 @@ def enable_if(command): has_bbct = has_tass64 has_bbctiny = has_tass64 has_bbct6502 = has_tass64 - From e6e62c79b106090a7aa6c57bacc72240a2926705 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:49 +0000 Subject: [PATCH 35/69] Remove the obsolete lua files. --- bootstrap/build.lua | 20 -- build/c.lua | 138 ------------- build/gpp.lua | 20 -- build/tass64.lua | 20 -- build/utils.lua | 9 - build/yacc.lua | 16 -- dist/ataritos/build.lua | 37 ---- dist/bbct/build.lua | 43 ----- dist/cpm/build.lua | 64 ------ dist/cpmbasic/build.lua | 54 ------ dist/cpmbasic/tocpm.lua | 5 - dist/cpmz/build.lua | 59 ------ dist/msdos/build.lua | 42 ---- examples/build.lua | 20 -- mkninja.lua | 184 ------------------ rt/ataritos/build.lua | 6 - rt/bbct/build.lua | 5 - rt/bbcti/build.lua | 5 - rt/cgen/build.lua | 5 - rt/cpm/build.lua | 5 - rt/cpmz/build.lua | 5 - rt/fuzix6303/build.lua | 5 - rt/lx386/build.lua | 5 - rt/lx68k/build.lua | 5 - rt/lxppc/build.lua | 5 - rt/lxthumb2/build.lua | 5 - rt/msdos/build.lua | 5 - rt/unixv7/build.lua | 5 - src/build.lua | 331 -------------------------------- src/cowasm/build.lua | 16 -- src/cowasm2/build.lua | 30 --- src/cowbdmp/build.lua | 16 -- src/cowbe/build.lua | 61 ------ src/cowdis/build.lua | 14 -- src/cowfe/build.lua | 56 ------ src/cowlink/build.lua | 46 ----- src/cowwrap/build.lua | 13 -- src/misc/build.lua | 11 -- tests/build.lua | 72 ------- third_party/apout/build.lua | 25 --- third_party/djlink/build.lua | 54 ------ third_party/emu2/build.lua | 19 -- third_party/lemon/build.lua | 41 ---- third_party/musashi/build.lua | 40 ---- third_party/rc2014emu/build.lua | 0 third_party/zmac/build.lua | 44 ----- toolchains.lua | 202 ------------------- tools/ataritosemu/build.lua | 17 -- tools/build.lua | 39 ---- tools/cpmemu/build.lua | 24 --- tools/fuzix6303emu/build.lua | 15 -- tools/lx68kemu/build.lua | 16 -- tools/newgen/build.lua | 48 ----- tools/obpemu/build.lua | 12 -- tools/tubeemu/build.lua | 11 -- 55 files changed, 2070 deletions(-) delete mode 100644 bootstrap/build.lua delete mode 100644 build/c.lua delete mode 100644 build/gpp.lua delete mode 100644 build/tass64.lua delete mode 100644 build/utils.lua delete mode 100644 build/yacc.lua delete mode 100644 dist/ataritos/build.lua delete mode 100644 dist/bbct/build.lua delete mode 100644 dist/cpm/build.lua delete mode 100644 dist/cpmbasic/build.lua delete mode 100644 dist/cpmbasic/tocpm.lua delete mode 100644 dist/cpmz/build.lua delete mode 100644 dist/msdos/build.lua delete mode 100644 examples/build.lua delete mode 100644 mkninja.lua delete mode 100644 rt/ataritos/build.lua delete mode 100644 rt/bbct/build.lua delete mode 100644 rt/bbcti/build.lua delete mode 100644 rt/cgen/build.lua delete mode 100644 rt/cpm/build.lua delete mode 100644 rt/cpmz/build.lua delete mode 100644 rt/fuzix6303/build.lua delete mode 100644 rt/lx386/build.lua delete mode 100644 rt/lx68k/build.lua delete mode 100644 rt/lxppc/build.lua delete mode 100644 rt/lxthumb2/build.lua delete mode 100644 rt/msdos/build.lua delete mode 100644 rt/unixv7/build.lua delete mode 100644 src/build.lua delete mode 100644 src/cowasm/build.lua delete mode 100644 src/cowasm2/build.lua delete mode 100644 src/cowbdmp/build.lua delete mode 100644 src/cowbe/build.lua delete mode 100644 src/cowdis/build.lua delete mode 100644 src/cowfe/build.lua delete mode 100644 src/cowlink/build.lua delete mode 100644 src/cowwrap/build.lua delete mode 100644 src/misc/build.lua delete mode 100644 tests/build.lua delete mode 100644 third_party/apout/build.lua delete mode 100644 third_party/djlink/build.lua delete mode 100644 third_party/emu2/build.lua delete mode 100644 third_party/lemon/build.lua delete mode 100644 third_party/musashi/build.lua delete mode 100644 third_party/rc2014emu/build.lua delete mode 100644 third_party/zmac/build.lua delete mode 100644 toolchains.lua delete mode 100644 tools/ataritosemu/build.lua delete mode 100644 tools/build.lua delete mode 100644 tools/cpmemu/build.lua delete mode 100644 tools/fuzix6303emu/build.lua delete mode 100644 tools/lx68kemu/build.lua delete mode 100644 tools/newgen/build.lua delete mode 100644 tools/obpemu/build.lua delete mode 100644 tools/tubeemu/build.lua diff --git a/bootstrap/build.lua b/bootstrap/build.lua deleted file mode 100644 index 76a60550..00000000 --- a/bootstrap/build.lua +++ /dev/null @@ -1,20 +0,0 @@ -buildcgen { - ins = { "bootstrap/cowfe-cgen.bootstrap.c" }, - outs = { "bin/cowfe-cgen.bootstrap.exe" } -} - -buildcgen { - ins = { "bootstrap/cowbe-cgen.bootstrap.c" }, - outs = { "bin/cowbe-cgen.bootstrap.exe" } -} - -buildcgen { - ins = { "bootstrap/cowlink-cgen.bootstrap.c" }, - outs = { "bin/cowlink-cgen.bootstrap.exe" } -} - -buildcgen { - ins = { "bootstrap/cowwrap.bootstrap.c" }, - outs = { "bin/cowwrap.bootstrap.exe" } -} - diff --git a/build/c.lua b/build/c.lua deleted file mode 100644 index 77d63569..00000000 --- a/build/c.lua +++ /dev/null @@ -1,138 +0,0 @@ -function cfile(e) - local hdrs = {} - for _, src in ipairs(e.ins) do - local f = src:gsub("[^/]*$", "") - if f == "" then - f = "." - end - hdrs[#hdrs+1] = "-I"..f - end - - local cflags = e.cflags or "" - rule { - ins = e.ins, - outs = e.outs, - cmd = "$CC $CFLAGS "..cflags.." "..joined(hdrs).." -c -o &1 @1" - } -end - -function cprogram(e) - local objdir = e.objdir or "$OBJ" - local objs = {} - local hdrs = {} - local libs = {} - for _, src in ipairs(e.ins) do - if src:find("%.h$") then - hdrs[#hdrs+1] = src - end - end - - for _, src in ipairs(e.ins) do - if src:find("%.a$") then - libs[#libs+1] = src - elseif not src:find("%.h$") then - local o = objdir.."/"..src:gsub("%.c$", ".o"):gsub("%.cpp$", ".o") - objs[#objs+1] = o - cfile { - ins = concat { - src, - hdrs - }, - outs = { o }, - cflags = e.cflags, - } - end - end - - local ldflags = e.ldflags or "" - rule { - ins = concat { objs, libs }, - outs = e.outs, - cmd = "$CC -o &1 @@ "..joined(libs).." $LDFLAGS "..ldflags - } -end - -function clibrary(e) - local objdir = e.objdir or "$OBJ" - local objs = {} - local hdrs = {} - for _, src in ipairs(e.ins) do - if src:find("%.h$") then - hdrs[#hdrs+1] = src - end - end - - for _, src in ipairs(e.ins) do - if not src:find("%.h$") then - local o = objdir.."/"..src:gsub("%.c$", ".o"):gsub("%.cpp$", ".o") - objs[#objs+1] = o - cfile { - ins = concat { - src, - hdrs - }, - outs = { o }, - cflags = e.cflags, - } - end - end - - rule { - ins = objs, - outs = e.outs, - cmd = "rm -f &1 && $AR qcs &1 @@" - } -end - -function cxxfile(e) - local hdrs = {} - for _, src in ipairs(e.ins) do - local f = src:gsub("[^/]*$", "") - if f == "" then - f = "." - end - hdrs[#hdrs+1] = "-I"..f - end - - local cxxflags = e.cxxflags or "" - rule { - ins = e.ins, - outs = e.outs, - cmd = "$CXX $CXXFLAGS "..cxxflags.." "..joined(hdrs).." -c -o &1 @1" - } -end - -function cxxprogram(e) - local objdir = e.objdir or "$OBJ" - local objs = {} - local hdrs = {} - for _, src in ipairs(e.ins) do - if src:find("%.h$") then - hdrs[#hdrs+1] = src - end - end - - for _, src in ipairs(e.ins) do - if not src:find("%.h$") then - local o = objdir.."/"..src:gsub("%.cc$", ".o"):gsub("%.cpp$", ".o") - objs[#objs+1] = o - cxxfile { - ins = concat { - src, - hdrs - }, - outs = { o }, - cxxflags = e.cxxflags, - } - end - end - - local ldflags = e.ldflags or "" - rule { - ins = objs, - outs = e.outs, - cmd = "$CXX -o &1 @@ $LDFLAGS "..ldflags - } -end - - diff --git a/build/gpp.lua b/build/gpp.lua deleted file mode 100644 index e74ca2f3..00000000 --- a/build/gpp.lua +++ /dev/null @@ -1,20 +0,0 @@ -function gpp(e) - local hdrs = {} - for _, src in ipairs(e.ins) do - local f = src:gsub("[^/]*$", "") - if f == "" then - f = "." - end - hdrs[#hdrs+1] = "-I"..f - end - - local cflags = e.cflags or "" - rule { - ins = e.ins, - outs = e.outs, - cmd = "gpp --nostdinc -U '' '' '(' ',' ')' '(' ')' '$$' '' -M '$$' '\\n' ' ' ' ' '\\n' '(' ')' ".. - cflags.." "..joined(hdrs).." -o &1 @1" - } -end - - diff --git a/build/tass64.lua b/build/tass64.lua deleted file mode 100644 index 4a18f328..00000000 --- a/build/tass64.lua +++ /dev/null @@ -1,20 +0,0 @@ -function tass64(e) - local hdrs = {} - for _, src in ipairs(e.ins) do - local f = src:gsub("[^/]*$", "") - if f == "" then - f = "." - end - hdrs[#hdrs+1] = "-I"..f - end - - local cflags = e.cflags or "" - rule { - ins = e.ins, - outs = e.outs, - cmd = "64tass --quiet --long-branch --ascii --case-sensitive --nostart -o &1 @1" - } -end - - - diff --git a/build/utils.lua b/build/utils.lua deleted file mode 100644 index 7667f059..00000000 --- a/build/utils.lua +++ /dev/null @@ -1,9 +0,0 @@ -function copy(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = "cp @1 &1" - } -end - - diff --git a/build/yacc.lua b/build/yacc.lua deleted file mode 100644 index d1e18f38..00000000 --- a/build/yacc.lua +++ /dev/null @@ -1,16 +0,0 @@ -function yacc(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = "bison -y -t -o &1 --defines=&2 @1" - } -end - -function flex(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = "flex -8 -Cem -s -t @1 > &1" - } -end - diff --git a/dist/ataritos/build.lua b/dist/ataritos/build.lua deleted file mode 100644 index 81ed918d..00000000 --- a/dist/ataritos/build.lua +++ /dev/null @@ -1,37 +0,0 @@ -if WITH_ATARITOS then - copy { - ins = { "examples/mandel.cow" }, - outs = { "$OBJ/dist/ataritos/mandel.cow" }, - } - - copy { - ins = { "rt/ataritos/cowgol.coh" }, - outs = { "$OBJ/dist/ataritos/cowgol.coh" }, - } - - copy { - ins = { "rt/common.coh" }, - outs = { "$OBJ/dist/ataritos/common.coh" }, - } - - copy { - ins = { "$OBJ/rt/ataritos/cowgol.coo" }, - outs = { "$OBJ/dist/ataritos/cowgol.coo" } - } - - copy { - ins = { "bin/cowfe-32bita2.ataritos.ataritos.tos" }, - outs = { "$OBJ/dist/ataritos/cowfe.tos" } - } - - copy { - ins = { "bin/cowbe-68000.ataritos.ataritos.tos" }, - outs = { "$OBJ/dist/ataritos/cowbe.tos" } - } - - copy { - ins = { "bin/cowlink-ataritos.ataritos.ataritos.tos" }, - outs = { "$OBJ/dist/ataritos/cowlink.tos" } - } -end - diff --git a/dist/bbct/build.lua b/dist/bbct/build.lua deleted file mode 100644 index f7b5cb5c..00000000 --- a/dist/bbct/build.lua +++ /dev/null @@ -1,43 +0,0 @@ -function bbcify(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = [[sed -e 's/include "\(.*\)\.coh"/include "h.\1"/' < @1 | expand -t4 | tr '\n' '\r' > &1]] - } -end - -bbcify { - ins = { "examples/mandel.cow" }, - outs = { "$OBJ/dist/bbct/mandel.cow" }, -} - -bbcify { - ins = { "rt/bbct/cowgol.coh" }, - outs = { "$OBJ/dist/bbct/cowgol.coh" }, -} - -bbcify { - ins = { "rt/common.coh" }, - outs = { "$OBJ/dist/bbct/common.coh" }, -} - -mkdfs { - ins = { - "-f", "dist/bbct/!boot", - "-f", "bin/cowfe-6502.bbct.bbct", "-e0x400", "-l0x400", "-ncowfe", - "-f", "bin/cowbe-65c02.bbct.bbct", "-e0x400", "-l0x400", "-ncowbe", - "-f", "bin/cowlink-bbctn.bbct.bbct", "-e0x400", "-l0x400", "-ncowlink", - "-f", "$OBJ/rt/bbct/cowgol.coo", "-no.cowgol", - "-f", "$OBJ/dist/bbct/cowgol.coh", "-nh.cowgol", - "-f", "$OBJ/dist/bbct/common.coh", "-nh.common", - "-f", "$OBJ/dist/bbct/mandel.cow", "-nw.source", - "-B3" - }, - outs = { "bbct.ssd" } -} - -mkdfs { - ins = {}, - outs = { "bbctwork.ssd" } -} - diff --git a/dist/cpm/build.lua b/dist/cpm/build.lua deleted file mode 100644 index e8cc8c79..00000000 --- a/dist/cpm/build.lua +++ /dev/null @@ -1,64 +0,0 @@ -function cpmify(e) - rule { - ins = concat { - "dist/cpm/tocpm.lua", - e.ins, - }, - outs = e.outs, - cmd = "$LUA @1 < @2 > &1", - } -end - -function copy(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = "cp @1 &1" - } -end - -cpmify { - ins = { "examples/mandel.cow" }, - outs = { "$OBJ/dist/cpm/mandel.cow" }, -} - -cpmify { - ins = { "rt/cpm/cowgol.coh" }, - outs = { "$OBJ/dist/cpm/cowgol.coh" }, -} - -cpmify { - ins = { "rt/common.coh" }, - outs = { "$OBJ/dist/cpm/common.coh" }, -} - -cpmify { - ins = { "dist/cpm/demo.sub" }, - outs = { "$OBJ/dist/cpm/demo.sub" }, -} - -copy { - ins = { "$OBJ/rt/cpm/cowgol.coo" }, - outs = { "$OBJ/dist/cpm/cowgol.coo" } -} - -copy { - ins = { "bin/cowfe-16bit.ncpm.8080.com" }, - outs = { "$OBJ/dist/cpm/cowfe.com" } -} - -copy { - ins = { "bin/cowbe-8080.ncpm.8080.com" }, - outs = { "$OBJ/dist/cpm/cowbe.com" } -} - -copy { - ins = { "bin/cowlink-8080.ncpm.8080.com" }, - outs = { "$OBJ/dist/cpm/cowlink.com" } -} - -copy { - ins = { "bin/cowasm-8080.ncpm.8080.com" }, - outs = { "$OBJ/dist/cpm/cowasm.com" } -} - diff --git a/dist/cpmbasic/build.lua b/dist/cpmbasic/build.lua deleted file mode 100644 index 301b8d21..00000000 --- a/dist/cpmbasic/build.lua +++ /dev/null @@ -1,54 +0,0 @@ -function cpmify(e) - rule { - ins = concat { - "dist/cpmbasic/tocpm.lua", - e.ins, - }, - outs = e.outs, - cmd = "$LUA @1 < @2 > &1", - } -end - -function copy(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = "cp @1 &1" - } -end - -cpmify { - ins = { "dist/cpmbasic/demo.sub" }, - outs = { "$OBJ/dist/cpmbasic/demo.sub" }, -} - -cpmify { - ins = { "examples/music.dat" }, - outs = { "$OBJ/dist/cpmbasic/music.dat" }, -} - -cpmify { - ins = { "examples/crisps.cow" }, - outs = { "$OBJ/dist/cpmbasic/crisps.cow" }, -} - -copy { - ins = { "bin/cowfe-basic.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmbasic/cowfe.com" } -} - -copy { - ins = { "bin/cowbe-basic.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmbasic/cowbe.com" } -} - -copy { - ins = { "bin/cowlink-basic.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmbasic/cowlink.com" } -} - -copy { - ins = { "bin/basicify.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmbasic/basicify.com" } -} - diff --git a/dist/cpmbasic/tocpm.lua b/dist/cpmbasic/tocpm.lua deleted file mode 100644 index 1176c6f2..00000000 --- a/dist/cpmbasic/tocpm.lua +++ /dev/null @@ -1,5 +0,0 @@ -for l in io.stdin:lines() do - io.write(l, "\r\n") -end -io.write(string.char(26)) - diff --git a/dist/cpmz/build.lua b/dist/cpmz/build.lua deleted file mode 100644 index 48bdf0e8..00000000 --- a/dist/cpmz/build.lua +++ /dev/null @@ -1,59 +0,0 @@ -function cpmify(e) - rule { - ins = concat { - "dist/cpmz/tocpm.lua", - e.ins, - }, - outs = e.outs, - cmd = "$LUA @1 < @2 > &1", - } -end - -function copy(e) - rule { - ins = e.ins, - outs = e.outs, - cmd = "cp @1 &1" - } -end - -cpmify { - ins = { "examples/mandel.cow" }, - outs = { "$OBJ/dist/cpmz/mandel.cow" }, -} - -cpmify { - ins = { "rt/cpmz/cowgol.coh" }, - outs = { "$OBJ/dist/cpmz/cowgol.coh" }, -} - -cpmify { - ins = { "rt/common.coh" }, - outs = { "$OBJ/dist/cpmz/common.coh" }, -} - -cpmify { - ins = { "dist/cpmz/demo.sub" }, - outs = { "$OBJ/dist/cpmz/demo.sub" }, -} - -copy { - ins = { "$OBJ/rt/cpmz/cowgol.coo" }, - outs = { "$OBJ/dist/cpmz/cowgol.coo" } -} - -copy { - ins = { "bin/cowfe-16bit.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmz/cowfe.com" } -} - -copy { - ins = { "bin/cowbe-z80.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmz/cowbe.com" } -} - -copy { - ins = { "bin/cowlink-8080.ncpmz.z80.com" }, - outs = { "$OBJ/dist/cpmz/cowlink.com" } -} - diff --git a/dist/msdos/build.lua b/dist/msdos/build.lua deleted file mode 100644 index ba48d407..00000000 --- a/dist/msdos/build.lua +++ /dev/null @@ -1,42 +0,0 @@ -if WITH_MSDOS then - copy { - ins = { "examples/mandel.cow" }, - outs = { "$OBJ/dist/msdos/mandel.cow" }, - } - - cpmify { - ins = { "rt/msdos/cowgol.coh" }, - outs = { "$OBJ/dist/msdos/cowgol.coh" }, - } - - cpmify { - ins = { "rt/common.coh" }, - outs = { "$OBJ/dist/msdos/common.coh" }, - } - - cpmify { - ins = { "dist/msdos/demo.bat" }, - outs = { "$OBJ/dist/msdos/demo.bat" }, - } - - copy { - ins = { "$OBJ/rt/msdos/cowgol.coo" }, - outs = { "$OBJ/dist/msdos/cowgol.coo" } - } - - copy { - ins = { "bin/cowfe-16bit.msdos.msdos.exe" }, - outs = { "$OBJ/dist/msdos/cowfe.exe" } - } - - copy { - ins = { "bin/cowbe-8086.msdos.msdos.exe" }, - outs = { "$OBJ/dist/msdos/cowbe.exe" } - } - - copy { - ins = { "bin/cowlink-msdos.msdos.msdos.exe" }, - outs = { "$OBJ/dist/msdos/cowlink.exe" } - } -end - diff --git a/examples/build.lua b/examples/build.lua deleted file mode 100644 index 76d48d91..00000000 --- a/examples/build.lua +++ /dev/null @@ -1,20 +0,0 @@ -local PROGRAMS = { - "argv", - "file", - "filetester", - "helloworld", - "icando", - "mandel", -} - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - for _, prog in ipairs(PROGRAMS) do - cowgol { - toolchain = toolchain, - ins = { - "examples/"..prog..".cow" - }, - outs = { "bin/examples/"..prog } - } - end -end diff --git a/mkninja.lua b/mkninja.lua deleted file mode 100644 index b61a1b06..00000000 --- a/mkninja.lua +++ /dev/null @@ -1,184 +0,0 @@ -local function env(var, default) - return os.getenv(var) or default -end - -print("OBJ = "..env("OBJ", ".obj")) -print("LUA = "..env("LUA", "lua5.1")) -print("CC = "..env("CC", "cc")) -print("CXX = "..env("CC", "c++")) -print("CPP = "..env("CC", "cpp")) -print("AR = "..env("AR", "ar")) -print("CFLAGS = "..env("CFLAGS", "")) -print("CXXFLAGS = "..env("CXXFLAGS", "$CFLAGS")) -print("LDFLAGS = "..env("LDFLAGS", "")) -print("rule build"); -print(" command = $command"); -print("") - -function include(filename) - io.stderr:write("loading ", filename, "\n") - local fp, e = io.open(filename) - if not e then - local data - data, e = fp:read("*a") - fp:close(); - if not e then - local chunk - chunk, e = loadstring(data, "@"..filename) - if not e then - chunk() - end - end - end - if e then - error(string.format("coudn't load %s: %s", filename, e)) - end -end - -function string:obj() - if not self:find("^%$") then - return "$OBJ/"..self - end - return self -end - -function string:ext(newext) - return self:gsub("%.[^.]*$", newext) -end - -function string:dir() - return self:gsub("[^/]*$", "") -end - -function string:leaf() - return self:gsub("^.*/", "") -end - -function concat(...) - local result = {} - - local function recurse(t) - for _, i in ipairs(t) do - if type(i) == "table" then - recurse(i) - else - result[#result+1] = i - end - end - end - recurse({...}) - return result -end - -function joined(t) - local m = {} - for _, i in ipairs(t) do - m[i] = true - end - t = {} - for i in pairs(m) do - t[#t+1] = i - end - table.sort(t) - return table.concat(t, " ") -end - -function set(t) - local s = {} - for _, k in ipairs(t) do - s[k] = true - end - return s -end - -function command_present(name) - return os.execute("command -v "..name.." >/dev/null") ~= false -end - - -function rule(e) - print(string.format("build %s: build %s", - table.concat(e.outs, " "), - table.concat(e.ins, " "))) - local cmd = e.cmd - :gsub("@(%d+)", function (n) return e.ins[tonumber(n)] end) - :gsub("@@", table.concat(e.ins, " ")) - :gsub("&(%d+)", function (n) return e.outs[tonumber(n)] end) - - print(" command = "..cmd) - print("") -end - -function addto(t, v) - t[#t+1] = v -end - -function enable_if(name, command) - local v = command_present(command) - if not v then - io.stderr:write(name.." is 0 as "..command.." is not present\n") - end - _G[name] = v -end - -enable_if("WITH_ATARITOS", "m68k-atari-mint-as") -enable_if("WITH_MSDOS", "nasm") -enable_if("WITH_LX386", "i686-linux-gnu-as") -enable_if("WITH_LX68K", "m68k-linux-gnu-as") -enable_if("WITH_LXTHUMB2", "arm-linux-gnueabihf-as") -enable_if("WITH_LXPPC", "powerpc-linux-gnu-as") - -include "build/c.lua" -include "build/yacc.lua" -include "build/gpp.lua" -include "build/tass64.lua" -include "build/utils.lua" -include "tools/build.lua" -include "third_party/emu2/build.lua" -include "third_party/apout/build.lua" -include "third_party/zmac/build.lua" -include "third_party/djlink/build.lua" -include "third_party/musashi/build.lua" -include "tools/cpmemu/build.lua" -include "tools/tubeemu/build.lua" -include "tools/fuzix6303emu/build.lua" -include "tools/lx68kemu/build.lua" -include "tools/ataritosemu/build.lua" -include "tools/obpemu/build.lua" -include "third_party/lemon/build.lua" -include "tools/newgen/build.lua" -include "src/build.lua" -include "bootstrap/build.lua" -include "toolchains.lua" -include "src/cowlink/build.lua" -include "src/cowfe/build.lua" -include "src/cowbe/build.lua" -include "src/cowwrap/build.lua" -include "src/cowbdmp/build.lua" -include "src/cowasm/build.lua" -include "src/cowasm2/build.lua" -include "src/cowdis/build.lua" -include "src/misc/build.lua" -include "rt/ataritos/build.lua" -include "rt/cpm/build.lua" -include "rt/cpmz/build.lua" -include "rt/cgen/build.lua" -include "rt/lx386/build.lua" -include "rt/lx68k/build.lua" -include "rt/lxthumb2/build.lua" -include "rt/lxppc/build.lua" -include "rt/bbct/build.lua" -include "rt/bbcti/build.lua" -include "rt/unixv7/build.lua" -include "rt/fuzix6303/build.lua" -include "rt/msdos/build.lua" -include "examples/build.lua" -include "tests/build.lua" -include "dist/bbct/build.lua" -include "dist/cpm/build.lua" -include "dist/cpmz/build.lua" -include "dist/cpmbasic/build.lua" -include "dist/msdos/build.lua" -include "dist/ataritos/build.lua" - - diff --git a/rt/ataritos/build.lua b/rt/ataritos/build.lua deleted file mode 100644 index 7bcc6414..00000000 --- a/rt/ataritos/build.lua +++ /dev/null @@ -1,6 +0,0 @@ -cowwrap { - ins = { "rt/common-68000/cowgol.cos" }, - outs = { "$OBJ/rt/ataritos/cowgol.coo" } -} - - diff --git a/rt/bbct/build.lua b/rt/bbct/build.lua deleted file mode 100644 index 90a8a6bc..00000000 --- a/rt/bbct/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/bbct/cowgol.cos" }, - outs = { "$OBJ/rt/bbct/cowgol.coo" } -} - diff --git a/rt/bbcti/build.lua b/rt/bbcti/build.lua deleted file mode 100644 index a391a768..00000000 --- a/rt/bbcti/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/bbcti/cowgol.cos" }, - outs = { "$OBJ/rt/bbcti/cowgol.coo" } -} - diff --git a/rt/cgen/build.lua b/rt/cgen/build.lua deleted file mode 100644 index 192c139a..00000000 --- a/rt/cgen/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/cgen/cowgol.cos" }, - outs = { "$OBJ/rt/cgen/cowgol.coo" } -} - diff --git a/rt/cpm/build.lua b/rt/cpm/build.lua deleted file mode 100644 index c7fdffe0..00000000 --- a/rt/cpm/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/cpm/cowgol.cos" }, - outs = { "$OBJ/rt/cpm/cowgol.coo" } -} - diff --git a/rt/cpmz/build.lua b/rt/cpmz/build.lua deleted file mode 100644 index be847a05..00000000 --- a/rt/cpmz/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/cpmz/cowgol.cos" }, - outs = { "$OBJ/rt/cpmz/cowgol.coo" } -} - diff --git a/rt/fuzix6303/build.lua b/rt/fuzix6303/build.lua deleted file mode 100644 index b6b4fdfd..00000000 --- a/rt/fuzix6303/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/fuzix6303/cowgol.cos" }, - outs = { "$OBJ/rt/fuzix6303/cowgol.coo" } -} - diff --git a/rt/lx386/build.lua b/rt/lx386/build.lua deleted file mode 100644 index 2d7c0dd2..00000000 --- a/rt/lx386/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/lx386/cowgol.cos" }, - outs = { "$OBJ/rt/lx386/cowgol.coo" } -} - diff --git a/rt/lx68k/build.lua b/rt/lx68k/build.lua deleted file mode 100644 index c8ba38a5..00000000 --- a/rt/lx68k/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/common-68000/cowgol.cos" }, - outs = { "$OBJ/rt/lx68k/cowgol.coo" } -} - diff --git a/rt/lxppc/build.lua b/rt/lxppc/build.lua deleted file mode 100644 index ed69d955..00000000 --- a/rt/lxppc/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/lxppc/cowgol.cos" }, - outs = { "$OBJ/rt/lxppc/cowgol.coo" } -} - diff --git a/rt/lxthumb2/build.lua b/rt/lxthumb2/build.lua deleted file mode 100644 index 9642e816..00000000 --- a/rt/lxthumb2/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/lxthumb2/cowgol.cos" }, - outs = { "$OBJ/rt/lxthumb2/cowgol.coo" } -} - diff --git a/rt/msdos/build.lua b/rt/msdos/build.lua deleted file mode 100644 index 9099e7e6..00000000 --- a/rt/msdos/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/msdos/cowgol.cos" }, - outs = { "$OBJ/rt/msdos/cowgol.coo" } -} - diff --git a/rt/unixv7/build.lua b/rt/unixv7/build.lua deleted file mode 100644 index 7e616888..00000000 --- a/rt/unixv7/build.lua +++ /dev/null @@ -1,5 +0,0 @@ -cowwrap { - ins = { "rt/unixv7/cowgol.cos" }, - outs = { "$OBJ/rt/unixv7/cowgol.coo" } -} - diff --git a/src/build.lua b/src/build.lua deleted file mode 100644 index 1a4a8c38..00000000 --- a/src/build.lua +++ /dev/null @@ -1,331 +0,0 @@ -rule { - ins = { - "scripts/mkiburgcodes.lua", - "scripts/libcowgol.lua", - "src/midcodes.coh.tab", - }, - outs = { "$OBJ/iburgcodes-coh.h" }, - cmd = "$LUA @1 -- @3 &1" -} - -rule { - ins = { - "scripts/mkmidcodescoh.lua", - "scripts/libcowgol.lua", - "src/midcodes.coh.tab", - }, - outs = { "$OBJ/midcodes.coh" }, - cmd = "$LUA @1 -- @3 &1 combined" -} - -rule { - ins = { - "scripts/mkcobin.lua", - "scripts/libcowgol.lua", - "src/midcodes.coh.tab", - }, - outs = { "$OBJ/cobin.coh" }, - cmd = "$LUA @1 -- @3 &1" -} - -rule { - ins = { - "scripts/mkcobout.lua", - "scripts/libcowgol.lua", - "src/midcodes.coh.tab", - }, - outs = { "$OBJ/cobout.coh" }, - cmd = "$LUA @1 -- @3 &1" -} - -rule { - ins = { - "scripts/mkmidcodescoh.lua", - "scripts/libcowgol.lua", - "src/midcodes.coh.tab", - }, - outs = { "$OBJ/midcodesfe.coh" }, - cmd = "$LUA @1 -- @3 &1 fe" -} - -rule { - ins = { - "scripts/mkmidcodescoh.lua", - "scripts/libcowgol.lua", - "src/midcodes.coh.tab", - }, - outs = { "$OBJ/midcodesbe.coh" }, - cmd = "$LUA @1 -- @3 &1 be" -} - -function uncoo(e) - rule { - ins = concat { - "scripts/uncoo.lua", - e.ins - }, - outs = e.outs, - cmd = "$LUA @1 @2 &1" - } -end - -function buildcgen(e) - cprogram { - ins = concat { - e.ins, - "rt/cgen/cowgol.h", - }, - outs = e.outs - } -end - -function buildgas(arch, e) - local obj = e.outs[1]:ext(".o"):obj() - rule { - ins = e.ins, - outs = { obj }, - cmd = arch.."-as -g @1 -o &1" - } - - rule { - ins = { obj }, - outs = e.outs, - cmd = arch.."-ld -g @1 -o &1" - } -end - -function buildgas386(e) - return buildgas("i686-linux-gnu", e) -end - -function buildgas68k(e) - return buildgas("m68k-linux-gnu", e) -end - -function buildgasarm(e) - return buildgas("arm-linux-gnueabihf", e) -end - -function buildgasppc(e) - return buildgas("powerpc-linux-gnu", e) -end - -function buildgasataritos(e) - return buildgas("m68k-atari-mint", e) -end - -function buildzmac(e) - local cim = e.outs[1]:ext(".cim"):obj() - zmac { - ins = e.ins, - outs = { cim } - } - - rule { - ins = { cim }, - outs = e.outs, - cmd = "cp @1 &1" - } -end - -function buildcowasm(e, asm) - local lst = e.outs[1]:ext(".lst"):obj() - rule { - ins = concat { - "scripts/quiet", - "bin/cowasm-"..asm..".nncgen.exe", - e.ins - }, - outs = { e.outs[1], lst }, - cmd = "@1 @2 @3 -o &1 -l &2" - } -end - -function buildcowasm8080(e) - buildcowasm(e, "8080") -end - -function buildcowasmpdp11(e) - buildcowasm(e, "pdp11") -end - -function buildcowasm6303(e) - buildcowasm(e, "6303") -end - -function buildtass64(e) - local img = e.outs[1]:ext(".img"):obj() - tass64 { - ins = e.ins, - outs = e.outs, - } -end - -function buildnasm(e) - local lst = e.outs[1]:ext(".lst"):obj() - local obj = e.outs[1]:ext(".obj"):obj() - rule { - ins = e.ins, - outs = { obj, lst }, - cmd = "nasm -f obj -o &1 -l &2 @1", - } - - djlink { - ins = { obj }, - outs = { e.outs[1] } - } -end - -function simpletest(interpreter, e) - local badfile = e.ins[1]:ext(".bad") - rule { - ins = e.ins, - outs = { badfile }, - cmd = "timeout 5s "..interpreter.." @1 > &1.tmp && mv &1.tmp &1 && diff -u -w &1 "..e.goodfile, - } -end - -function nativetest(e) - return simpletest("", e) -end - -function qemu386test(e) - return simpletest("qemu-i386", e) -end - -function qemu68ktest(e) - return simpletest("qemu-m68k", e) -end - -function qemuarmtest(e) - return simpletest("qemu-arm", e) -end - -function qemuppctest(e) - return simpletest("qemu-ppc", e) -end - -function cpmtest(e) - e.ins = concat { e.ins, "bin/cpmemu" } - return simpletest("bin/cpmemu", e) -end - -function tubeemutest(e) - e.ins = concat { e.ins, "bin/tubeemu" } - return simpletest("bin/tubeemu -l 0x400 -e 0x400 -f", e) -end - -function apouttest(e) - e.ins = concat { e.ins, "bin/apout" } - return simpletest("bin/apout ", e) -end - -function fuzix6303test(e) - e.ins = concat { e.ins, "bin/fuzix6303emu" } - return simpletest("bin/fuzix6303emu -f", e) -end - -function emu2test(e) - e.ins = concat { e.ins, "bin/emu2" } - return simpletest("bin/emu2", e) -end - -function ataritosemutest(e) - e.ins = concat { e.ins, "bin/ataritosemu" } - return simpletest("bin/ataritosemu", e) -end - -function cowgol(e) - local out = e.outs[1].."."..e.toolchain.name..e.toolchain.binext - local coo = out:ext(".coo"):obj() - local asm = out:ext(e.toolchain.asmext):obj() - - local hdrs = {} - for _, src in ipairs(e.ins) do - local f = src:gsub("[^/]*$", "") - if f == "" then - f = "." - end - hdrs[#hdrs+1] = "-I"..f - end - - if e.toolchain.compiler then - rule { - ins = concat { - e.toolchain.compiler, - e.ins, - "scripts/quiet", - "rt/common-file.coh", - "rt/common.coh", - "rt/fileio.coh", - "rt/malloc.coh", - "rt/strings.coh", - (e.toolchain.runtime.."/cowgol.coh"), - (e.toolchain.runtime.."/file.coh"), - (e.toolchain.runtime.."/argv.coh"), - }, - outs = { coo }, - cmd = "scripts/quiet @1 -Irt/ -I"..e.toolchain.runtime.."/ "..joined(hdrs).." @2 &1" - } - else - local cob = out:ext(".cob"):obj() - rule { - ins = concat { - e.toolchain.cowfe, - e.ins, - "scripts/quiet", - "rt/common-file.coh", - "rt/common.coh", - "rt/fileio.coh", - "rt/malloc.coh", - "rt/strings.coh", - (e.toolchain.runtime.."/cowgol.coh"), - (e.toolchain.runtime.."/file.coh"), - (e.toolchain.runtime.."/argv.coh"), - }, - outs = { cob }, - cmd = "scripts/quiet @1 -Irt/ -I"..e.toolchain.runtime.."/ "..joined(hdrs).." @2 &1" - } - - rule { - ins = concat { - e.toolchain.cowbe, - "scripts/quiet", - cob, - }, - outs = { coo }, - cmd = "scripts/quiet @1 @3 &1" - } - end - - rule { - ins = concat { - "scripts/quiet", - e.toolchain.linker, - (e.toolchain.runtime.."/cowgol.coo"):obj(), - coo - }, - outs = { asm }, - cmd = "@1 @2 -o &1 @3 @4" - } - - e.toolchain.assembler { - ins = { asm }, - outs = { out } - } - - return out -end - -function cowwrap(e) - rule { - ins = concat { - "scripts/quiet", - "bin/cowwrap.bootstrap.exe", - e.ins - }, - outs = e.outs, - cmd = "@1 @2 @3 &1" - } -end - diff --git a/src/cowasm/build.lua b/src/cowasm/build.lua deleted file mode 100644 index f718424a..00000000 --- a/src/cowasm/build.lua +++ /dev/null @@ -1,16 +0,0 @@ -local ARCHS = { "8080", "pdp11", "6303", "tlcs90", "obp" } - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - for _, arch in ipairs(ARCHS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowasm/arch"..arch..".cow", - "src/cowasm/cowasm.coh", - "src/cowasm/stdsyms.coh", - }, - outs = { "bin/cowasm-"..arch } - } - end -end - diff --git a/src/cowasm2/build.lua b/src/cowasm2/build.lua deleted file mode 100644 index 1ab65fe7..00000000 --- a/src/cowasm2/build.lua +++ /dev/null @@ -1,30 +0,0 @@ -local ARCHS = { "ac1082" } - -for _, arch in ipairs(ARCHS) do - lemoncowgol { - ins = { "src/cowasm2/arch"..arch..".y" }, - outs = { - "$OBJ/src/cowasm2/arch"..arch..".parser.coh", - "$OBJ/src/cowasm2/arch"..arch..".tokens.coh", - } - } - - for _, toolchain in ipairs(ALL_TOOLCHAINS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowasm2/arch"..arch..".cow", - "src/cowasm2/types.coh", - "src/cowasm2/lexer.coh", - "src/cowasm2/symbols.coh", - "src/cowasm2/emitter.coh", - "src/cowasm2/cowasm2.coh", - "$OBJ/src/cowasm2/arch"..arch..".parser.coh", - "$OBJ/src/cowasm2/arch"..arch..".tokens.coh", - }, - outs = { "bin/cowasm-"..arch } - } - end -end - - diff --git a/src/cowbdmp/build.lua b/src/cowbdmp/build.lua deleted file mode 100644 index 023fa89d..00000000 --- a/src/cowbdmp/build.lua +++ /dev/null @@ -1,16 +0,0 @@ -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowbdmp/main.cow", - "src/cowbdmp/types.coh", - "src/cowbe/inputter.coh", - "src/cowbe/utils.coh", - "src/cowbe/treewalker.coh", - "$OBJ/cobin.coh", - "$OBJ/midcodesbe.coh", - }, - outs = { "bin/cowbdmp" } - } -end - diff --git a/src/cowbe/build.lua b/src/cowbe/build.lua deleted file mode 100644 index 484c1bc9..00000000 --- a/src/cowbe/build.lua +++ /dev/null @@ -1,61 +0,0 @@ -local ARCHS = { - "6303", - "6502", - "65c02", - "65c02-tiny", - "68000", - "80386", - "8080", - "8086", - "basic", - "cgen", - "pdp11", - "powerpc", - "thumb2", - "z80", -} - -local extras = { - ["65c02"] = "src/cowbe/arch6502.cow.ng", - ["65c02-tiny"] = "src/cowbe/arch6502.cow.ng" -} - -for _, arch in ipairs(ARCHS) do - newgencowgol { - ins = { - "src/cowbe/arch"..arch..".cow.ng", - extras[arch] - }, - outs = { - "$OBJ/cowbe-"..arch.."/inssel.coh", - "$OBJ/cowbe-"..arch.."/inssel.decl.coh", - } - } -end - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - for _, arch in ipairs(ARCHS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowbe/main.cow", - "include/coodecls.coh", - "src/cowbe/allocator.coh", - "src/cowbe/codegen.coh", - "src/cowbe/emitter.coh", - "src/cowbe/inputter.coh", - "src/cowbe/midcodec.coh", - "src/cowbe/processor.coh", - "src/cowbe/regcache.coh", - "src/cowbe/treewalker.coh", - "src/cowbe/types.coh", - "src/cowbe/utils.coh", - "$OBJ/cowbe-"..arch.."/inssel.coh", - "$OBJ/cowbe-"..arch.."/inssel.decl.coh", - "$OBJ/midcodesbe.coh", - }, - outs = { "bin/cowbe-"..arch } - } - end -end - diff --git a/src/cowdis/build.lua b/src/cowdis/build.lua deleted file mode 100644 index 803c048b..00000000 --- a/src/cowdis/build.lua +++ /dev/null @@ -1,14 +0,0 @@ -local ARCHS = { "tlcs90" } - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - for _, arch in ipairs(ARCHS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowdis/arch"..arch..".cow", - }, - outs = { "bin/cowdis-"..arch } - } - end -end - diff --git a/src/cowfe/build.lua b/src/cowfe/build.lua deleted file mode 100644 index d30f7810..00000000 --- a/src/cowfe/build.lua +++ /dev/null @@ -1,56 +0,0 @@ -local ARCHS = { - "6502", - "80386", - "basic", - "cgen", - "pdp11", - "16bit", - "32bita2", - "32bita", -} - -lemoncowgol { - ins = { "src/cowfe/parser.y" }, - outs = { - "$OBJ/src/cowfe/parser.coh", - "$OBJ/src/cowfe/parser.tokens.coh", - } -} - -for _, arch in ipairs(ARCHS) do - rule { - ins = { "src/cowfe/arch"..arch..".coh" }, - outs = { "$OBJ/cowfe-"..arch.."/arch.coh" }, - cmd = "cp @1 &1", - } -end - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - for _, arch in ipairs(ARCHS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowfe/main.cow", - "include/coodecls.coh", - "src/cowfe/allocator.coh", - "src/cowfe/codegen.coh", - "src/cowfe/emitter.coh", - "src/cowfe/expressions.coh", - "src/cowfe/lexer.coh", - "src/cowfe/midcodec.coh", - "src/cowfe/namespace.coh", - "src/cowfe/regcache.coh", - "src/cowfe/symbols.coh", - "src/cowfe/treewalker.coh", - "src/cowfe/types.coh", - "$OBJ/src/cowfe/parser.coh", - "$OBJ/src/cowfe/parser.tokens.coh", - "$OBJ/cowfe-"..arch.."/arch.coh", - "$OBJ/midcodesfe.coh", - "$OBJ/cobout.coh", - }, - outs = { "bin/cowfe-"..arch } - } - end -end - diff --git a/src/cowlink/build.lua b/src/cowlink/build.lua deleted file mode 100644 index 567d7fea..00000000 --- a/src/cowlink/build.lua +++ /dev/null @@ -1,46 +0,0 @@ -local ARCHS = { - "8080", - "ataritos", - "basic", - "bbct", - "bbctn", - "cgen", - "fuzix6303", - "lx386", - "lx68k", - "lxppc", - "lxthumb2", - "msdos", - "rt11", - "v7unix", -} - -for _, arch in ipairs(ARCHS) do - rule { - ins = { "src/cowlink/arch"..arch..".coh" }, - outs = { "$OBJ/cowlink-"..arch.."/archlink.coh" }, - cmd = "cp @1 &1", - } -end - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - for _, arch in ipairs(ARCHS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowlink/main.cow", - "include/coodecls.coh", - "$OBJ/cowlink-"..arch.."/archlink.coh", - "src/cowlink/asmwrite.coh", - "src/cowlink/cooread.coh", - "src/cowlink/emitter.coh", - "src/cowlink/graph.coh", - "src/cowlink/streams.coh", - "src/cowlink/types.coh", - "src/cowlink/utils.coh", - }, - outs = { "bin/cowlink-"..arch } - } - end -end - diff --git a/src/cowwrap/build.lua b/src/cowwrap/build.lua deleted file mode 100644 index efaadfee..00000000 --- a/src/cowwrap/build.lua +++ /dev/null @@ -1,13 +0,0 @@ -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - cowgol { - toolchain = toolchain, - ins = { - "src/cowwrap/main.cow", - "include/coodecls.coh", - "src/cowwrap/emitter.coh", - "src/cowwrap/reader.coh", - }, - outs = { "bin/cowwrap" }, - } -end - diff --git a/src/misc/build.lua b/src/misc/build.lua deleted file mode 100644 index d0887c48..00000000 --- a/src/misc/build.lua +++ /dev/null @@ -1,11 +0,0 @@ -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - cowgol { - toolchain = toolchain, - ins = { - "src/misc/basicify.cow" - }, - outs = { "bin/basicify" } - } -end - - diff --git a/tests/build.lua b/tests/build.lua deleted file mode 100644 index 894a807f..00000000 --- a/tests/build.lua +++ /dev/null @@ -1,72 +0,0 @@ -ALL_TESTS = { - "addsub-16bit", - "addsub-32bit", - "addsub-8bit", - "atoi", - "arrayinitialisers", - "case", - "casts", - "conditionals", - "divrem-16bit-s", - "divrem-16bit-u", - "divrem-32bit-s", - "divrem-32bit-u", - "divrem-8bit-s", - "divrem-8bit-u", - --"empty", # causes qemu to crash, but works on real hardware - "fileio", - "folding", - "forwards", - "inputparams", - "interfaces", - "itoa", - "logic-16bit", - "logic-32bit", - "logic-8bit", - "loops", - "lvalues", - "malloc", - "mul-16bit-s", - "mul-16bit-u", - "mul-32bit-s", - "mul-32bit-u", - "mul-8bit-s", - "mul-8bit-u", - "nested-calls", - "outputparams", - "pointers", - "rangetypes", - "recordinitialisers", - "records", - "regalloc", - "shifts-16bit", - "shifts-32bit", - "shifts-8bit", - "unions", -} - -for _, toolchain in ipairs(ALL_TOOLCHAINS) do - -- ncgen uses the bootstrap compiler, which should be tested and also - -- doesn't support the current language features. So, we don't need to - -- run the tests for it and they likely won't work anyway. - if toolchain.name ~= "ncgen" then - for _, test in ipairs(ALL_TESTS) do - if toolchain.tester then - local exe = cowgol { - toolchain = toolchain, - ins = { - "tests/"..test..".test.cow", - "tests/_framework.coh", - }, - outs = { "$OBJ/tests/"..test } - } - - toolchain.tester { - ins = { exe }, - goodfile = "tests/"..test..".good" - } - end - end - end -end - diff --git a/third_party/apout/build.lua b/third_party/apout/build.lua deleted file mode 100644 index 22335627..00000000 --- a/third_party/apout/build.lua +++ /dev/null @@ -1,25 +0,0 @@ -cprogram { - ins = { - "third_party/apout/aout.c", - "third_party/apout/branch.c", - "third_party/apout/bsd_ioctl.c", - "third_party/apout/bsd_signal.c", - "third_party/apout/bsdtrap.c", - "third_party/apout/cpu.c", - "third_party/apout/debug.c", - "third_party/apout/double.c", - "third_party/apout/ea.c", - "third_party/apout/fp.c", - "third_party/apout/itab.c", - "third_party/apout/ke11a.c", - "third_party/apout/magic.c", - "third_party/apout/main.c", - "third_party/apout/single.c", - "third_party/apout/v1trap.c", - "third_party/apout/v7trap.c", - }, - ldflags = "-lm", - cflags = "-DEMUV1 -DNATIVES -DRUN_V1_RAW -DDEBUG -DZERO_MEMORY -DWRITEBASE -DHEX", - outs = { "bin/apout" } -} - diff --git a/third_party/djlink/build.lua b/third_party/djlink/build.lua deleted file mode 100644 index 552b5288..00000000 --- a/third_party/djlink/build.lua +++ /dev/null @@ -1,54 +0,0 @@ -cxxprogram { - ins = { "third_party/djlink/objdump.cc" }, - outs = { "bin/objdump" } -} - -cxxprogram { - ins = { "third_party/djlink/bindiff.cc" }, - outs = { "bin/bindiff" } -} - -cxxprogram { - ins = { - "third_party/djlink/djlink.cc", - "third_party/djlink/fixups.cc", - "third_party/djlink/libs.cc", - "third_party/djlink/list.cc", - "third_party/djlink/map.cc", - "third_party/djlink/objs.cc", - "third_party/djlink/out.cc", - "third_party/djlink/quark.cc", - "third_party/djlink/segments.cc", - "third_party/djlink/stricmp.cc", - "third_party/djlink/symbols.cc", - "third_party/djlink/fixups.h", - "third_party/djlink/libs.h", - "third_party/djlink/link.h", - "third_party/djlink/list.h", - "third_party/djlink/map.h", - "third_party/djlink/objs.h", - "third_party/djlink/omf.h", - "third_party/djlink/out.h", - "third_party/djlink/quark.h", - "third_party/djlink/segments.h", - "third_party/djlink/stricmp.h", - "third_party/djlink/symbols.h", - "third_party/djlink/vars.h", - }, - outs = { "bin/djlink" } -} - -function djlink(e) - local map = e.outs[1]:ext(".map") - rule { - ins = concat { - "bin/djlink", - e.ins, - }, - outs = concat { - e.outs, - map - }, - cmd = "@1 -o &1 -m &2 @2 > /dev/null" - } -end diff --git a/third_party/emu2/build.lua b/third_party/emu2/build.lua deleted file mode 100644 index 65b6a29e..00000000 --- a/third_party/emu2/build.lua +++ /dev/null @@ -1,19 +0,0 @@ -cprogram { - ins = { - "third_party/emu2/src/cpu.c", - "third_party/emu2/src/loader.c", - "third_party/emu2/src/main.c", - "third_party/emu2/src/codepage.c", - "third_party/emu2/src/dosnames.c", - "third_party/emu2/src/dis.c", - "third_party/emu2/src/dos.c", - "third_party/emu2/src/keyb.c", - "third_party/emu2/src/dbg.c", - "third_party/emu2/src/timer.c", - "third_party/emu2/src/utils.c", - "third_party/emu2/src/video.c", - }, - ldflags = "-lm", - outs = { "bin/emu2" } -} - diff --git a/third_party/lemon/build.lua b/third_party/lemon/build.lua deleted file mode 100644 index eef67b95..00000000 --- a/third_party/lemon/build.lua +++ /dev/null @@ -1,41 +0,0 @@ -cprogram { - ins = { "third_party/lemon/lemon.c" }, - outs = { "bin/lemon" } -} - -cprogram { - ins = { "third_party/lemon/lemon-cowgol.c" }, - outs = { "bin/lemon-cowgol" } -} - -function lemon(e) - local dir = e.outs[1]:gsub("/[^/]*$", "").."/tmp" - rule { - ins = concat { - "bin/lemon", - "third_party/lemon/lempar.c", - e.ins, - }, - outs = e.outs, - cmd = "mkdir -p "..dir.." && @1 -T@2 -d"..dir.." @3" - .." && mv "..dir.."/parser.c &1" - .." && mv "..dir.."/parser.h &2" - } -end - -function lemoncowgol(e) - local dir = e.outs[1]:gsub("/[^/]*$", "").."/tmp" - local leaf = e.ins[1]:leaf():ext("") - rule { - ins = concat { - "bin/lemon-cowgol", - "src/cowfe/lempar.coh", - e.ins, - }, - outs = e.outs, - cmd = "mkdir -p "..dir.." && @1 -T@2 -d"..dir.." @3" - .." && mv "..dir.."/"..leaf..".c &1" - .." && mv "..dir.."/"..leaf..".h &2" - } -end - diff --git a/third_party/musashi/build.lua b/third_party/musashi/build.lua deleted file mode 100644 index af53f7fa..00000000 --- a/third_party/musashi/build.lua +++ /dev/null @@ -1,40 +0,0 @@ -cprogram { - ins = { - "third_party/musashi/m68kmake.c" - }, - outs = { - "$OBJ/third_party/musashi/m68kmake" - } -} - -rule { - ins = { - "$OBJ/third_party/musashi/m68kmake", - "third_party/musashi/m68k_in.c" - }, - outs = { - "$OBJ/third_party/musashi/m68kops.c", - "$OBJ/third_party/musashi/m68kops.h" - }, - cmd = "@1 $OBJ/third_party/musashi @2 > /dev/null" -} - -function musashilib(e) - clibrary { - ins = { - e.m68kconf, - "third_party/musashi/m68kcpu.c", - "third_party/musashi/m68kcpu.h", - "third_party/musashi/m68kdasm.c", - "third_party/musashi/m68k.h", - "third_party/musashi/m68kmmu.h", - "third_party/musashi/softfloat/softfloat.c", - "third_party/musashi/softfloat/softfloat.h", - "$OBJ/third_party/musashi/m68kops.c", - "$OBJ/third_party/musashi/m68kops.h" - }, - objdir = e.outs[1]:dir().."musashi", - outs = e.outs - } -end - diff --git a/third_party/rc2014emu/build.lua b/third_party/rc2014emu/build.lua deleted file mode 100644 index e69de29b..00000000 diff --git a/third_party/zmac/build.lua b/third_party/zmac/build.lua deleted file mode 100644 index 06614293..00000000 --- a/third_party/zmac/build.lua +++ /dev/null @@ -1,44 +0,0 @@ -yacc { - ins = { "third_party/zmac/zmac.y" }, - outs = { - "$OBJ/third_party/zmac/y.tab.c", - "$OBJ/third_party/zmac/y.tab.h", - } -} - -cprogram { - ins = { - "$OBJ/third_party/zmac/y.tab.c", - "third_party/zmac/mio.c", - "third_party/zmac/zi80dis.cpp" - }, - outs = { - "bin/zmac" - }, - cflags = "-I$OBJ/third_party/zmac -Ithird_party/zmac" -} - -function zmac(e) - local f = e.ins[1] - local _, _, ext = f:find("%.(%w+)$") - local archflag = (ext == "z80") and "-z" or "-8" - local lstfile = e.outs[1]:ext(".lst") - - local hdrpaths = {} - for _, t in ipairs(e.ins) do - hdrpaths[#hdrpaths+1] = "-I"..t - end - - rule { - ins = concat( - "bin/zmac", - e.ins - ), - outs = { - e.outs[1], - lstfile - }, - cmd = "@1 -j -m "..archflag.." -o &1 -o &2 "..table.concat(hdrpaths, " ").." @2" - } -end - diff --git a/toolchains.lua b/toolchains.lua deleted file mode 100644 index 7ea33425..00000000 --- a/toolchains.lua +++ /dev/null @@ -1,202 +0,0 @@ -toolchain_ataritos = { - name = "ataritos", - cowfe = "bin/cowfe-32bita2.nncgen.exe", - cowbe = "bin/cowbe-68000.nncgen.exe", - linker = "bin/cowlink-ataritos.nncgen.exe", - assembler = buildgasataritos, - runtime = "rt/ataritos", - asmext = ".s", - binext = ".ataritos.tos", - tester = ataritosemutest, -} - -toolchain_ncgen = { - name = "ncgen", - cowfe = "bin/cowfe-cgen.bootstrap.exe", - cowbe = "bin/cowbe-cgen.bootstrap.exe", - linker = "bin/cowlink-cgen.bootstrap.exe", - assembler = buildcgen, - runtime = "rt/cgen", - asmext = ".c", - binext = ".exe", - tester = nativetest -} - -toolchain_nncgen = { - name = "nncgen", - cowbe = "bin/cowbe-cgen.ncgen.exe", - cowfe = "bin/cowfe-cgen.ncgen.exe", - linker = "bin/cowlink-cgen.ncgen.exe", - assembler = buildcgen, - runtime = "rt/cgen", - asmext = ".c", - binext = ".exe", - tester = nativetest -} - -toolchain_ncpm = { - name = "ncpm", - cowfe = "bin/cowfe-16bit.nncgen.exe", - cowbe = "bin/cowbe-8080.nncgen.exe", - linker = "bin/cowlink-8080.nncgen.exe", - assembler = buildcowasm8080, - runtime = "rt/cpm", - asmext = ".asm", - binext = ".8080.com", - tester = cpmtest, -} - -toolchain_ncpmz = { - name = "ncpmz", - cowfe = "bin/cowfe-16bit.nncgen.exe", - cowbe = "bin/cowbe-z80.nncgen.exe", - linker = "bin/cowlink-8080.nncgen.exe", - assembler = buildzmac, - runtime = "rt/cpmz", - asmext = ".z80", - binext = ".z80.com", - tester = cpmtest, -} - -toolchain_lxthumb2 = { - name = "lxthumb2", - cowfe = "bin/cowfe-32bita.nncgen.exe", - cowbe = "bin/cowbe-thumb2.nncgen.exe", - linker = "bin/cowlink-lxthumb2.nncgen.exe", - assembler = buildgasarm, - runtime = "rt/lxthumb2", - asmext = ".s", - binext = ".lxthumb2.exe", - tester = qemuarmtest -} - -toolchain_lx386 = { - name = "lx386", - cowfe = "bin/cowfe-80386.nncgen.exe", - cowbe = "bin/cowbe-80386.nncgen.exe", - linker = "bin/cowlink-lx386.nncgen.exe", - assembler = buildgas386, - runtime = "rt/lx386", - asmext = ".s", - binext = ".lx386.exe", - tester = qemu386test -} - -toolchain_lx68k = { - name = "lx68k", - cowfe = "bin/cowfe-32bita2.nncgen.exe", - cowbe = "bin/cowbe-68000.nncgen.exe", - linker = "bin/cowlink-lx68k.nncgen.exe", - assembler = buildgas68k, - runtime = "rt/lx68k", - asmext = ".s", - binext = ".lx68k.exe", - tester = qemu68ktest -} - -toolchain_lxppc = { - name = "lxppc", - cowfe = "bin/cowfe-32bita.nncgen.exe", - cowbe = "bin/cowbe-powerpc.nncgen.exe", - linker = "bin/cowlink-lxppc.nncgen.exe", - assembler = buildgasppc, - runtime = "rt/lxppc", - asmext = ".s", - binext = ".lxppc.exe", - tester = qemuppctest -} - -toolchain_bbct = { - name = "bbct", - cowfe = "bin/cowfe-6502.nncgen.exe", - cowbe = "bin/cowbe-65c02.nncgen.exe", - linker = "bin/cowlink-bbct.nncgen.exe", - assembler = buildtass64, - runtime = "rt/bbct", - asmext = ".asm", - binext = ".bbct", - tester = tubeemutest, - archs = { "8080" } -} - -toolchain_bbctiny = { - name = "bbctiny", - cowfe = "bin/cowfe-6502.nncgen.exe", - cowbe = "bin/cowbe-65c02-tiny.nncgen.exe", - linker = "bin/cowlink-bbct.nncgen.exe", - assembler = buildtass64, - runtime = "rt/bbct", - asmext = ".asm", - binext = ".bbctiny", - tester = tubeemutest, -} - -toolchain_bbct6502 = { - name = "bbct6502", - cowfe = "bin/cowfe-6502.nncgen.exe", - cowbe = "bin/cowbe-6502.nncgen.exe", - linker = "bin/cowlink-bbct.nncgen.exe", - assembler = buildtass64, - runtime = "rt/bbct", - asmext = ".asm", - binext = ".bbct6502", - tester = tubeemutest, - archs = { "8080" }, -} - -toolchain_unixv7 = { - name = "unixv7", - cowfe = "bin/cowfe-pdp11.nncgen.exe", - cowbe = "bin/cowbe-pdp11.nncgen.exe", - linker = "bin/cowlink-v7unix.nncgen.exe", - assembler = buildcowasmpdp11, - runtime = "rt/unixv7", - asmext = ".asm", - binext = ".exe", - tester = apouttest -} - -toolchain_fuzix6303 = { - name = "fuzix6303", - cowfe = "bin/cowfe-16bit.nncgen.exe", - cowbe = "bin/cowbe-6303.nncgen.exe", - linker = "bin/cowlink-fuzix6303.nncgen.exe", - assembler = buildcowasm6303, - runtime = "rt/fuzix6303", - asmext = ".asm", - binext = ".6303.exe", - tester = fuzix6303test, -} - -toolchain_msdos = { - name = "msdos", - cowfe = "bin/cowfe-16bit.nncgen.exe", - cowbe = "bin/cowbe-8086.nncgen.exe", - linker = "bin/cowlink-msdos.nncgen.exe", - assembler = buildnasm, - runtime = "rt/msdos", - asmext = ".asm", - binext = ".msdos.exe", - tester = emu2test, -} - -ALL_TOOLCHAINS = {} -addto(ALL_TOOLCHAINS, toolchain_nncgen) -addto(ALL_TOOLCHAINS, toolchain_ncgen) - -addto(ALL_TOOLCHAINS, toolchain_bbct) -addto(ALL_TOOLCHAINS, toolchain_bbct6502) -addto(ALL_TOOLCHAINS, toolchain_bbcti) -addto(ALL_TOOLCHAINS, toolchain_bbctiny) -addto(ALL_TOOLCHAINS, toolchain_fuzix6303) -addto(ALL_TOOLCHAINS, toolchain_ncpm) -addto(ALL_TOOLCHAINS, toolchain_ncpmz) -addto(ALL_TOOLCHAINS, toolchain_unixv7) - -if WITH_ATARITOS then addto(ALL_TOOLCHAINS, toolchain_ataritos) end -if WITH_LX386 then addto(ALL_TOOLCHAINS, toolchain_lx386) end -if WITH_LX68K then addto(ALL_TOOLCHAINS, toolchain_lx68k) end -if WITH_LXPPC then addto(ALL_TOOLCHAINS, toolchain_lxppc) end -if WITH_LXTHUMB2 then addto(ALL_TOOLCHAINS, toolchain_lxthumb2) end -if WITH_MSDOS then addto(ALL_TOOLCHAINS, toolchain_msdos) end - diff --git a/tools/ataritosemu/build.lua b/tools/ataritosemu/build.lua deleted file mode 100644 index d4e94e68..00000000 --- a/tools/ataritosemu/build.lua +++ /dev/null @@ -1,17 +0,0 @@ -musashilib { - m68kconf = "tools/ataritosemu/m68kconf.h", - outs = { "$OBJ/tools/ataritosemu/libmusashi.a" } -} - -cprogram { - ins = { - "tools/ataritosemu/gemdos.c", - "tools/ataritosemu/sim.c", - "tools/ataritosemu/sim.h", - "third_party/musashi/m68k.h", - "$OBJ/tools/ataritosemu/libmusashi.a", - }, - outs = { "bin/ataritosemu" }, -} - - diff --git a/tools/build.lua b/tools/build.lua deleted file mode 100644 index 04c2e0fd..00000000 --- a/tools/build.lua +++ /dev/null @@ -1,39 +0,0 @@ -function objectify(e) - rule { - ins = concat { - "tools/objectify", - e.ins - }, - outs = e.outs, - cmd = "$LUA @1 "..e.symbol.." < @2 > &1" - } -end - -cprogram { - ins = { "tools/mkadfs.c" }, - outs = { "bin/mkadfs" }, -} - -cprogram { - ins = { "tools/mkdfs.c" }, - outs = { "bin/mkdfs" }, -} - -function mkdfs(e) - local ins = {} - for _, f in ipairs(e.ins) do - if not f:find("^-") then - ins[#ins+1] = f - end - end - - rule { - ins = concat { - "bin/mkdfs", - ins, - }, - outs = e.outs, - cmd = "@1 -O &1 "..table.concat(e.ins, " ") - } -end - diff --git a/tools/cpmemu/build.lua b/tools/cpmemu/build.lua deleted file mode 100644 index 574b584d..00000000 --- a/tools/cpmemu/build.lua +++ /dev/null @@ -1,24 +0,0 @@ -zmac { - ins = { "tools/cpmemu/biosbdos.z80" }, - outs = { "$OBJ/tools/cpmemu/biosbdos.cim" } -} - -objectify { - ins = { "$OBJ/tools/cpmemu/biosbdos.cim" }, - outs = { "$OBJ/tools/cpmemu/biosbdosdata.c" }, - symbol = "biosbdosdata" -} - -cprogram { - ins = { - "tools/cpmemu/main.c", - "tools/cpmemu/emulator.c", - "tools/cpmemu/fileio.c", - "tools/cpmemu/biosbdos.c", - "$OBJ/tools/cpmemu/biosbdosdata.c", - }, - ldflags = "-lz80ex -lz80ex_dasm -lreadline", - outs = { "bin/cpmemu" } -} - - diff --git a/tools/fuzix6303emu/build.lua b/tools/fuzix6303emu/build.lua deleted file mode 100644 index 407a7005..00000000 --- a/tools/fuzix6303emu/build.lua +++ /dev/null @@ -1,15 +0,0 @@ -cprogram { - ins = { - "tools/fuzix6303emu/main.c", - "tools/fuzix6303emu/disasm.c", - "tools/fuzix6303emu/globals.h", - "third_party/rc2014emu/6800.c", - "third_party/rc2014emu/6800.h", - }, - outs = { "bin/fuzix6303emu" }, - ldflags = "-lreadline", -} - - - - diff --git a/tools/lx68kemu/build.lua b/tools/lx68kemu/build.lua deleted file mode 100644 index cc6ed12b..00000000 --- a/tools/lx68kemu/build.lua +++ /dev/null @@ -1,16 +0,0 @@ -musashilib { - m68kconf = "tools/lx68kemu/m68kconf.h", - outs = { "$OBJ/tools/lx68kemu/libmusashi.a" } -} - -cprogram { - ins = { - "tools/lx68kemu/sim.c", - "tools/lx68kemu/sim.h", - "third_party/musashi/m68k.h", - "$OBJ/tools/lx68kemu/libmusashi.a", - }, - outs = { "bin/lx68kemu" }, -} - - diff --git a/tools/newgen/build.lua b/tools/newgen/build.lua deleted file mode 100644 index 6af30971..00000000 --- a/tools/newgen/build.lua +++ /dev/null @@ -1,48 +0,0 @@ -lemon { - ins = { "tools/newgen/parser.y" }, - outs = { - "$OBJ/tools/newgen/parser.c", - "$OBJ/tools/newgen/parser.h", - } -} - -flex { - ins = { "tools/newgen/lexer.l" }, - outs = { "$OBJ/tools/newgen/lexer.c" }, -} - -cprogram { - ins = { - "tools/newgen/main.c", - "tools/newgen/utils.c", - "tools/newgen/globals.h", - "$OBJ/iburgcodes-coh.h", - "$OBJ/tools/newgen/parser.c", - "$OBJ/tools/newgen/parser.h", - "$OBJ/tools/newgen/lexer.c", - }, - objdir = "$OBJ/newgen-cowgol", - cflags = "-DCOWGOL", - ldflags = "-lfl", - outs = { "bin/newgen-cowgol" } -} - -function newgencowgol(e) - local infile = e.ins[1] - local cppfile = infile:ext(".i"):obj(); - - gpp { - ins = e.ins, - outs = { cppfile } - } - - rule { - ins = concat { - "bin/newgen-cowgol", - cppfile - }, - outs = e.outs, - cmd = "@1 @2 &1 &2" - } -end - diff --git a/tools/obpemu/build.lua b/tools/obpemu/build.lua deleted file mode 100644 index 4f53f951..00000000 --- a/tools/obpemu/build.lua +++ /dev/null @@ -1,12 +0,0 @@ -cprogram { - ins = { - "tools/obpemu/main.c", - "tools/obpemu/emulator.c", - }, - outs = { "bin/obpemu" }, - ldflags = "-lreadline", -} - - - - diff --git a/tools/tubeemu/build.lua b/tools/tubeemu/build.lua deleted file mode 100644 index 0789c66a..00000000 --- a/tools/tubeemu/build.lua +++ /dev/null @@ -1,11 +0,0 @@ -cprogram { - ins = { - "tools/tubeemu/bbctube.c", - "third_party/lib6502/lib6502.c", - "third_party/lib6502/lib6502.h", - }, - outs = { "bin/tubeemu" } -} - - - From 5b4d5a3890d269b0b894bfd475f6980ebd0175ad Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:49 +0000 Subject: [PATCH 36/69] Generate consistent ninja files. --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 9d442d1b..8df12cec 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ export CFLAGS = -g -O0 export LDFLAGS = -g export NINJAFLAGS = +export PYTHONHASHSEED = 1 + #all: $(OBJ)/build.mk # @+make -f $(OBJ)/build.mk +all From b896b0e1cda29e80a843138c33598dc4575eeb72 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:49 +0000 Subject: [PATCH 37/69] Update documentation. --- doc/building.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/building.md b/doc/building.md index f986970a..e282a3fa 100644 --- a/doc/building.md +++ b/doc/building.md @@ -9,7 +9,7 @@ dependencies. - the Ninja build tool - - Lua 5.1 (needed for the build) + - Python 3 and Lua 5.1 (needed for the build) - the Pasmo Z80 assembler (needed to build part of the CP/M emulator) @@ -37,7 +37,7 @@ dependencies. If you're on a Debianish platform, you should be able to install them (after adding any custom package sources as above) with: - apt install ninja-build lua5.1 pasmo libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-linux-gnu binutils-m68k-atari-mint qemu-user gpp 64tass nasm + apt install ninja-build lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-linux-gnu binutils-m68k-atari-mint qemu-user gpp 64tass nasm python3 Once done you can build the compiler itself with: @@ -47,10 +47,10 @@ make ``` You'll be left with a lot of stuff in the `bin` directory. The tools are all -labeled as (name).(toolchain).(extension); however, several extensions also -contain a dot. So, `cowfe-65c02.ncpmz.z80.com` is cowfe, the main front-end -compiler, targeting the 65c02, built with the `ncpmz` toolchain, which produced -a `z80.com` executable. +labeled as (name)-for-(toolchain)-with-(toolchain). So, +`cowfe-for-65c02-with-ncpmz.com` is cowfe, the main front-end compiler, +targeting the 65c02, built with the `ncpmz` toolchain, which produced a `.com` +executable. From a9c2679286863445b876dd59d580cc49859d13c1 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:49 +0000 Subject: [PATCH 38/69] Fix out-of-range jump preventing some large PowerPC programs being assembled. --- rt/lxppc/file.coh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rt/lxppc/file.coh b/rt/lxppc/file.coh index 73838f5b..0094bca6 100644 --- a/rt/lxppc/file.coh +++ b/rt/lxppc/file.coh @@ -29,7 +29,8 @@ include "fileio.coh"; @asm "lwz 8, ", pos, "@l(8)"; @asm "li 0, 0xb3"; # pread64 @asm "sc"; - @asm "bsol ", _fix_errno; + @asm "bns . + 4"; + @asm "bl ", _fix_errno; @asm "lis 4, ", i, "@ha"; @asm "stw 3, ", i, "@l(4)"; @@ -58,7 +59,8 @@ end sub; @asm "lwz 8, ", pos, "@l(8)"; @asm "li 0, 0xb4"; # pwrite64 @asm "sc"; - @asm "bsol ", _fix_errno; + @asm "bns . + 4"; + @asm "bl ", _fix_errno; @asm "lis 4, ", i, "@ha"; @asm "stw 3, ", i, "@l(4)"; @@ -78,7 +80,8 @@ sub fcb_i_open(fcb: [FCB], filename: [uint8], flags: uint32): (errno: uint8) is @asm "li 5, ", 0o666; # umask @asm "li 0, 0x05"; # open @asm "sc"; - @asm "bsol ", _fix_errno; + @asm "bns . + 4"; + @asm "bl ", _fix_errno; @asm "lis 4, ", fd, "@ha"; @asm "stw 3, ", fd, "@l(4)"; if fd < 0 then From e7f61dde112c73ebbc497c1f83bac5c3047d301b Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:46:50 +0000 Subject: [PATCH 39/69] Cross-build most of the tools. --- bootstrap/build.py | 2 +- build.py | 11 +- examples/build.py | 3 +- src/build.py | 414 ----------------------------------------- src/cowasm/build.py | 13 +- src/cowbdmp/build.py | 3 +- src/cowbe/build.py | 3 +- src/cowdis/build.py | 3 +- src/cowfe/build.py | 5 +- src/cowlink/build.py | 10 +- src/cowwrap/build.py | 11 +- src/misc/build.py | 3 +- src/toolchains.py | 428 +++++++++++++++++++++++++++++++++++++++++++ tests/build.py | 3 +- 14 files changed, 477 insertions(+), 435 deletions(-) create mode 100644 src/toolchains.py diff --git a/bootstrap/build.py b/bootstrap/build.py index 7951ef97..4a6ddf6e 100644 --- a/bootstrap/build.py +++ b/bootstrap/build.py @@ -1,4 +1,4 @@ -from src.build import cgen +from src.toolchains import cgen cgen(name="cowfe", srcs=["./cowfe-cgen.bootstrap.c"]) cgen(name="cowbe", srcs=["./cowbe-cgen.bootstrap.c"]) diff --git a/build.py b/build.py index b0876e46..97c21ea4 100644 --- a/build.py +++ b/build.py @@ -21,11 +21,16 @@ "bin/basicify": "src/misc+basicify-with-nncgen", }, deps=[ - "third_party/djlink+djlink-programs", + "dist/cpm", + "dist/cpmz", "examples", + "src/cowasm", + "src/cowbe", + "src/cowfe", + "src/cowlink", + "src/cowwrap", "tests", - "dist/cpmz", - "dist/cpm", + "third_party/djlink+djlink-programs", ] + (["dist/msdos"] if config.has_msdos else []) + (["dist/ataritos"] if config.has_ataritos else []) diff --git a/examples/build.py b/examples/build.py index 7aeb5c8f..fb869ff9 100644 --- a/examples/build.py +++ b/examples/build.py @@ -1,4 +1,5 @@ -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS from build.ab2 import export PROGRAMS = [ diff --git a/src/build.py b/src/build.py index 983a0b56..00cc4bad 100644 --- a/src/build.py +++ b/src/build.py @@ -9,189 +9,10 @@ ) from build.c import cprogram from os.path import * -from third_party.zmac.build import zmac from types import SimpleNamespace -from build.tass64 import tass64 -from build.nasm import nasm -from third_party.djlink.build import djlink import config -@Rule -def cgen(self, name, srcs: Targets = []): - cprogram(replaces=self, srcs=srcs + ["rt/cgen/cowgol.h"]) - - -def buildgasimpl(self, prefix): - normalrule( - replaces=self, - ins=self.args["srcs"], - outs=[self.localname + ".elf"], - commands=[ - prefix + "-as -g {ins} -o {outs[0]}.s", - prefix + "-ld -g {outs[0]}.s -o {outs[0]}", - ], - label="ASM-" + prefix.upper(), - ) - - -@Rule -def buildgasarm(self, name, srcs: Targets = None): - buildgasimpl(self, "arm-linux-gnueabihf") - - -@Rule -def buildgas386(self, name, srcs: Targets = None): - buildgasimpl(self, "i686-linux-gnu") - - -@Rule -def buildgas68k(self, name, srcs: Targets = None): - buildgasimpl(self, "m68k-linux-gnu") - - -@Rule -def buildgasppc(self, name, srcs: Targets = None): - buildgasimpl(self, "powerpc-linux-gnu") - - -@Rule -def buildgasataritos(self, name, srcs: Targets = None): - buildgasimpl(self, "m68k-atari-mint") - - -@Rule -def buildtass64(self, name, srcs: Targets = None): - tass64(replaces=self, srcs=srcs) - - -def buildcowasmimpl(self, asm): - normalrule( - replaces=self, - ins=[asm] + self.args["srcs"], - outs=[self.localname + ".bin"], - commands=["scripts/quiet {ins[0]} -o {outs[0]} {ins[1]}"], - label="ASM", - ) - - -@Rule -def buildcowasmpdp11(self, name, srcs: Targets = None): - buildcowasmimpl(self, "src/cowasm+cowasm-for-pdp11-with-ncgen") - - -@Rule -def buildcowasm6303(self, name, srcs: Targets = None): - buildcowasmimpl(self, "src/cowasm+cowasm-for-6303-with-ncgen") - - -@Rule -def buildnasm(self, name, srcs: Targets = None): - o = nasm(name=name + "/obj", srcs=srcs) - djlink(replaces=self, srcs=[o]) - - -def testimpl(self, dep, command): - goodfile = self.args["goodfile"] - normalrule( - replaces=self, - ins=dep + [self.args["exe"]], - outs=[self.localname + ".bad"], - commands=[ - "timeout 5s " + command + " > {outs}; true", - "diff -u -w {outs[0]} " + filenameof(goodfile), - ], - label="TEST", - ) - - -@Rule -def nativetest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, [], "{ins[0]}") - - -@Rule -def tubeemutest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, ["tools/tubeemu"], "{ins[0]} -l 0x400 -e 0x400 -f {ins[1]}") - - -@Rule -def cpmtest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, ["tools/cpmemu"], "{ins[0]} {ins[1]}") - - -@Rule -def apouttest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, ["third_party/apout"], "{ins[0]} {ins[1]}") - - -@Rule -def fuzix6303test(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, ["tools/fuzix6303emu"], "{ins[0]} -f {ins[1]}") - - -@Rule -def ataritostest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, ["tools/ataritosemu"], "{ins[0]} {ins[1]}") - - -@Rule -def qemuarmtest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, [], "qemu-arm {ins[0]}") - - -@Rule -def qemu386test(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, [], "qemu-i386 {ins[0]}") - - -@Rule -def qemu68ktest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, [], "qemu-m68k {ins[0]}") - - -@Rule -def qemuppctest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, [], "qemu-ppc {ins[0]}") - - -@Rule -def msdostest(self, name, goodfile: Target = None, exe: Target = None): - testimpl(self, ["third_party/emu2"], "{ins[0]} {ins[1]}") - - -@Rule -def toolchain( - self, - name, - cowfe: Target = None, - cowbe: Target = None, - cowlink: Target = None, - cowwrap: Target = None, - runtime=None, - asmext=None, - binext=None, - assembler=None, - tester=None, -): - id = self.localname - - for k, v in self.args.items(): - setattr(self, k, v) - - items = {} - if cowfe: - items["bin/cowfe-" + id] = cowfe - if cowbe: - items["bin/cowbe-" + id] = cowbe - if cowlink: - items["bin/cowlink-" + id] = cowlink - if cowwrap: - items["bin/cowwrap-" + id] = cowwrap - - export(replaces=self, items=items) - - @Rule def cowlib( self, @@ -283,241 +104,6 @@ def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): ) -TOOLCHAINS = [] - -TOOLCHAINS.append( - toolchain( - name="ncgen", - cowfe="bootstrap+cowfe", - cowbe="bootstrap+cowbe", - cowlink="bootstrap+cowlink", - cowwrap="bootstrap+cowwrap", - runtime="rt/cgen", - asmext=".c", - binext=".exe", - assembler=cgen, - ) -) - -TOOLCHAINS.append( - toolchain( - name="nncgen", - cowfe="src/cowfe+cowfe-for-cgen-with-ncgen", - cowbe="src/cowbe+cowbe-for-cgen-with-ncgen", - cowlink="src/cowlink+cowlink-for-cgen-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/cgen", - asmext=".c", - binext=".exe", - assembler=cgen, - tester=nativetest, - ) -) - -TOOLCHAINS.append( - toolchain( - name="ncpm", - cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", - cowbe="src/cowbe+cowbe-for-8080-with-ncgen", - cowlink="src/cowlink+cowlink-for-8080-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/cpm", - asmext=".asm", - binext=".com", - assembler=zmac, - tester=cpmtest, - ) -) - -TOOLCHAINS.append( - toolchain( - name="ncpmz", - cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", - cowbe="src/cowbe+cowbe-for-z80-with-ncgen", - cowlink="src/cowlink+cowlink-for-8080-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/cpmz", - asmext=".z80", - binext=".com", - assembler=zmac, - tester=cpmtest, - ) -) - -TOOLCHAINS.append( - toolchain( - name="unixv7", - cowfe="src/cowfe+cowfe-for-pdp11-with-nncgen", - cowbe="src/cowbe+cowbe-for-pdp11-with-ncgen", - cowlink="src/cowlink+cowlink-for-v7unix-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/unixv7", - asmext=".asm", - binext=".exe", - assembler=buildcowasmpdp11, - tester=apouttest, - ) -) - -TOOLCHAINS.append( - toolchain( - name="fuzix6303", - cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", - cowbe="src/cowbe+cowbe-for-6303-with-ncgen", - cowlink="src/cowlink+cowlink-for-fuzix6303-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/fuzix6303", - asmext=".asm", - binext=".exe", - assembler=buildcowasm6303, - tester=fuzix6303test, - ) -) - -if config.has_lxthumb2: - TOOLCHAINS.append( - toolchain( - name="lxthumb2", - cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", - cowbe="src/cowbe+cowbe-for-thumb2-with-ncgen", - cowlink="src/cowlink+cowlink-for-lxthumb2-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lxthumb2", - asmext=".s", - binext=".exe", - assembler=buildgasarm, - tester=qemuarmtest if config.has_qemuarm else None, - ) - ) - -if config.has_lx386: - TOOLCHAINS.append( - toolchain( - name="lx386", - cowfe="src/cowfe+cowfe-for-80386-with-nncgen", - cowbe="src/cowbe+cowbe-for-80386-with-ncgen", - cowlink="src/cowlink+cowlink-for-lx386-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lx386", - asmext=".s", - binext=".exe", - assembler=buildgas386, - tester=qemu386test if config.has_qemu386 else None, - ) - ) - -if config.has_lx68k: - TOOLCHAINS.append( - toolchain( - name="lx68k", - cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", - cowbe="src/cowbe+cowbe-for-68000-with-ncgen", - cowlink="src/cowlink+cowlink-for-lx68k-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lx68k", - asmext=".s", - binext=".exe", - assembler=buildgas68k, - tester=qemu68ktest if config.has_qemu68k else None, - ) - ) - -if config.has_lxppc: - TOOLCHAINS.append( - toolchain( - name="lxppc", - cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", - cowbe="src/cowbe+cowbe-for-powerpc-with-ncgen", - cowlink="src/cowlink+cowlink-for-lxppc-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/lxppc", - asmext=".s", - binext=".exe", - assembler=buildgasppc, - tester=qemuppctest if config.has_qemuppc else None, - ) - ) - -if config.has_bbct: - TOOLCHAINS.append( - toolchain( - name="bbct", - cowfe="src/cowfe+cowfe-for-6502-with-nncgen", - cowbe="src/cowbe+cowbe-for-65c02-with-ncgen", - cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/bbct", - asmext=".asm", - binext=".bin", - assembler=buildtass64, - tester=tubeemutest, - ) - ) - -if config.has_bbctiny: - TOOLCHAINS.append( - toolchain( - name="bbctiny", - cowfe="src/cowfe+cowfe-for-6502-with-nncgen", - cowbe="src/cowbe+cowbe-for-65c02-tiny-with-ncgen", - cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/bbct", - asmext=".asm", - binext=".bin", - assembler=buildtass64, - tester=tubeemutest, - ) - ) - -if config.has_bbct6502: - TOOLCHAINS.append( - toolchain( - name="bbct6502", - cowfe="src/cowfe+cowfe-for-6502-with-nncgen", - cowbe="src/cowbe+cowbe-for-6502-with-ncgen", - cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/bbct", - asmext=".asm", - binext=".bin", - assembler=buildtass64, - tester=tubeemutest, - ) - ) - -if config.has_msdos: - TOOLCHAINS.append( - toolchain( - name="msdos", - cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", - cowbe="src/cowbe+cowbe-for-8086-with-ncgen", - cowlink="src/cowlink+cowlink-for-msdos-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/msdos", - asmext=".asm", - binext=".exe", - assembler=buildnasm, - tester=msdostest, - ) - ) - -if config.has_ataritos: - TOOLCHAINS.append( - toolchain( - name="ataritos", - cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", - cowbe="src/cowbe+cowbe-for-68000-with-ncgen", - cowlink="src/cowlink+cowlink-for-ataritos-with-ncgen", - cowwrap="src/cowwrap+cowwrap-with-ncgen", - runtime="rt/ataritos", - asmext=".asm", - binext=".tos", - assembler=buildgasataritos, - tester=ataritostest, - ) - ) - normalrule( name="midcodesfecoh", ins=[ diff --git a/src/cowasm/build.py b/src/cowasm/build.py index b9a1eee4..c99bb15d 100644 --- a/src/cowasm/build.py +++ b/src/cowasm/build.py @@ -1,14 +1,17 @@ -from build.ab2 import normalrule -from src.build import TOOLCHAINS, cowgol +from build.ab2 import normalrule, export +from src.build import cowgol from tools.newgen.build import newgencowgol +from src.toolchains import TOOLCHAINS ARCHS = ["8080", "pdp11", "6303", "tlcs90", "obp"] +items = {} for toolchain in TOOLCHAINS: toolchain.materialise() for arch in ARCHS: - cowgol( - name="cowasm-for-" + arch + "-with-" + toolchain.localname, + name = "cowasm-for-" + arch + "-with-" + toolchain.localname + items[name] = cowgol( + name=name, toolchain=toolchain, srcs=[ "./arch" + arch + ".cow", @@ -16,3 +19,5 @@ "./stdsyms.coh", ], ) + +export(name="cowasm", items=items) diff --git a/src/cowbdmp/build.py b/src/cowbdmp/build.py index 81b97c7a..85bcace0 100644 --- a/src/cowbdmp/build.py +++ b/src/cowbdmp/build.py @@ -1,5 +1,6 @@ from build.ab2 import normalrule -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS for toolchain in TOOLCHAINS: cowgol( diff --git a/src/cowbe/build.py b/src/cowbe/build.py index 56c634bb..9e25119c 100644 --- a/src/cowbe/build.py +++ b/src/cowbe/build.py @@ -1,5 +1,6 @@ from build.ab2 import normalrule, export -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS from tools.newgen.build import newgencowgol ARCHS = [ diff --git a/src/cowdis/build.py b/src/cowdis/build.py index 09b7240f..b4b4017a 100644 --- a/src/cowdis/build.py +++ b/src/cowdis/build.py @@ -1,5 +1,6 @@ from build.ab2 import normalrule -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS ARCHS = ["tlcs90"] diff --git a/src/cowfe/build.py b/src/cowfe/build.py index 88004c42..711984e4 100644 --- a/src/cowfe/build.py +++ b/src/cowfe/build.py @@ -1,5 +1,6 @@ from build.ab2 import normalrule, export -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS from third_party.lemon.build import lemoncowgol ARCHS = [ @@ -51,3 +52,5 @@ "src+midcodesfecoh", ], ) + +export(name="cowfe", items=items) diff --git a/src/cowlink/build.py b/src/cowlink/build.py index efbd366a..31c9d738 100644 --- a/src/cowlink/build.py +++ b/src/cowlink/build.py @@ -1,5 +1,6 @@ -from build.ab2 import normalrule -from src.build import TOOLCHAINS, cowgol +from build.ab2 import normalrule, export +from src.build import cowgol +from src.toolchains import TOOLCHAINS ARCHS = [ "8080", @@ -27,9 +28,11 @@ label="COPY", ) +items = {} for toolchain in TOOLCHAINS: for arch in ARCHS: - cowgol( + name = "cowlink-for-" + arch + "-with-" + toolchain.localname + items[name] = cowgol( name="cowlink-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, srcs=[ @@ -45,3 +48,4 @@ "./utils.coh", ], ) +export(name="cowlink", items=items) diff --git a/src/cowwrap/build.py b/src/cowwrap/build.py index a55e1df4..13f9a5ce 100644 --- a/src/cowwrap/build.py +++ b/src/cowwrap/build.py @@ -1,8 +1,11 @@ -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol, export +from src.toolchains import TOOLCHAINS +items = {} for toolchain in TOOLCHAINS: - cowgol( - name="cowwrap-with-" + toolchain.localname, + name = "cowwrap-with-" + toolchain.localname + items[name] = cowgol( + name=name, toolchain=toolchain, srcs=[ "include/coodecls.coh", @@ -11,3 +14,5 @@ "./reader.coh", ], ) + +export(name="cowwrap", items=items) diff --git a/src/misc/build.py b/src/misc/build.py index 7b8b84de..4359b20a 100644 --- a/src/misc/build.py +++ b/src/misc/build.py @@ -1,5 +1,6 @@ from build.ab2 import normalrule -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS PROGRAMS = ["basicify"] diff --git a/src/toolchains.py b/src/toolchains.py new file mode 100644 index 00000000..e8e72cac --- /dev/null +++ b/src/toolchains.py @@ -0,0 +1,428 @@ +from build.ab2 import ( + Rule, + Target, + Targets, + export, + normalrule, + filenamesof, + filenameof, +) +from build.c import cprogram +from os.path import * +from third_party.zmac.build import zmac +from types import SimpleNamespace +from build.tass64 import tass64 +from build.nasm import nasm +from third_party.djlink.build import djlink +import config + + +@Rule +def cgen(self, name, srcs: Targets = []): + cprogram(replaces=self, srcs=srcs + ["rt/cgen/cowgol.h"]) + + +def buildgasimpl(self, prefix, flags=""): + normalrule( + replaces=self, + ins=self.args["srcs"], + outs=[self.localname + ".elf"], + commands=[ + prefix + "-as " + flags + " -g {ins} -o {outs[0]}.s", + prefix + "-ld -g {outs[0]}.s -o {outs[0]}", + ], + label="ASM-" + prefix.upper(), + ) + + +@Rule +def buildgasarm(self, name, srcs: Targets = None): + buildgasimpl(self, "arm-linux-gnueabihf") + + +@Rule +def buildgas386(self, name, srcs: Targets = None): + buildgasimpl(self, "i686-linux-gnu") + + +@Rule +def buildgas68k(self, name, srcs: Targets = None): + buildgasimpl(self, "m68k-linux-gnu") + + +@Rule +def buildgasppc(self, name, srcs: Targets = None): + buildgasimpl(self, "powerpc-linux-gnu") + + +@Rule +def buildgasataritos(self, name, srcs: Targets = None): + buildgasimpl(self, "m68k-atari-mint") + + +@Rule +def buildtass64(self, name, srcs: Targets = None): + tass64(replaces=self, srcs=srcs) + + +def buildcowasmimpl(self, asm): + normalrule( + replaces=self, + ins=[asm] + self.args["srcs"], + outs=[self.localname + ".bin"], + commands=["scripts/quiet {ins[0]} -o {outs[0]} {ins[1]}"], + label="ASM", + ) + + +@Rule +def buildcowasmpdp11(self, name, srcs: Targets = None): + buildcowasmimpl(self, "src/cowasm+cowasm-for-pdp11-with-ncgen") + + +@Rule +def buildcowasm6303(self, name, srcs: Targets = None): + buildcowasmimpl(self, "src/cowasm+cowasm-for-6303-with-ncgen") + + +@Rule +def buildnasm(self, name, srcs: Targets = None): + o = nasm(name=name + "/obj", srcs=srcs) + djlink(replaces=self, srcs=[o]) + + +def testimpl(self, dep, command): + goodfile = self.args["goodfile"] + normalrule( + replaces=self, + ins=dep + [self.args["exe"]], + outs=[self.localname + ".bad"], + commands=[ + "timeout 5s " + command + " > {outs}; true", + "diff -u -w {outs[0]} " + filenameof(goodfile), + ], + label="TEST", + ) + + +@Rule +def nativetest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, [], "{ins[0]}") + + +@Rule +def tubeemutest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, ["tools/tubeemu"], "{ins[0]} -l 0x400 -e 0x400 -f {ins[1]}") + + +@Rule +def cpmtest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, ["tools/cpmemu"], "{ins[0]} {ins[1]}") + + +@Rule +def apouttest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, ["third_party/apout"], "{ins[0]} {ins[1]}") + + +@Rule +def fuzix6303test(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, ["tools/fuzix6303emu"], "{ins[0]} -f {ins[1]}") + + +@Rule +def ataritostest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, ["tools/ataritosemu"], "{ins[0]} {ins[1]}") + + +@Rule +def qemuarmtest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, [], "qemu-arm {ins[0]}") + + +@Rule +def qemu386test(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, [], "qemu-i386 {ins[0]}") + + +@Rule +def qemu68ktest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, [], "qemu-m68k {ins[0]}") + + +@Rule +def qemuppctest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, [], "qemu-ppc {ins[0]}") + + +@Rule +def msdostest(self, name, goodfile: Target = None, exe: Target = None): + testimpl(self, ["third_party/emu2"], "{ins[0]} {ins[1]}") + + +@Rule +def toolchain( + self, + name, + cowfe: Target = None, + cowbe: Target = None, + cowlink: Target = None, + cowwrap: Target = None, + runtime=None, + asmext=None, + binext=None, + assembler=None, + tester=None, +): + id = self.localname + + for k, v in self.args.items(): + setattr(self, k, v) + + items = {} + if cowfe: + items["bin/cowfe-" + id] = cowfe + if cowbe: + items["bin/cowbe-" + id] = cowbe + if cowlink: + items["bin/cowlink-" + id] = cowlink + if cowwrap: + items["bin/cowwrap-" + id] = cowwrap + + export(replaces=self, items=items) + + +TOOLCHAINS = [] + +TOOLCHAINS.append( + toolchain( + name="ncgen", + cowfe="bootstrap+cowfe", + cowbe="bootstrap+cowbe", + cowlink="bootstrap+cowlink", + cowwrap="bootstrap+cowwrap", + runtime="rt/cgen", + asmext=".c", + binext=".exe", + assembler=cgen, + ) +) + +TOOLCHAINS.append( + toolchain( + name="nncgen", + cowfe="src/cowfe+cowfe-for-cgen-with-ncgen", + cowbe="src/cowbe+cowbe-for-cgen-with-ncgen", + cowlink="src/cowlink+cowlink-for-cgen-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/cgen", + asmext=".c", + binext=".exe", + assembler=cgen, + tester=nativetest, + ) +) + +TOOLCHAINS.append( + toolchain( + name="ncpm", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-8080-with-ncgen", + cowlink="src/cowlink+cowlink-for-8080-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/cpm", + asmext=".asm", + binext=".com", + assembler=zmac, + tester=cpmtest, + ) +) + +TOOLCHAINS.append( + toolchain( + name="ncpmz", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-z80-with-ncgen", + cowlink="src/cowlink+cowlink-for-8080-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/cpmz", + asmext=".z80", + binext=".com", + assembler=zmac, + tester=cpmtest, + ) +) + +TOOLCHAINS.append( + toolchain( + name="unixv7", + cowfe="src/cowfe+cowfe-for-pdp11-with-nncgen", + cowbe="src/cowbe+cowbe-for-pdp11-with-ncgen", + cowlink="src/cowlink+cowlink-for-v7unix-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/unixv7", + asmext=".asm", + binext=".exe", + assembler=buildcowasmpdp11, + tester=apouttest, + ) +) + +TOOLCHAINS.append( + toolchain( + name="fuzix6303", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-6303-with-ncgen", + cowlink="src/cowlink+cowlink-for-fuzix6303-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/fuzix6303", + asmext=".asm", + binext=".exe", + assembler=buildcowasm6303, + tester=fuzix6303test, + ) +) + +if config.has_lxthumb2: + TOOLCHAINS.append( + toolchain( + name="lxthumb2", + cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", + cowbe="src/cowbe+cowbe-for-thumb2-with-ncgen", + cowlink="src/cowlink+cowlink-for-lxthumb2-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lxthumb2", + asmext=".s", + binext=".exe", + assembler=buildgasarm, + tester=qemuarmtest if config.has_qemuarm else None, + ) + ) + +if config.has_lx386: + TOOLCHAINS.append( + toolchain( + name="lx386", + cowfe="src/cowfe+cowfe-for-80386-with-nncgen", + cowbe="src/cowbe+cowbe-for-80386-with-ncgen", + cowlink="src/cowlink+cowlink-for-lx386-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lx386", + asmext=".s", + binext=".exe", + assembler=buildgas386, + tester=qemu386test if config.has_qemu386 else None, + ) + ) + +if config.has_lx68k: + TOOLCHAINS.append( + toolchain( + name="lx68k", + cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", + cowbe="src/cowbe+cowbe-for-68000-with-ncgen", + cowlink="src/cowlink+cowlink-for-lx68k-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lx68k", + asmext=".s", + binext=".exe", + assembler=buildgas68k, + tester=qemu68ktest if config.has_qemu68k else None, + ) + ) + +if config.has_lxppc: + TOOLCHAINS.append( + toolchain( + name="lxppc", + cowfe="src/cowfe+cowfe-for-32bita-with-nncgen", + cowbe="src/cowbe+cowbe-for-powerpc-with-ncgen", + cowlink="src/cowlink+cowlink-for-lxppc-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/lxppc", + asmext=".s", + binext=".exe", + assembler=buildgasppc, + tester=qemuppctest if config.has_qemuppc else None, + ) + ) + +if config.has_bbct: + TOOLCHAINS.append( + toolchain( + name="bbct", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-65c02-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + tester=tubeemutest, + ) + ) + +if config.has_bbctiny: + TOOLCHAINS.append( + toolchain( + name="bbctiny", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-65c02-tiny-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + tester=tubeemutest, + ) + ) + +if config.has_bbct6502: + TOOLCHAINS.append( + toolchain( + name="bbct6502", + cowfe="src/cowfe+cowfe-for-6502-with-nncgen", + cowbe="src/cowbe+cowbe-for-6502-with-ncgen", + cowlink="src/cowlink+cowlink-for-bbct-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/bbct", + asmext=".asm", + binext=".bin", + assembler=buildtass64, + tester=tubeemutest, + ) + ) + +if config.has_msdos: + TOOLCHAINS.append( + toolchain( + name="msdos", + cowfe="src/cowfe+cowfe-for-16bit-with-nncgen", + cowbe="src/cowbe+cowbe-for-8086-with-ncgen", + cowlink="src/cowlink+cowlink-for-msdos-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/msdos", + asmext=".asm", + binext=".exe", + assembler=buildnasm, + tester=msdostest, + ) + ) + +if config.has_ataritos: + TOOLCHAINS.append( + toolchain( + name="ataritos", + cowfe="src/cowfe+cowfe-for-32bita2-with-nncgen", + cowbe="src/cowbe+cowbe-for-68000-with-ncgen", + cowlink="src/cowlink+cowlink-for-ataritos-with-ncgen", + cowwrap="src/cowwrap+cowwrap-with-ncgen", + runtime="rt/ataritos", + asmext=".asm", + binext=".tos", + assembler=buildgasataritos, + tester=ataritostest, + ) + ) diff --git a/tests/build.py b/tests/build.py index a610b48e..f123282c 100644 --- a/tests/build.py +++ b/tests/build.py @@ -1,5 +1,6 @@ from build.ab2 import normalrule, Rule, Target, export -from src.build import TOOLCHAINS, cowgol +from src.build import cowgol +from src.toolchains import TOOLCHAINS TESTS = [ "addsub-16bit", From 86b9650be8baeca99b81331c426eac5e109479b3 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 5 Mar 2023 18:49:16 +0000 Subject: [PATCH 40/69] Typo fixes. --- examples/build.py | 1 - tests/build.py | 1 - 2 files changed, 2 deletions(-) diff --git a/examples/build.py b/examples/build.py index fb869ff9..6b6fd288 100644 --- a/examples/build.py +++ b/examples/build.py @@ -4,7 +4,6 @@ PROGRAMS = [ "argv", - "cowcalc", "file", "filetester", "helloworld", diff --git a/tests/build.py b/tests/build.py index f123282c..672cbfed 100644 --- a/tests/build.py +++ b/tests/build.py @@ -38,7 +38,6 @@ "mul-8bit-u", "nested-calls", "outputparams", - "passto", "pointers", "rangetypes", "recordinitialisers", From ec33ae1293df3937c6397575a0f7defb5e3b4a4d Mon Sep 17 00:00:00 2001 From: dg Date: Mon, 6 Mar 2023 19:06:34 +0000 Subject: [PATCH 41/69] Put the binaries in the right place! --- src/cowasm/build.py | 2 +- src/cowfe/build.py | 2 +- src/cowlink/build.py | 2 +- src/cowwrap/build.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cowasm/build.py b/src/cowasm/build.py index c99bb15d..94cdae3c 100644 --- a/src/cowasm/build.py +++ b/src/cowasm/build.py @@ -10,7 +10,7 @@ toolchain.materialise() for arch in ARCHS: name = "cowasm-for-" + arch + "-with-" + toolchain.localname - items[name] = cowgol( + items["bin/" + name] = cowgol( name=name, toolchain=toolchain, srcs=[ diff --git a/src/cowfe/build.py b/src/cowfe/build.py index 711984e4..769b8137 100644 --- a/src/cowfe/build.py +++ b/src/cowfe/build.py @@ -29,7 +29,7 @@ for toolchain in TOOLCHAINS: for arch in ARCHS: name = "cowfe-for-" + arch + "-with-" + toolchain.localname - items[name] = cowgol( + items["bin/" + name] = cowgol( name="cowfe-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, srcs=[ diff --git a/src/cowlink/build.py b/src/cowlink/build.py index 31c9d738..b26d1153 100644 --- a/src/cowlink/build.py +++ b/src/cowlink/build.py @@ -32,7 +32,7 @@ for toolchain in TOOLCHAINS: for arch in ARCHS: name = "cowlink-for-" + arch + "-with-" + toolchain.localname - items[name] = cowgol( + items["bin/" + name] = cowgol( name="cowlink-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, srcs=[ diff --git a/src/cowwrap/build.py b/src/cowwrap/build.py index 13f9a5ce..7f80e018 100644 --- a/src/cowwrap/build.py +++ b/src/cowwrap/build.py @@ -4,7 +4,7 @@ items = {} for toolchain in TOOLCHAINS: name = "cowwrap-with-" + toolchain.localname - items[name] = cowgol( + items["bin/" + name] = cowgol( name=name, toolchain=toolchain, srcs=[ From 8bd6277b7476c3c289afb0e3078d7d7929e74314 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 16 Jan 2024 23:57:35 +0100 Subject: [PATCH 42/69] Split the ncpm and ncpmz platforms, so they don't use the same linker (which only worked because the z80 assembler I was using understood 8080 instructions...). --HG-- branch : bazel --- dist/cpm/build.lua | 8 +-- dist/cpmbasic/build.lua | 8 +-- dist/cpmz/build.lua | 6 +-- src/cowlink/{arch8080.coh => archncpm.coh} | 0 src/cowlink/archncpmz.coh | 59 ++++++++++++++++++++++ src/cowlink/build.lua | 3 +- toolchains.lua | 12 ++--- 7 files changed, 78 insertions(+), 18 deletions(-) rename src/cowlink/{arch8080.coh => archncpm.coh} (100%) create mode 100644 src/cowlink/archncpmz.coh diff --git a/dist/cpm/build.lua b/dist/cpm/build.lua index e8cc8c79..94025430 100644 --- a/dist/cpm/build.lua +++ b/dist/cpm/build.lua @@ -43,22 +43,22 @@ copy { } copy { - ins = { "bin/cowfe-16bit.ncpm.8080.com" }, + ins = { "bin/cowfe-16bit.ncpm.ncpm.com" }, outs = { "$OBJ/dist/cpm/cowfe.com" } } copy { - ins = { "bin/cowbe-8080.ncpm.8080.com" }, + ins = { "bin/cowbe-8080.ncpm.ncpm.com" }, outs = { "$OBJ/dist/cpm/cowbe.com" } } copy { - ins = { "bin/cowlink-8080.ncpm.8080.com" }, + ins = { "bin/cowlink-ncpm.ncpm.ncpm.com" }, outs = { "$OBJ/dist/cpm/cowlink.com" } } copy { - ins = { "bin/cowasm-8080.ncpm.8080.com" }, + ins = { "bin/cowasm-8080.ncpm.ncpm.com" }, outs = { "$OBJ/dist/cpm/cowasm.com" } } diff --git a/dist/cpmbasic/build.lua b/dist/cpmbasic/build.lua index 301b8d21..e37f1ac3 100644 --- a/dist/cpmbasic/build.lua +++ b/dist/cpmbasic/build.lua @@ -33,22 +33,22 @@ cpmify { } copy { - ins = { "bin/cowfe-basic.ncpmz.z80.com" }, + ins = { "bin/cowfe-basic.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmbasic/cowfe.com" } } copy { - ins = { "bin/cowbe-basic.ncpmz.z80.com" }, + ins = { "bin/cowbe-basic.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmbasic/cowbe.com" } } copy { - ins = { "bin/cowlink-basic.ncpmz.z80.com" }, + ins = { "bin/cowlink-basic.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmbasic/cowlink.com" } } copy { - ins = { "bin/basicify.ncpmz.z80.com" }, + ins = { "bin/basicify.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmbasic/basicify.com" } } diff --git a/dist/cpmz/build.lua b/dist/cpmz/build.lua index 48bdf0e8..8eae153e 100644 --- a/dist/cpmz/build.lua +++ b/dist/cpmz/build.lua @@ -43,17 +43,17 @@ copy { } copy { - ins = { "bin/cowfe-16bit.ncpmz.z80.com" }, + ins = { "bin/cowfe-16bit.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmz/cowfe.com" } } copy { - ins = { "bin/cowbe-z80.ncpmz.z80.com" }, + ins = { "bin/cowbe-z80.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmz/cowbe.com" } } copy { - ins = { "bin/cowlink-8080.ncpmz.z80.com" }, + ins = { "bin/cowlink-ncpmz.ncpmz.ncpmz.com" }, outs = { "$OBJ/dist/cpmz/cowlink.com" } } diff --git a/src/cowlink/arch8080.coh b/src/cowlink/archncpm.coh similarity index 100% rename from src/cowlink/arch8080.coh rename to src/cowlink/archncpm.coh diff --git a/src/cowlink/archncpmz.coh b/src/cowlink/archncpmz.coh new file mode 100644 index 00000000..e9faaf60 --- /dev/null +++ b/src/cowlink/archncpmz.coh @@ -0,0 +1,59 @@ +const STACK_SIZE := 128; + +var workspaceSize: Size[NUM_WORKSPACES]; + +sub E_nl() is + E_b8('\n'); +end sub; + +sub ArchAlignUp(value: Size, alignment: uint8): (newvalue: Size) is + newvalue := value; +end sub; + +sub ArchEmitSubRef(subr: [Subroutine]) is + E_b8('f'); + E_u16(subr.id); + E_b8('_'); + E(subr.name); +end sub; + +sub ArchEmitWSRef(wid: uint8, address: Size) is + E("ws+"); + E_u16(address); +end sub; + +sub ArchEmitHeader(coo: [Coo]) is + E("\torg 100h\n"); + + E("\tld sp, TOP+"); + E_u16(STACK_SIZE); + E_nl(); + + while coo != (0 as [Coo]) loop + var main := coo.index.subroutines[0]; + if main != (0 as [Subroutine]) then + E("\tcall "); + ArchEmitSubRef(main); + E_nl(); + end if; + coo := coo.next; + end loop; + + E("\trst 0\n"); +end sub; + +sub ArchEmitFooter(coo: [Coo]) is + E("TOP:\n"); + + E("ws equ TOP+"); + E_u16(STACK_SIZE); + E_nl(); + + E("LOMEM equ ws+"); + E_u16(workspaceSize[0]); + E_nl(); + + E("\tend\n"); + E_b8(26); +end sub; + diff --git a/src/cowlink/build.lua b/src/cowlink/build.lua index 567d7fea..b15e521d 100644 --- a/src/cowlink/build.lua +++ b/src/cowlink/build.lua @@ -1,10 +1,11 @@ local ARCHS = { - "8080", "ataritos", "basic", "bbct", "bbctn", "cgen", + "ncpm", + "ncpmz", "fuzix6303", "lx386", "lx68k", diff --git a/toolchains.lua b/toolchains.lua index 7ea33425..5047017f 100644 --- a/toolchains.lua +++ b/toolchains.lua @@ -38,11 +38,11 @@ toolchain_ncpm = { name = "ncpm", cowfe = "bin/cowfe-16bit.nncgen.exe", cowbe = "bin/cowbe-8080.nncgen.exe", - linker = "bin/cowlink-8080.nncgen.exe", + linker = "bin/cowlink-ncpm.nncgen.exe", assembler = buildcowasm8080, runtime = "rt/cpm", asmext = ".asm", - binext = ".8080.com", + binext = ".ncpm.com", tester = cpmtest, } @@ -50,11 +50,11 @@ toolchain_ncpmz = { name = "ncpmz", cowfe = "bin/cowfe-16bit.nncgen.exe", cowbe = "bin/cowbe-z80.nncgen.exe", - linker = "bin/cowlink-8080.nncgen.exe", + linker = "bin/cowlink-ncpmz.nncgen.exe", assembler = buildzmac, runtime = "rt/cpmz", asmext = ".z80", - binext = ".z80.com", + binext = ".ncpmz.com", tester = cpmtest, } @@ -116,7 +116,7 @@ toolchain_bbct = { asmext = ".asm", binext = ".bbct", tester = tubeemutest, - archs = { "8080" } + archs = { "cpm" } } toolchain_bbctiny = { @@ -141,7 +141,7 @@ toolchain_bbct6502 = { asmext = ".asm", binext = ".bbct6502", tester = tubeemutest, - archs = { "8080" }, + archs = { "cpm" }, } toolchain_unixv7 = { From d512b6b8012c4bdbddc1dd81587bd8e0159e3d67 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 17 Jan 2024 20:24:19 +0100 Subject: [PATCH 43/69] Fix incorrect casting of 16 bit to 32 bit signed values on the Z80. Add tests for this. --HG-- branch : bazel --- src/cowbe/archz80.cow.ng | 2 +- tests/casts.good | 8 ++++++++ tests/casts.test.cow | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/cowbe/archz80.cow.ng b/src/cowbe/archz80.cow.ng index ffc07bf8..632dbeea 100644 --- a/src/cowbe/archz80.cow.ng +++ b/src/cowbe/archz80.cow.ng @@ -1881,7 +1881,7 @@ gen hlhl := CAST24(hl, sext==0) gen hlhl := CAST24(hl, sext!=0) uses a { - E_mov(REG_A, REG_L); + E_mov(REG_A, REG_H); E_add(REG_A, REG_A); E_sbc(REG_A, REG_A); E_exx(); diff --git a/tests/casts.good b/tests/casts.good index 10bf83d6..bcb1e87e 100644 --- a/tests/casts.good +++ b/tests/casts.good @@ -25,6 +25,10 @@ mone as uint8: yes mone as uint32: yes mone as int8: yes mone as int32: yes +twohundred as uint8: yes +twohundred as uint32: yes +twohundred as int8: yes +twohundred as int32: yes casts2 one as uint8: yes one as uint32: yes @@ -34,6 +38,10 @@ mone as uint8: yes mone as uint32: yes mone as int8: yes mone as int32: yes +twohundred as uint8: yes +twohundred as uint32: yes +twohundred as int8: yes +twohundred as int32: yes castu4 one as uint8: yes one as uint16: yes diff --git a/tests/casts.test.cow b/tests/casts.test.cow index 03234c1e..e95c08dd 100644 --- a/tests/casts.test.cow +++ b/tests/casts.test.cow @@ -36,6 +36,7 @@ casts1(); sub castu2() is var one: uint16 := 1; var mone: uint16 := -1; + var twohundred: uint16 := 200; print("castu2\n"); print("one as uint8"); if (one as uint8) == 1 then yes(); else no(); end if; @@ -46,12 +47,17 @@ sub castu2() is print("mone as uint32"); if (mone as uint32) == 0xffff then yes(); else no(); end if; print("mone as int8"); if (mone as int8) == -1 then yes(); else no(); end if; print("mone as int32"); if (mone as int32) == 0xffff then yes(); else no(); end if; + print("twohundred as uint8"); if (twohundred as uint8) == 200 then yes(); else no(); end if; + print("twohundred as uint32"); if (twohundred as uint32) == 200 then yes(); else no(); end if; + print("twohundred as int8"); if (twohundred as int8) == 200 then yes(); else no(); end if; + print("twohundred as int32"); if (twohundred as int32) == 200 then yes(); else no(); end if; end sub; castu2(); sub casts2() is var one: int16 := 1; var mone: int16 := -1; + var twohundred: int16 := 200; print("casts2\n"); print("one as uint8"); if (one as uint8) == 1 then yes(); else no(); end if; @@ -62,6 +68,10 @@ sub casts2() is print("mone as uint32"); if (mone as uint32) == 0xffffffff then yes(); else no(); end if; print("mone as int8"); if (mone as int8) == -1 then yes(); else no(); end if; print("mone as int32"); if (mone as int32) == -1 then yes(); else no(); end if; + print("twohundred as uint8"); if (twohundred as uint8) == 200 then yes(); else no(); end if; + print("twohundred as uint32"); if (twohundred as uint32) == 200 then yes(); else no(); end if; + print("twohundred as int8"); if (twohundred as int8) == 200 then yes(); else no(); end if; + print("twohundred as int32"); if (twohundred as int32) == 200 then yes(); else no(); end if; end sub; casts2(); From 434804f14afb062f806419a76c88a7a168c22365 Mon Sep 17 00:00:00 2001 From: David Given Date: Sun, 18 Feb 2024 16:24:09 +0100 Subject: [PATCH 44/69] Fix stupid bug where attempting to load A from a pointer would write to memory rather than reading from it. --- src/cowbe/archz80.cow.ng | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/cowbe/archz80.cow.ng b/src/cowbe/archz80.cow.ng index ffc07bf8..057d7de9 100644 --- a/src/cowbe/archz80.cow.ng +++ b/src/cowbe/archz80.cow.ng @@ -249,10 +249,9 @@ sub E_ldax(ptr: RegId) is R_flush(REG_A); - E("\tld ("); + E("\tld a, ("); E_reg(ptr); - E("), a\n"); - E_nl(); + E(")\n"); end sub; sub E_lda(sym: [Symbol], off: Size) is From a4e1444d16195bc2b1d0c0bc2a0072cc18c786d7 Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 25 Mar 2024 00:04:01 +0100 Subject: [PATCH 45/69] Fix some 8080 and Z80 code generation issues where DIV and REM weren't marking HL as being in use, resulting in occasional register corruption. --- src/cowbe/arch8080.cow.ng | 6 +++--- src/cowbe/archz80.cow.ng | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cowbe/arch8080.cow.ng b/src/cowbe/arch8080.cow.ng index 9d057ec9..034665e7 100644 --- a/src/cowbe/arch8080.cow.ng +++ b/src/cowbe/arch8080.cow.ng @@ -1085,16 +1085,16 @@ gen bc|de|hl := SUB2(bc|de|hl:lhs, CONSTANT():c) uses a aluop2i($lhs, $c.value as uint16, $$, "sui", "sbi"); } -gen de := DIVU2(de, bc) uses a +gen de := DIVU2(de, bc) uses a|hl { dvrmu2(); } gen hl := REMU2(de, bc) uses a { dvrmu2(); } -gen de := DIVS2(de, bc) uses a +gen de := DIVS2(de, bc) uses a|hl { dvrms2(); } -gen hl := REMS2(de, bc) uses a +gen hl := REMS2(de, bc) uses a|hl { dvrms2(); } gen hl := MUL2(hl, de) uses a|bc diff --git a/src/cowbe/archz80.cow.ng b/src/cowbe/archz80.cow.ng index 726d6a60..9060474a 100644 --- a/src/cowbe/archz80.cow.ng +++ b/src/cowbe/archz80.cow.ng @@ -1423,16 +1423,16 @@ gen hl := SUB2(hl:lhs, bc|de:rhs) %} -gen bc := DIVU2(bc, de) uses a +gen bc := DIVU2(bc, de) uses a|hl { E_dvrmu2(); } gen hl := REMU2(bc, de) uses a { E_dvrmu2(); } -gen bc := DIVS2(bc, de) uses a +gen bc := DIVS2(bc, de) uses a|hl { E_dvrms2(); } -gen de := REMS2(bc, de) uses a +gen de := REMS2(bc, de) uses a|hl { E_dvrms2(); } gen hl := MUL2(de, bc) uses a @@ -1550,7 +1550,7 @@ gen hlhl := REMU4(bcbc, dede) uses a gen bcbc := DIVS4(bcbc, dede) uses a|hlhl { E_callhelper("_dvrms4"); } -gen dede := REMS4(bcbc, dede) uses a +gen dede := REMS4(bcbc, dede) uses a|hlhl { E_callhelper("_dvrms4"); } gen hlhl := AND4(dede, hlhl) uses a From 58cef27bee7c27d1fd689e1496cc18085f4d2847 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 29 Mar 2024 19:06:23 +0100 Subject: [PATCH 46/69] Switch build system to ab. --- .github/workflows/ccpp.yml | 2 +- Makefile | 30 +-- build.py | 2 +- build/{ab2.py => ab.py} | 444 +++++++++++++++++---------------- build/c.py | 307 +++++++++++++++++------ build/gpp.py | 2 +- build/nasm.py | 2 +- build/tass64.py | 2 +- build/yacc.py | 2 +- dist/ataritos/build.py | 2 +- dist/bbct/build.py | 16 +- dist/cpm/build.py | 4 +- dist/cpmz/build.py | 4 +- dist/msdos/build.py | 2 +- examples/build.py | 2 +- scripts/quiet | 15 -- src/build.py | 21 +- src/cowasm/build.py | 2 +- src/cowbdmp/build.py | 2 +- src/cowbe/build.py | 4 +- src/cowdis/build.py | 2 +- src/cowfe/build.py | 6 +- src/cowlink/build.py | 4 +- src/cowwrap/build.py | 3 +- src/misc/build.py | 2 +- src/toolchains.py | 4 +- tests/build.py | 2 +- third_party/apout/build.py | 8 +- third_party/djlink/build.py | 8 +- third_party/emu2/build.py | 2 +- third_party/lemon/build.py | 2 +- third_party/lib6502/build.py | 2 +- third_party/musashi/build.py | 4 +- third_party/rc2014emu/build.py | 2 +- third_party/zmac/build.py | 9 +- tools/ataritosemu/build.py | 2 +- tools/build.py | 2 +- tools/cpmemu/build.py | 6 +- tools/fuzix6303emu/build.py | 2 +- tools/lx68kemu/build.py | 2 +- tools/newgen/build.py | 8 +- tools/obpemu/build.py | 2 +- 42 files changed, 535 insertions(+), 416 deletions(-) rename build/{ab2.py => ab.py} (54%) delete mode 100755 scripts/quiet diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index d8af975a..74cba87f 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -12,7 +12,7 @@ jobs: - name: add-apt-repository run: sudo add-apt-repository ppa:vriviere/ppa -y - name: apt - run: sudo apt install ninja-build lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm + run: sudo apt install chronic lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm - name: make run: make NINJAFLAGS=-k1 diff --git a/Makefile b/Makefile index 8df12cec..65ebdcc3 100644 --- a/Makefile +++ b/Makefile @@ -7,31 +7,9 @@ export CFLAGS = -g -O0 export LDFLAGS = -g export NINJAFLAGS = -export PYTHONHASHSEED = 1 +.PHONY: all +all: +all -#all: $(OBJ)/build.mk -# @+make -f $(OBJ)/build.mk +all - -all: $(OBJ)/build.ninja - @ninja -f $< +all - -clean: - @echo CLEAN - @rm -rf $(OBJ) bin - -build-files = $(shell find . -name 'build.py') build/*.py config.py -$(OBJ)/build.mk: Makefile $(build-files) - @echo ACKBUILDER - @mkdir -p $(OBJ) - @python3 -X pycache_prefix=$(OBJ) build/ab2.py -m make -t +all -o $@ build.py - -$(OBJ)/build.ninja: Makefile $(build-files) - @echo ACKBUILDER - @mkdir -p $(OBJ) - @python3 -X pycache_prefix=$(OBJ) build/ab2.py -m ninja -t +all -o $@ \ - -v OBJ,CC,CXX,AR \ - build.py - -.DELETE_ON_ERROR: -.SECONDARY: +TARGETS = +all +include build/ab.mk diff --git a/build.py b/build.py index 97c21ea4..fba6686f 100644 --- a/build.py +++ b/build.py @@ -1,4 +1,4 @@ -from build.ab2 import Rule, export +from build.ab import Rule, export from os.path import * import config diff --git a/build/ab2.py b/build/ab.py similarity index 54% rename from build/ab2.py rename to build/ab.py index ab164ee4..e035d754 100644 --- a/build/ab2.py +++ b/build/ab.py @@ -2,7 +2,6 @@ from os.path import * from types import SimpleNamespace import argparse -import copy import functools import importlib import importlib.abc @@ -10,18 +9,16 @@ import inspect import re import sys -import types -import pathlib import builtins -import os +import string +import fnmatch +import traceback defaultGlobals = {} targets = {} unmaterialisedTargets = set() materialisingStack = [] outputFp = None -emitter = None -currentVars = None cwdStack = [""] sys.path += ["."] @@ -54,50 +51,6 @@ class ABException(BaseException): pass -class ParameterList(Sequence): - def __init__(self, parent=[]): - self.data = parent - - def __getitem__(self, i): - return self.data[i] - - def __len__(self): - return len(self.data) - - def __str__(self): - return " ".join(self.data) - - def __add__(self, other): - newdata = self.data.copy() + other - return ParameterList(newdata) - - def __repr__(self): - return f"" - - -def Vars(parent=None): - data = {} - - class VarsImpl: - def __setattr__(self, k, v): - data[k] = v - - def __getattr__(self, k): - if k in data: - return data[k] - if parent: - return getattr(parent, k) - return ParameterList() - - def __repr__(self): - return f" {parent}>" - - __setitem__ = __setattr__ - __getitem__ = __getattr__ - - return VarsImpl() - - class Invocation: name = None callback = None @@ -105,8 +58,20 @@ class Invocation: ins = None outs = None binding = None - vars = None - varsettings = None + traits = None + attr = None + attrdeps = None + + def __init__(self): + self.attr = SimpleNamespace() + self.attrdeps = SimpleNamespace() + self.traits = set() + + def __eq__(self, other): + return self.name is other.name + + def __hash__(self): + return id(self.name) def materialise(self, replacing=False): if self in unmaterialisedTargets: @@ -121,53 +86,51 @@ def materialise(self, replacing=False): # Perform type conversion to the declared rule parameter types. - self.args = {} - for k, v in self.binding.arguments.items(): - t = self.types.get(k, None) - if t: - v = t(v).convert(self) - self.args[k] = v - - # Create a new variable frame and set any variables. - - global currentVars - self.vars = Vars(self.callerVars) - oldVars = currentVars - currentVars = self.vars - - if self.varsettings: - for k, v in self.varsettings.items(): - if k.startswith("+"): - k = k[1:] - self.vars[k] = self.vars[k] + flatten(v) + try: + self.args = {} + for k, v in self.binding.arguments.items(): + if k != "kwargs": + t = self.types.get(k, None) + if t: + v = t(v).convert(self) + self.args[k] = v else: - self.vars[k] = ParameterList(v) + for kk, vv in v.items(): + t = self.types.get(kk, None) + if t: + vv = t(vv).convert(self) + self.args[kk] = vv - # Actually call the callback. + # Actually call the callback. - try: cwdStack.append(self.cwd) self.callback(**self.args) cwdStack.pop() except BaseException as e: - print( - f"Error materialising {self} ({id(self)}): {self.callback}" - ) + print(f"Error materialising {self}: {self.callback}") print(f"Arguments: {self.args}") raise e - if not self.outs: - raise ABException(f"{self.name} didn't set self.outs") - # Destack the variable and invocation frame. + if self.outs is None: + raise ABException(f"{self.name} didn't set self.outs") - currentVars = oldVars if self in unmaterialisedTargets: unmaterialisedTargets.remove(self) materialisingStack.pop() + def bubbleattr(self, attr, xs): + xs = targetsof(xs, cwd=self.cwd) + a = set() + if hasattr(self.attrdeps, attr): + a = getattr(self.attrdeps, attr) + + for x in xs: + a.add(x) + setattr(self.attrdeps, attr, a) + def __repr__(self): - return "" % self.name + return "'%s'" % self.name def Rule(func): @@ -187,7 +150,7 @@ def wrapper(*, name=None, replaces=None, **kwargs): if name.startswith("./"): name = join(cwd, name) elif "+" not in name: - name = cwd + "+" + name + name = join(cwd, "+" + name) i.name = name i.localname = name.split("+")[-1] @@ -199,16 +162,13 @@ def wrapper(*, name=None, replaces=None, **kwargs): i = replaces name = i.name else: - raise ABException("you must supply either name or replaces") + raise ABException("you must supply either 'name' or 'replaces'") i.cwd = cwd + i.sentinel = "$(OBJ)/.sentinels/" + name + ".mark" i.types = func.__annotations__ i.callback = func - i.callerVars = currentVars - i.varsettings = kwargs.get("vars", None) - setattr(i, func.__name__, SimpleNamespace()) - - kwargs.pop("vars", None) + i.traits.add(func.__name__) i.binding = sig.bind(name=name, self=i, **kwargs) i.binding.apply_defaults() @@ -227,9 +187,21 @@ def __init__(self, value): self.value = value +class List(Type): + def convert(self, invocation): + value = self.value + if not value: + return [] + if type(value) is str: + return [value] + return list(value) + + class Targets(Type): def convert(self, invocation): value = self.value + if not value: + return [] if type(value) is str: value = [value] if type(value) is list: @@ -248,10 +220,11 @@ def convert(self, invocation): class TargetsMap(Type): def convert(self, invocation): value = self.value + if not value: + return {} if type(value) is dict: return { - targetof(k, cwd=invocation.cwd): targetof(v, cwd=invocation.cwd) - for k, v in value.items() + k: targetof(v, cwd=invocation.cwd) for k, v in value.items() } raise ABException(f"wanted a dict of targets, got a {type(value)}") @@ -269,27 +242,38 @@ def recurse(xs): def fileinvocation(s): i = Invocation() - i.name = "(anonymous)" + i.name = s i.outs = [s] targets[s] = i return i -def targetof(s, cwd): +def targetof(s, cwd=None): if isinstance(s, Invocation): s.materialise() return s + if type(s) != str: + raise ABException("parameter of targetof is not a single target") + if s in targets: t = targets[s] t.materialise() return t - if s.startswith("+"): - s = cwd + s - if s.startswith("./"): - s = join(cwd, s) - if s.startswith("$"): + if s.startswith("."): + if cwd == None: + raise ABException( + "relative target names can't be used in targetof without supplying cwd" + ) + if s.startswith(".+"): + s = cwd + s[1:] + elif s.startswith("./"): + s = normpath(join(cwd, s)) + + elif s.endswith("/"): + return fileinvocation(s) + elif s.startswith("$"): return fileinvocation(s) if "+" not in s: @@ -299,30 +283,51 @@ def targetof(s, cwd): return fileinvocation(s) (path, target) = s.split("+", 2) + s = join(path, "+" + target) loadbuildfile(join(path, "build.py")) if not s in targets: - raise ABException(f"build file at {path} doesn't contain +{target}") + raise ABException( + f"build file at {path} doesn't contain +{target} when trying to resolve {s}" + ) i = targets[s] i.materialise() return i -def targetsof(*xs, cwd): +def targetsof(*xs, cwd=None): return flatten([targetof(x, cwd) for x in flatten(xs)]) def filenamesof(*xs): - fs = [] + s = [] for t in flatten(xs): if type(t) == str: - fs += [t] + t = normpath(t) + s += [t] else: - fs += [normpath(f) for f in t.outs] - return fs + s += [f for f in [normpath(f) for f in filenamesof(t.outs)]] + return s + + +def filenamesmatchingof(xs, pattern): + return fnmatch.filter(filenamesof(xs), pattern) + + +def targetswithtraitsof(xs, trait): + return [target for target in targetsof(xs) if trait in target.traits] def targetnamesof(*xs): - return [x.name for x in flatten(xs)] + s = [] + for x in flatten(xs): + if type(x) == str: + x = normpath(x) + if x not in s: + s += [x] + else: + if x.name not in s: + s += [x.name] + return s def filenameof(x): @@ -332,6 +337,24 @@ def filenameof(x): return xs[0] +def bubbledattrsof(x, attr): + x = targetsof(x) + alltargets = set() + pending = set(x) if isinstance(x, Iterable) else {x} + while pending: + t = pending.pop() + if t not in alltargets: + alltargets.add(t) + if hasattr(t.attrdeps, attr): + pending.update(getattr(t.attrdeps, attr)) + + values = [] + for t in alltargets: + if hasattr(t.attr, attr): + values += getattr(t.attr, attr) + return values + + def stripext(path): return splitext(path)[0] @@ -342,120 +365,105 @@ def emit(*args): def templateexpand(s, invocation): - class Converter: - def __getitem__(self, key): - if key == "vars": - return invocation.vars - f = filenamesof(invocation.args[key]) - if isinstance(f, Sequence): - f = ParameterList(f) - return f - - return eval("f%r" % s, invocation.callback.__globals__, Converter()) - - -class MakeEmitter: - def begin(self): - emit("hide = @") - emit(".DELETE_ON_ERROR:") - emit(".SECONDARY:") - - def end(self): - pass - - def var(self, name, value): - # Don't let emit insert spaces. - emit(name + "=" + value) - - def rule(self, name, ins, outs, deps=[]): - ins = filenamesof(ins) - if outs: - outs = filenamesof(outs) - emit(".PHONY:", name) - emit(name, ":", outs, deps) - emit(outs, "&:", ins, deps) - else: - emit(name, ":", ins, deps) + class Formatter(string.Formatter): + def get_field(self, name, a1, a2): + return ( + eval(name, invocation.callback.__globals__, invocation.args), + False, + ) - def label(self, s): - emit("\t$(hide)echo", s) + def format_field(self, value, format_spec): + if type(self) == str: + return value + return " ".join( + [templateexpand(f, invocation) for f in filenamesof(value)] + ) - def exec(self, cs): - for c in cs: - emit("\t$(hide)", c) + return Formatter().format(s) -def unmake(*ss): - return [ - re.sub(r"\$\(([^)]*)\)", r"$\1", s) for s in flatten(filenamesof(ss)) - ] +def emitter_rule(rule, ins, outs, deps=[]): + emit("") + emit(".PHONY:", rule.name) + emit(rule.name, ":", rule.sentinel) + emit( + rule.sentinel, + filenamesof(outs) if outs else [], + ":", + filenamesof(ins), + filenamesof(deps), + ) + for f in filenamesof(outs): + emit(f, ":", rule.sentinel) -class NinjaEmitter: - def begin(self): - emit("rule build") - emit(" command = $command") - def end(self): - pass +def emitter_endrule(rule): + emit("\t$(hide) mkdir -p", dirname(rule.sentinel)) + emit("\t$(hide) touch $@") - def var(self, name, value): - # Don't let emit insert spaces. - emit(name + "=" + unmake(value)[0]) - def rule(self, name, ins, outs, deps=[]): - if outs: - emit("build", name, ": phony", unmake(outs, deps)) - emit("build", unmake(outs), ": build", unmake(ins)) - else: - emit("build", name, ": phony", unmake(ins, deps)) +def emitter_label(s): + emit("\t$(hide)", "$(ECHO)", s) - def label(self, s): - emit(" description=", s) - def exec(self, cs): - emit(" command=", " && ".join(unmake(cs))) +def emitter_exec(cs): + for c in cs: + emit("\t$(hide)", c) + + +def unmake(*ss): + return [ + re.sub(r"\$\(([^)]*)\)", r"$\1", s) for s in flatten(filenamesof(ss)) + ] @Rule def simplerule( self, name, - ins: Targets = [], - outs=[], - deps: Targets = [], - commands=[], + ins: Targets = None, + outs: List = [], + deps: Targets = None, + commands: List = [], label="RULE", + **kwargs, ): self.ins = ins self.outs = outs - emitter.rule(self.name, filenamesof(ins, deps), outs) - emitter.label(templateexpand("{label} {name}", self)) - cs = [] + self.deps = deps + emitter_rule(self, ins + deps, outs) + emitter_label(templateexpand("{label} {name}", self)) + dirs = [] + cs = [] for out in filenamesof(outs): dir = dirname(out) - if dir: - cs += ["mkdir -p " + dir] + if dir and dir not in dirs: + dirs += [dir] + cs = [("mkdir -p %s" % dir) for dir in dirs] for c in commands: cs += [templateexpand(c, self)] - emitter.exec(cs) + emitter_exec(cs) + emitter_endrule(self) @Rule def normalrule( self, name=None, - ins: Targets = [], - deps: Targets = [], - outs=[], + ins: Targets = None, + deps: Targets = None, + outs: List = [], label="RULE", objdir=None, - commands=[], + commands: List = [], + **kwargs, ): objdir = objdir or join("$(OBJ)", name) + self.attr.objdir = objdir simplerule( replaces=self, ins=ins, @@ -463,27 +471,18 @@ def normalrule( outs=[join(objdir, f) for f in outs], label=label, commands=commands, + **kwargs, ) @Rule -def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): - emitter.rule( - self.name, - flatten(items.values()), - filenamesof(items.keys()), - filenamesof(deps), - ) - emitter.label(f"EXPORT {self.name}") - +def export(self, name=None, items: TargetsMap = {}, deps: Targets = None): cs = [] - self.ins = items.values() - self.outs = filenamesof(deps) + self.ins = [] + self.outs = [] for dest, src in items.items(): destf = filenameof(dest) dir = dirname(destf) - if dir: - cs += ["mkdir -p " + dir] srcs = filenamesof(src) if len(srcs) != 1: @@ -491,10 +490,26 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = []): "a dependency of an export must have exactly one output file" ) - cs += ["cp %s %s" % (srcs[0], destf)] - self.outs += [destf] - - emitter.exec(cs) + subrule = simplerule( + name=self.name + "/+" + destf, + ins=[srcs[0]], + outs=[destf], + commands=["cp %s %s" % (srcs[0], destf)], + label="CP", + ) + subrule.materialise() + emit("clean::") + emit("\t$(hide) rm -f", destf) + + self.ins += [subrule] + + emitter_rule( + self, + self.ins, + self.outs, + [(d.outs if d.outs else d.sentinel) for d in deps], + ) + emitter_endrule(self) def loadbuildfile(filename): @@ -511,46 +526,33 @@ def load(filename): def main(): parser = argparse.ArgumentParser() - parser.add_argument( - "-m", "--mode", choices=["make", "ninja"], default="make" - ) parser.add_argument("-o", "--output") parser.add_argument("files", nargs="+") parser.add_argument("-t", "--targets", action="append") - parser.add_argument("-v", "--vars", action="append") args = parser.parse_args() + if not args.targets: + raise ABException("no targets supplied") global outputFp outputFp = open(args.output, "wt") - global emitter - if args.mode == "make": - emitter = MakeEmitter() - else: - emitter = NinjaEmitter() - emitter.begin() - - for v in flatten([a.split(",") for a in args.vars]): - e = os.getenv(v) - if e: - emitter.var(v, e) - - global currentVars - currentVars = Vars() - for k in ("Rule", "Targets", "load", "filenamesof", "stripext"): defaultGlobals[k] = globals()[k] global __name__ - sys.modules["build.ab2"] = sys.modules[__name__] - __name__ = "build.ab2" + sys.modules["build.ab"] = sys.modules[__name__] + __name__ = "build.ab" for f in args.files: loadbuildfile(f) for t in flatten([a.split(",") for a in args.targets]): - targets[t].materialise() - emitter.end() + (path, target) = t.split("+", 2) + s = join(path, "+" + target) + if s not in targets: + raise ABException("target %s is not defined" % s) + targets[s].materialise() + emit("AB_LOADED = 1\n") main() diff --git a/build/c.py b/build/c.py index 6ce13890..85b0fa95 100644 --- a/build/c.py +++ b/build/c.py @@ -1,32 +1,25 @@ -from build.ab2 import ( +from os.path import basename, join +from build.ab import ( + ABException, + List, Rule, Targets, - normalrule, - filenamesof, + TargetsMap, filenameof, - stripext, + filenamesmatchingof, + filenamesof, flatten, + normalrule, + bubbledattrsof, + stripext, + targetswithtraitsof, ) from os.path import * +from types import SimpleNamespace -def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): - if not name: - name = filenamesof(srcs)[1] - - dirs = [] - for d in deps: - for f in filenamesof(d): - if f.endswith(".h"): - dirs += [dirname(f)] - try: - dirs += d.clibrary.dirs - except: - pass - - includeflags = set(["-I" + f for f in filenamesof(dirs)]) - - outleaf = stripext(basename(name)) + suffix +def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags): + outleaf = stripext(basename(filenameof(srcs[0]))) + suffix normalrule( replaces=self, @@ -35,7 +28,7 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): outs=[outleaf], label=label, commands=commands, - vars={"+" + flags: flatten(includeflags)}, + cflags=cflags + bubbledattrsof(deps, "caller_cflags"), ) @@ -43,88 +36,228 @@ def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, flags): def cfile( self, name, - srcs: Targets = [], - deps: Targets = [], + srcs: Targets = None, + deps: Targets = None, + cflags: List = [], suffix=".o", - commands=["$(CC) -c -o {outs[0]} {ins[0]} {vars.cflags}"], + commands=["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], label="CC", ): - cfileimpl( - self, name, srcs, deps, suffix, commands, label, "cfile", "cflags" - ) + cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", cflags) @Rule def cxxfile( self, name, - srcs: Targets = [], - deps: Targets = [], + srcs: Targets = None, + deps: Targets = None, + cflags: List = [], suffix=".o", - commands=["$(CXX) -c -o {outs[0]} {ins[0]} {vars.cxxflags}"], + commands=["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], label="CXX", ): cfileimpl( - self, name, srcs, deps, suffix, commands, label, "cxxfile", "cxxflags" + self, name, srcs, deps, suffix, commands, label, "cxxfile", cflags ) -def findsources(name, srcs, deps): - ins = [] - for f in filenamesof(srcs): - if f.endswith(".c") or f.endswith(".cc") or f.endswith(".cpp"): - ins += [ - cfile( - name=name + "/" + basename(filenamesof(f)[0]), - srcs=[f], - deps=deps, - ) - ] - return ins +def findsources(name, srcs, deps, cflags, filerule): + hh = {h for h in filenamesmatchingof(srcs, "*.h")} + cflags += ["-I"+dirname(h) for h in hh] + deps += list(hh) + + objs = [] + for s in flatten(srcs): + objs += [ + filerule( + name=join(name, f.removeprefix("$(OBJ)/")), + srcs=[f], + deps=deps, + cflags=cflags, + ) + for f in filenamesof(s) + if f.endswith(".c") + or f.endswith(".cc") + or f.endswith(".cpp") + or f.endswith(".S") + or f.endswith(".s") + ] + if any(f.endswith(".o") for f in filenamesof(s)): + objs += [s] + + return objs @Rule -def clibrary( +def cheaders( self, name, - srcs: Targets = [], - deps: Targets = [], - hdrs: Targets = [], - commands=["$(AR) cqs {outs[0]} {ins}"], - label="AR", + hdrs: TargetsMap = None, + caller_cflags: List = None, + deps: Targets = None, +): + cs = [] + ins = list(hdrs.values()) + outs = [] + i = 0 + for dest, src in hdrs.items(): + s = filenamesof(src) + if len(s) != 1: + raise ABException( + "the target of a header must return exactly one file" + ) + + cs += ["cp {ins[" + str(i) + "]} {outs[" + str(i) + "]}"] + outs += [dest] + i = i + 1 + + r = normalrule( + replaces=self, + ins=ins, + outs=outs, + commands=cs, + deps=deps, + label="CHEADERS", + ) + r.materialise() + self.attr.caller_cflags = caller_cflags + ["-I" + r.attr.objdir] + self.bubbleattr("caller_cflags", deps) + + +def libraryimpl( + self, + name, + srcs, + deps, + hdrs, + caller_cflags, + caller_ldflags, + cflags, + ldflags, + commands, + label, + kind, ): - for f in filenamesof(srcs): - if f.endswith(".h"): - deps += [f] + hr = None + if hdrs and not srcs: + cheaders( + replaces=self, + hdrs=hdrs, + deps=targetswithtraitsof(deps, "cheaders"), + caller_cflags=caller_cflags, + ) + return + if hdrs: + hr = cheaders( + name=self.localname + "_hdrs", + hdrs=hdrs, + deps=targetswithtraitsof(deps, "cheaders"), + caller_cflags=caller_cflags, + ) + hr.materialise() + deps = deps + [hr] + + objs = findsources( + name, + srcs, + targetswithtraitsof(deps, "cheaders"), + cflags + bubbledattrsof(deps, "caller_cflags"), + kind, + ) normalrule( replaces=self, - ins=findsources(name, srcs, deps), + ins=objs, outs=[basename(name) + ".a"], label=label, commands=commands, ) + self.outs = self.outs + (hr.outs if hr else []) - dirs = set([dirname(f) for f in filenamesof(hdrs)]) + self.traits.add("cheaders") + self.attr.caller_ldflags = caller_ldflags + self.bubbleattr("caller_ldflags", deps) + self.bubbleattr("caller_cflags", deps) - self.clibrary.hdrs = hdrs - self.clibrary.dirs = dirs +@Rule +def clibrary( + self, + name, + srcs: Targets = None, + deps: Targets = None, + hdrs: TargetsMap = None, + caller_cflags: List = [], + caller_ldflags: List = [], + cflags: List = [], + ldflags: List = [], + commands=["$(AR) cqs {outs[0]} {ins}"], + label="LIB", + cfilerule=cfile, +): + libraryimpl( + self, + name, + srcs, + deps, + hdrs, + caller_cflags, + caller_ldflags, + cflags, + ldflags, + commands, + label, + cfilerule, + ) -def programimpl(self, name, srcs, deps, commands, label, filerule, kind): - libraries = [d.outs for d in deps if hasattr(d, "clibrary")] - for f in filenamesof(srcs): - if f.endswith(".h"): - deps += [f] +@Rule +def cxxlibrary( + self, + name, + srcs: Targets = None, + deps: Targets = None, + hdrs: TargetsMap = None, + caller_cflags: List = [], + caller_ldflags: List = [], + cflags: List = [], + ldflags: List = [], + commands=["$(AR) cqs {outs[0]} {ins}"], + label="LIB", +): + libraryimpl( + self, + name, + srcs, + deps, + hdrs, + caller_cflags, + caller_ldflags, + cflags, + ldflags, + commands, + label, + cxxfile, + ) + +def programimpl( + self, name, srcs, deps, cflags, ldflags, commands, label, filerule, kind +): + ars = filenamesmatchingof(deps, "*.a") + deps = deps + filenamesmatchingof(srcs, "*.h") + ldflags = ldflags + bubbledattrsof(deps, "caller_ldflags") + + cfiles = findsources(name, srcs, deps, cflags, filerule) normalrule( replaces=self, - ins=findsources(name, srcs, deps), - outs=[basename(name)], + ins=cfiles + ars + ars, + outs=[basename(name) + "$(EXT)"], + deps=deps, label=label, commands=commands, - vars={"+ldflags": libraries}, + ldflags=ldflags, ) @@ -132,21 +265,49 @@ def programimpl(self, name, srcs, deps, commands, label, filerule, kind): def cprogram( self, name, - srcs: Targets = [], - deps: Targets = [], - commands=["$(CC) -o {outs[0]} {ins} {vars.ldflags}"], + srcs: Targets = None, + deps: Targets = None, + cflags: List = [], + ldflags: List = [], + commands=["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"], label="CLINK", + cfilerule=cfile, + cfilekind="cprogram", ): - programimpl(self, name, srcs, deps, commands, label, cfile, "cprogram") + programimpl( + self, + name, + srcs, + deps, + cflags, + ldflags, + commands, + label, + cfilerule, + cfilekind, + ) @Rule def cxxprogram( self, name, - srcs: Targets = [], - deps: Targets = [], - commands=["$(CXX) -o {outs[0]} {ins} {vars.ldflags}"], + srcs: Targets = None, + deps: Targets = None, + cflags: List = [], + ldflags: List = [], + commands=["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"], label="CXXLINK", ): - programimpl(self, name, srcs, deps, commands, label, cxxfile, "cxxprogram") + programimpl( + self, + name, + srcs, + deps, + cflags, + ldflags, + commands, + label, + cxxfile, + "cxxprogram", + ) diff --git a/build/gpp.py b/build/gpp.py index 4c87b5eb..b6b53c0a 100644 --- a/build/gpp.py +++ b/build/gpp.py @@ -1,4 +1,4 @@ -from build.ab2 import Rule, normalrule, Targets, filenamesof +from build.ab import Rule, normalrule, Targets, filenamesof from os.path import * diff --git a/build/nasm.py b/build/nasm.py index 74174ed1..1a024907 100644 --- a/build/nasm.py +++ b/build/nasm.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, Rule, Targets, filenameof +from build.ab import normalrule, Rule, Targets, filenameof @Rule diff --git a/build/tass64.py b/build/tass64.py index 28ae843f..b9039213 100644 --- a/build/tass64.py +++ b/build/tass64.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, Rule, Targets, filenameof +from build.ab import normalrule, Rule, Targets, filenameof @Rule diff --git a/build/yacc.py b/build/yacc.py index 39481c54..7e3020d5 100644 --- a/build/yacc.py +++ b/build/yacc.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, Rule, Targets +from build.ab import normalrule, Rule, Targets @Rule diff --git a/dist/ataritos/build.py b/dist/ataritos/build.py index 8f5edcb6..bd630421 100644 --- a/dist/ataritos/build.py +++ b/dist/ataritos/build.py @@ -1,4 +1,4 @@ -from build.ab2 import export +from build.ab import export from tools.build import tocpm tocpm(name="demosub", src="./demo.sub") diff --git a/dist/bbct/build.py b/dist/bbct/build.py index a650bed3..243e12af 100644 --- a/dist/bbct/build.py +++ b/dist/bbct/build.py @@ -1,4 +1,4 @@ -from build.ab2 import export, Rule, Target, normalrule +from build.ab import export, Rule, Target, normalrule from tools.build import tocpm, mkdfs @@ -45,9 +45,9 @@ def bbcify(self, name, src: Target = None): "-ncowlink", ], ["-f", Target("rt/bbct+cowgolcoo"), "-no.cowgol"], - ["-f", Target("+cowgolcoh"), "-nh.cowgol"], - ["-f", Target("+commoncoh"), "-nh.common"], - ["-f", Target("+mandelcow"), "-nw.source"], + ["-f", Target(".+cowgolcoh"), "-nh.cowgol"], + ["-f", Target(".+commoncoh"), "-nh.common"], + ["-f", Target(".+mandelcow"), "-nw.source"], "-B3", ], ) @@ -56,13 +56,13 @@ def bbcify(self, name, src: Target = None): name="bbct", items={ "bin/dist/bbct/!boot": "./!boot", - "bin/dist/bbct/mandel.cow": "+mandelcow", - "bin/dist/bbct/cowgol.coh": "+cowgolcoh", - "bin/dist/bbct/common.coh": "+commoncoh", + "bin/dist/bbct/mandel.cow": ".+mandelcow", + "bin/dist/bbct/cowgol.coh": ".+cowgolcoh", + "bin/dist/bbct/common.coh": ".+commoncoh", "bin/dist/bbct/cowgol.coo": "rt/bbct+cowgolcoo", "bin/dist/bbct/cowfe.com": "src/cowfe+cowfe-for-16bit-with-bbct", "bin/dist/bbct/cowbe.com": "src/cowbe+cowbe-for-6502-with-bbct", "bin/dist/bbct/cowlink.com": "src/cowlink+cowlink-for-bbct-with-bbct", - "bin/dist/bbct.ssd": "+ssd", + "bin/dist/bbct.ssd": ".+ssd", }, ) diff --git a/dist/cpm/build.py b/dist/cpm/build.py index 67aba8bc..25a01ed5 100644 --- a/dist/cpm/build.py +++ b/dist/cpm/build.py @@ -1,4 +1,4 @@ -from build.ab2 import export +from build.ab import export from tools.build import tocpm tocpm(name="demosub", src="./demo.sub") @@ -6,7 +6,7 @@ export( name="cpm", items={ - "bin/dist/cpm/demo.sub": "+demosub", + "bin/dist/cpm/demo.sub": ".+demosub", "bin/dist/cpm/mandel.cow": "examples/mandel.cow", "bin/dist/cpm/cowgol.coh": "rt/cpm/cowgol.coh", "bin/dist/cpm/common.coh": "rt/common.coh", diff --git a/dist/cpmz/build.py b/dist/cpmz/build.py index 1a0e810c..1d5eb039 100644 --- a/dist/cpmz/build.py +++ b/dist/cpmz/build.py @@ -1,4 +1,4 @@ -from build.ab2 import export +from build.ab import export from tools.build import tocpm tocpm(name="demosub", src="./demo.sub") @@ -6,7 +6,7 @@ export( name="cpmz", items={ - "bin/dist/cpmz/demo.sub": "+demosub", + "bin/dist/cpmz/demo.sub": ".+demosub", "bin/dist/cpmz/mandel.cow": "examples/mandel.cow", "bin/dist/cpmz/cowgol.coh": "rt/cpmz/cowgol.coh", "bin/dist/cpmz/common.coh": "rt/common.coh", diff --git a/dist/msdos/build.py b/dist/msdos/build.py index f0ba8c9d..af8cdabe 100644 --- a/dist/msdos/build.py +++ b/dist/msdos/build.py @@ -1,4 +1,4 @@ -from build.ab2 import export +from build.ab import export export( name="msdos", diff --git a/examples/build.py b/examples/build.py index 6b6fd288..3fda758b 100644 --- a/examples/build.py +++ b/examples/build.py @@ -1,6 +1,6 @@ from src.build import cowgol from src.toolchains import TOOLCHAINS -from build.ab2 import export +from build.ab import export PROGRAMS = [ "argv", diff --git a/scripts/quiet b/scripts/quiet deleted file mode 100755 index 3ba11e6f..00000000 --- a/scripts/quiet +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -stdout=/tmp/$$.stdout -stderr=/tmp/$$.stderr -trap "rm -f $stdout $stderr" EXIT - -"$@" >$stdout 2>$stderr -if [ $? = 0 ]; then - exit 0 -else - cat $stdout - cat $stderr - echo "$ " "$@" - exit 1 -fi - diff --git a/src/build.py b/src/build.py index 00cc4bad..ae72d99d 100644 --- a/src/build.py +++ b/src/build.py @@ -1,13 +1,11 @@ -from build.ab2 import ( +from build.ab import ( Rule, Target, Targets, - export, normalrule, filenamesof, - filenameof, + targetswithtraitsof, ) -from build.c import cprogram from os.path import * from types import SimpleNamespace import config @@ -41,7 +39,7 @@ def cowlib( ins=[toolchain.cowfe, cow] + srcs, outs=[self.localname + ".cob"], commands=[ - "scripts/quiet {ins[0]} " + "chronic {ins[0]} " + (" ".join(flags)) + " {ins[1]} {outs[0]}" ], @@ -52,23 +50,20 @@ def cowlib( replaces=self, ins=[toolchain.cowbe, cob], outs=[self.localname + ".coo"], - commands=["scripts/quiet {ins[0]} {ins[1]} {outs}"], + commands=["chronic {ins[0]} {ins[1]} {outs}"], label="COWBE-" + toolchain.localname.upper(), ) @Rule def cowlink(self, name, deps: Targets = [], toolchain: Target = None): - coos = [] - for d in deps: - if hasattr(d, "cowlib"): - coos += filenamesof(d) + coos = filenamesof(targetswithtraitsof(deps, "cowlib")) asm = normalrule( name=name + "/cowlink", ins=[toolchain.cowlink] + [coos], outs=[self.localname + toolchain.asmext], - commands=["scripts/quiet {ins[0]} -o {outs} {' '.join(ins[1:])}"], + commands=["chronic {ins[0]} -o {outs} {filenamesof(ins[1:])}"], label="COWLINK-" + toolchain.localname.upper(), ) @@ -94,13 +89,13 @@ def cowgol( @Rule def cowwrap(self, name, src: Target = None, toolchain: Target = "src+ncgen"): - self.cowlib = SimpleNamespace() + self.traits.add("cowlib") normalrule( replaces=self, ins=[toolchain.cowwrap, src], outs=["cowgol.coo"], label="COWWRAP-" + toolchain.localname.upper(), - commands=["scripts/quiet {ins[0]} {ins[1]} {outs}"], + commands=["chronic {ins[0]} {ins[1]} {outs}"], ) diff --git a/src/cowasm/build.py b/src/cowasm/build.py index 94cdae3c..0abcdd22 100644 --- a/src/cowasm/build.py +++ b/src/cowasm/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, export +from build.ab import normalrule, export from src.build import cowgol from tools.newgen.build import newgencowgol from src.toolchains import TOOLCHAINS diff --git a/src/cowbdmp/build.py b/src/cowbdmp/build.py index 85bcace0..ba76d276 100644 --- a/src/cowbdmp/build.py +++ b/src/cowbdmp/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule +from build.ab import normalrule from src.build import cowgol from src.toolchains import TOOLCHAINS diff --git a/src/cowbe/build.py b/src/cowbe/build.py index 9e25119c..8aa67388 100644 --- a/src/cowbe/build.py +++ b/src/cowbe/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, export +from build.ab import normalrule, export from src.build import cowgol from src.toolchains import TOOLCHAINS from tools.newgen.build import newgencowgol @@ -39,7 +39,7 @@ name=name, toolchain=toolchain, srcs=[ - "+gen-" + arch, + ".+gen-" + arch, "include/coodecls.coh", "src+midcodesbecoh", "src+cobincoh", diff --git a/src/cowdis/build.py b/src/cowdis/build.py index b4b4017a..cc45a927 100644 --- a/src/cowdis/build.py +++ b/src/cowdis/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule +from build.ab import normalrule from src.build import cowgol from src.toolchains import TOOLCHAINS diff --git a/src/cowfe/build.py b/src/cowfe/build.py index 769b8137..e697b869 100644 --- a/src/cowfe/build.py +++ b/src/cowfe/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, export +from build.ab import normalrule, export from src.build import cowgol from src.toolchains import TOOLCHAINS from third_party.lemon.build import lemoncowgol @@ -33,8 +33,8 @@ name="cowfe-for-" + arch + "-with-" + toolchain.localname, toolchain=toolchain, srcs=[ - "+arch-" + arch, - "+parser", + ".+arch-" + arch, + ".+parser", "./allocator.coh", "./codegen.coh", "./emitter.coh", diff --git a/src/cowlink/build.py b/src/cowlink/build.py index 0439708f..5a835ba7 100644 --- a/src/cowlink/build.py +++ b/src/cowlink/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, export +from build.ab import normalrule, export from src.build import cowgol from src.toolchains import TOOLCHAINS @@ -38,7 +38,7 @@ toolchain=toolchain, srcs=[ "include/coodecls.coh", - "+arch-" + arch, + ".+arch-" + arch, "./main.cow", "./asmwrite.coh", "./cooread.coh", diff --git a/src/cowwrap/build.py b/src/cowwrap/build.py index 7f80e018..e281bdc8 100644 --- a/src/cowwrap/build.py +++ b/src/cowwrap/build.py @@ -1,4 +1,5 @@ -from src.build import cowgol, export +from build.ab import export +from src.build import cowgol from src.toolchains import TOOLCHAINS items = {} diff --git a/src/misc/build.py b/src/misc/build.py index 4359b20a..5602d882 100644 --- a/src/misc/build.py +++ b/src/misc/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule +from build.ab import normalrule from src.build import cowgol from src.toolchains import TOOLCHAINS diff --git a/src/toolchains.py b/src/toolchains.py index 3fa0d234..2dfbc78d 100644 --- a/src/toolchains.py +++ b/src/toolchains.py @@ -1,4 +1,4 @@ -from build.ab2 import ( +from build.ab import ( Rule, Target, Targets, @@ -70,7 +70,7 @@ def buildcowasmimpl(self, asm): replaces=self, ins=[asm] + self.args["srcs"], outs=[self.localname + ".bin"], - commands=["scripts/quiet {ins[0]} -o {outs[0]} {ins[1]}"], + commands=["chronic {ins[0]} -o {outs[0]} {ins[1]}"], label="ASM", ) diff --git a/tests/build.py b/tests/build.py index 672cbfed..cdcd00b5 100644 --- a/tests/build.py +++ b/tests/build.py @@ -1,4 +1,4 @@ -from build.ab2 import normalrule, Rule, Target, export +from build.ab import normalrule, Rule, Target, export from src.build import cowgol from src.toolchains import TOOLCHAINS diff --git a/third_party/apout/build.py b/third_party/apout/build.py index a94b3480..22c82b23 100644 --- a/third_party/apout/build.py +++ b/third_party/apout/build.py @@ -21,9 +21,8 @@ "./v1trap.c", "./v7trap.c", ], - vars={ - "+ldflags": ["-lm"], - "+cflags": [ + ldflags=["-lm"], + cflags=[ "-DEMUV1", "-DNATIVES", "-DRUN_V1_RAW", @@ -31,6 +30,5 @@ "-DZERO_MEMORY", "-DWRITEBASE", "-DHEX", - ], - }, + ] ) diff --git a/third_party/djlink/build.py b/third_party/djlink/build.py index cb16c0a4..15bc8b9c 100644 --- a/third_party/djlink/build.py +++ b/third_party/djlink/build.py @@ -1,5 +1,5 @@ from build.c import cxxprogram -from build.ab2 import export, Rule, Targets, normalrule +from build.ab import export, Rule, Targets, normalrule cxxprogram( name="objdump", @@ -44,9 +44,9 @@ export( name="djlink-programs", items={ - "bin/objdump": "+objdump", - "bin/bindiff": "+bindiff", - "bin/djlink": "+djlink", + "bin/objdump": ".+objdump", + "bin/bindiff": ".+bindiff", + "bin/djlink": ".+djlink", }, ) diff --git a/third_party/emu2/build.py b/third_party/emu2/build.py index b731d236..6eb513cb 100644 --- a/third_party/emu2/build.py +++ b/third_party/emu2/build.py @@ -16,5 +16,5 @@ "./src/utils.c", "./src/video.c", ], - vars={"+ldflags": ["-lm"]}, + ldflags= ["-lm"], ) diff --git a/third_party/lemon/build.py b/third_party/lemon/build.py index ad348e1c..0ea23d1b 100644 --- a/third_party/lemon/build.py +++ b/third_party/lemon/build.py @@ -1,4 +1,4 @@ -from build.ab2 import Rule, Target, normalrule +from build.ab import Rule, Target, normalrule from build.c import cprogram cprogram( diff --git a/third_party/lib6502/build.py b/third_party/lib6502/build.py index 1b39e44d..95c372e4 100644 --- a/third_party/lib6502/build.py +++ b/third_party/lib6502/build.py @@ -3,5 +3,5 @@ clibrary( name="lib6502", srcs=["./lib6502.c"], - hdrs=["./lib6502.h"], + hdrs={"lib6502.h": "./lib6502.h"}, ) diff --git a/third_party/musashi/build.py b/third_party/musashi/build.py index ae8db58a..9b874861 100644 --- a/third_party/musashi/build.py +++ b/third_party/musashi/build.py @@ -1,11 +1,11 @@ -from build.ab2 import Rule, Target, normalrule +from build.ab import Rule, Target, normalrule from build.c import clibrary, cprogram cprogram(name="m68kmake", srcs=["./m68kmake.c"]) normalrule( name="m68kops", - ins=["+m68kmake", "./m68k_in.c"], + ins=[".+m68kmake", "./m68k_in.c"], outs=["m68kops.c", "m68kops.h"], commands=["{ins[0]} {dirname(outs[0])} {ins[1]} > /dev/null"], label="MUSASHILIB", diff --git a/third_party/rc2014emu/build.py b/third_party/rc2014emu/build.py index e1bae79d..1309ec18 100644 --- a/third_party/rc2014emu/build.py +++ b/third_party/rc2014emu/build.py @@ -1,3 +1,3 @@ from build.c import clibrary -clibrary(name="rc2014emu", srcs=["./6800.c"], hdrs=["./6800.h"]) +clibrary(name="rc2014emu", srcs=["./6800.c"], hdrs={"6800.h":"./6800.h"}) diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index 911ca726..77aee274 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -1,6 +1,6 @@ from build.yacc import yacc from build.c import cprogram -from build.ab2 import Rule, Targets, normalrule, filenameof +from build.ab import Rule, Targets, normalrule, filenameof from os.path import * yacc( @@ -10,10 +10,9 @@ cprogram( name="zmac", - srcs=["+parser", "./mio.c", "./zi80dis.cpp", "./zi80dis.h"], - vars={ - "+cflags": ["-Ithird_party/zmac"], - }, + srcs=[".+parser", "./mio.c", "./zi80dis.cpp", "./zi80dis.h"], + cflags= + ["-Ithird_party/zmac"], ) diff --git a/tools/ataritosemu/build.py b/tools/ataritosemu/build.py index 78c29574..1b93f3aa 100644 --- a/tools/ataritosemu/build.py +++ b/tools/ataritosemu/build.py @@ -14,5 +14,5 @@ "./sim.h", "third_party/musashi/m68k.h", ], - deps=["+musashi"], + deps=[".+musashi"], ) diff --git a/tools/build.py b/tools/build.py index ed05a9ac..0d0c07b6 100644 --- a/tools/build.py +++ b/tools/build.py @@ -1,5 +1,5 @@ from build.c import cprogram -from build.ab2 import Rule, Target, Targets, normalrule, flatten, filenamesof +from build.ab import Rule, Target, Targets, normalrule, flatten, filenamesof cprogram( name="mkadfs", diff --git a/tools/cpmemu/build.py b/tools/cpmemu/build.py index 0fcb8888..eb5fff7b 100644 --- a/tools/cpmemu/build.py +++ b/tools/cpmemu/build.py @@ -4,7 +4,7 @@ zmac(name="biosbdos", srcs=["./biosbdos.z80"]) -objectify(name="biosbdosdata", src="+biosbdos", symbol="biosbdosdata") +objectify(name="biosbdosdata", src=".+biosbdos", symbol="biosbdosdata") cprogram( name="cpmemu", @@ -13,7 +13,7 @@ "./emulator.c", "./fileio.c", "./biosbdos.c", - "+biosbdosdata", + ".+biosbdosdata", ], - vars={"+ldflags": ["-lz80ex", "-lz80ex_dasm", "-lreadline"]}, + ldflags= ["-lz80ex", "-lz80ex_dasm", "-lreadline"], ) diff --git a/tools/fuzix6303emu/build.py b/tools/fuzix6303emu/build.py index ec38bc68..1e260f93 100644 --- a/tools/fuzix6303emu/build.py +++ b/tools/fuzix6303emu/build.py @@ -8,5 +8,5 @@ "./globals.h", ], deps=["third_party/rc2014emu"], - vars={"+ldflags": ["-lreadline"]}, + ldflags= ["-lreadline"], ) diff --git a/tools/lx68kemu/build.py b/tools/lx68kemu/build.py index 85db496d..99a05cc2 100644 --- a/tools/lx68kemu/build.py +++ b/tools/lx68kemu/build.py @@ -13,5 +13,5 @@ "./sim.h", "third_party/musashi/m68k.h", ], - deps=["+musashi"], + deps=[".+musashi"], ) diff --git a/tools/newgen/build.py b/tools/newgen/build.py index 0ef8c248..641e5591 100644 --- a/tools/newgen/build.py +++ b/tools/newgen/build.py @@ -1,4 +1,4 @@ -from build.ab2 import Rule, Targets, normalrule +from build.ab import Rule, Targets, normalrule from build.c import cprogram from build.yacc import flex from build.gpp import gpp @@ -14,11 +14,11 @@ "./main.c", "./utils.c", "./globals.h", - "+parser", - "+lexer", + ".+parser", + ".+lexer", "src+iburgcodes", ], - vars={"+cflags": ["-DCOWGOL"], "+ldflags": ["-lfl"]}, + cflags=["-DCOWGOL"], ldflags=["-lfl"], ) diff --git a/tools/obpemu/build.py b/tools/obpemu/build.py index 78c9d0c9..4ab54f6c 100644 --- a/tools/obpemu/build.py +++ b/tools/obpemu/build.py @@ -3,5 +3,5 @@ cprogram( name="obpemu", srcs=["./emulator.c", "./main.c"], - vars={"+ldflags": "-lreadline"}, + ldflags=["-lreadline"] ) From cf181142d4d6fe00bcae9fd6b96f909f7f32ad5d Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 29 Mar 2024 19:08:19 +0100 Subject: [PATCH 47/69] Adjust documentation and github script. --- .github/workflows/ccpp.yml | 2 +- doc/building.md | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 74cba87f..a4e20273 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -14,5 +14,5 @@ jobs: - name: apt run: sudo apt install chronic lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm - name: make - run: make NINJAFLAGS=-k1 + run: make -j$(nproc) diff --git a/doc/building.md b/doc/building.md index e282a3fa..33b6eec3 100644 --- a/doc/building.md +++ b/doc/building.md @@ -7,9 +7,7 @@ Building it To build, you'll need a Unixish machine (I develop on Linux) with some dependencies. - - the Ninja build tool - - - Python 3 and Lua 5.1 (needed for the build) + - chronic, Python 3 and Lua 5.1 (needed for the build) - the Pasmo Z80 assembler (needed to build part of the CP/M emulator) @@ -21,7 +19,7 @@ dependencies. - a C compiler and these GNU binutils packages: - - i686-linux-gnu + - i686-linux-gnu - arm-linux-gnueabihf - m68k-linux-gnu - m68k-atari-mint @@ -37,13 +35,13 @@ dependencies. If you're on a Debianish platform, you should be able to install them (after adding any custom package sources as above) with: - apt install ninja-build lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-linux-gnu binutils-m68k-atari-mint qemu-user gpp 64tass nasm python3 + apt install chronic lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-linux-gnu binutils-m68k-atari-mint qemu-user gpp 64tass nasm python3 Once done you can build the compiler itself with: ``` -make +make -j ``` You'll be left with a lot of stuff in the `bin` directory. The tools are all From e0fef0a0b283812dd4719f06f1efdf3e61d07a6a Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 29 Mar 2024 19:09:41 +0100 Subject: [PATCH 48/69] Typo fix. --- .github/workflows/ccpp.yml | 2 +- doc/building.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index a4e20273..9ef2be00 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -12,7 +12,7 @@ jobs: - name: add-apt-repository run: sudo add-apt-repository ppa:vriviere/ppa -y - name: apt - run: sudo apt install chronic lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm + run: sudo apt install moreutils lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-atari-mint binutils-m68k-linux-gnu qemu-user gpp 64tass libfl-dev nasm - name: make run: make -j$(nproc) diff --git a/doc/building.md b/doc/building.md index 33b6eec3..cf36ef8b 100644 --- a/doc/building.md +++ b/doc/building.md @@ -35,7 +35,10 @@ dependencies. If you're on a Debianish platform, you should be able to install them (after adding any custom package sources as above) with: - apt install chronic lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu binutils-powerpc-linux-gnu binutils-m68k-linux-gnu binutils-m68k-atari-mint qemu-user gpp 64tass nasm python3 + apt install moreutils lua5.1 libz80ex-dev flex libbsd-dev libreadline-dev \ + bison binutils-arm-linux-gnueabihf binutils-i686-linux-gnu \ + binutils-powerpc-linux-gnu binutils-m68k-linux-gnu binutils-m68k-atari-mint \ + qemu-user gpp 64tass nasm python3 Once done you can build the compiler itself with: From 7fc373ce3e2dc78e57d0f273ef07fb385d151c72 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 29 Mar 2024 19:10:50 +0100 Subject: [PATCH 49/69] Add missing files. --- build/_objectify.py | 19 ++++++++++++ build/ab.mk | 56 +++++++++++++++++++++++++++++++++++ build/pkg.py | 43 +++++++++++++++++++++++++++ build/protobuf.py | 71 +++++++++++++++++++++++++++++++++++++++++++++ build/utils.py | 43 +++++++++++++++++++++++++++ 5 files changed, 232 insertions(+) create mode 100644 build/_objectify.py create mode 100644 build/ab.mk create mode 100644 build/pkg.py create mode 100644 build/protobuf.py create mode 100644 build/utils.py diff --git a/build/_objectify.py b/build/_objectify.py new file mode 100644 index 00000000..17148954 --- /dev/null +++ b/build/_objectify.py @@ -0,0 +1,19 @@ +import sys +from functools import partial + +if len(sys.argv) != 3: + sys.exit("Usage: %s " % sys.argv[0]) +filename = sys.argv[1] +symbol = sys.argv[2] + +print("const uint8_t " + symbol + "[] = {") +n = 0 +with open(filename, "rb") as in_file: + for c in iter(partial(in_file.read, 1), b""): + print("0x%02X," % ord(c), end="") + n += 1 + if n % 16 == 0: + print() +print("};") + +print("const size_t " + symbol + "_len = sizeof(" + symbol + ");") diff --git a/build/ab.mk b/build/ab.mk new file mode 100644 index 00000000..cb7f60f3 --- /dev/null +++ b/build/ab.mk @@ -0,0 +1,56 @@ +ifeq ($(findstring 4.,$(MAKE_VERSION)),) +$(error You need GNU Make 4.x for this (if you're on OSX, use gmake).) +endif + +OBJ ?= .obj +PYTHON ?= python3 +CC ?= gcc +CXX ?= g++ +AR ?= ar +CFLAGS ?= -g -Og +LDFLAGS ?= -g +PKG_CONFIG ?= pkg-config +ECHO ?= echo +TARGETS ?= +all + +ifdef VERBOSE + hide = +else + ifdef V + hide = + else + hide = @ + endif +endif + +ifeq ($(OS), Windows_NT) + EXT ?= .exe +endif +EXT ?= + +MAKEFLAGS += -r +include $(OBJ)/build.mk + +#.SECONDARY: +.DELETE_ON_ERROR: + +.PHONY: update-ab +update-ab: + @echo "Press RETURN to update ab from the repository, or CTRL+C to cancel." \ + && read a \ + && (curl -L https://github.com/davidgiven/ab/releases/download/dev/distribution.tar.xz | tar xvJf -) \ + && echo "Done." + +.PHONY: clean +clean:: + @echo CLEAN + $(hide) rm -rf $(OBJ) bin + +export PYTHONHASHSEED = 1 +build-files = $(shell find . -name 'build.py') $(wildcard build/*.py) $(wildcard config.py) +$(OBJ)/build.mk: Makefile $(build-files) + @echo "AB" + @mkdir -p $(OBJ) + $(hide) $(PYTHON) -X pycache_prefix=$(OBJ) build/ab.py $(patsubst %,-t %,$(TARGETS)) -o $@ \ + build.py || rm -f $@ + diff --git a/build/pkg.py b/build/pkg.py new file mode 100644 index 00000000..a4200ad3 --- /dev/null +++ b/build/pkg.py @@ -0,0 +1,43 @@ +from build.ab import Rule, emit, Target, bubbledattrsof +from types import SimpleNamespace +import os +import subprocess + +emit( + """ +PKG_CONFIG ?= pkg-config +PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1 | sort) +""" +) + + +@Rule +def package(self, name, package=None, fallback: Target = None): + emit("ifeq ($(filter %s, $(PACKAGES)),)" % package) + if fallback: + emit( + f"PACKAGE_CFLAGS_{package} :=", + bubbledattrsof(fallback, "caller_cflags"), + ) + emit( + f"PACKAGE_LDFLAGS_{package} := ", + bubbledattrsof(fallback, "caller_ldflags"), + ) + emit(f"PACKAGE_DEP_{package} := ", fallback.name) + else: + emit(f"$(error Required package '{package}' not installed.)") + emit("else") + emit( + f"PACKAGE_CFLAGS_{package} := $(shell $(PKG_CONFIG) --cflags {package})" + ) + emit( + f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --libs {package})" + ) + emit(f"PACKAGE_DEP_{package} := ") + emit("endif") + + self.attr.caller_cflags = [f"$(PACKAGE_CFLAGS_{package})"] + self.attr.caller_ldflags = [f"$(PACKAGE_LDFLAGS_{package})"] + + self.ins = [] + self.outs = [f"$(PACKAGE_DEP_{package})"] diff --git a/build/protobuf.py b/build/protobuf.py new file mode 100644 index 00000000..1205c837 --- /dev/null +++ b/build/protobuf.py @@ -0,0 +1,71 @@ +from os.path import join +from build.ab import ( + Rule, + Targets, + emit, + normalrule, + filenamesof, + filenamesmatchingof, + bubbledattrsof, +) +from build.c import cxxlibrary +from types import SimpleNamespace +import build.pkg + +emit( + """ +PROTOC ?= protoc +ifeq ($(filter protobuf, $(PACKAGES)),) +$(error Required package 'protobuf' not installed.)" +endif +""" +) + + +@Rule +def proto(self, name, srcs: Targets = None, deps: Targets = None): + normalrule( + replaces=self, + ins=srcs, + outs=[f"{name}.descriptor"], + deps=deps, + commands=[ + "$(PROTOC) --include_source_info --descriptor_set_out={outs[0]} {ins}" + ], + label="PROTO", + ) + self.attr.protosrcs = filenamesof(srcs) + self.bubbleattr("protosrcs", deps) + + +@Rule +def protocc(self, name, srcs: Targets = None, deps: Targets = None): + outs = [] + protos = [] + + for f in filenamesmatchingof(bubbledattrsof(srcs, "protosrcs"), "*.proto"): + cc = f.replace(".proto", ".pb.cc") + h = f.replace(".proto", ".pb.h") + protos += [f] + srcs += [f] + outs += [cc, h] + + srcname = f"{name}_srcs" + objdir = join("$(OBJ)", srcname) + r = normalrule( + name=srcname, + ins=protos, + outs=outs, + deps=deps, + commands=["$(PROTOC) --cpp_out={self.attr.objdir} {ins}"], + label="PROTOCC", + ) + + headers = {f: join(objdir, f) for f in outs if f.endswith(".pb.h")} + + cxxlibrary( + replaces=self, + srcs=[r], + hdrs=headers, + cflags=[f"-I{objdir}"], + ) diff --git a/build/utils.py b/build/utils.py new file mode 100644 index 00000000..0ce1cbc6 --- /dev/null +++ b/build/utils.py @@ -0,0 +1,43 @@ +from build.ab import Rule, normalrule, Target, filenameof, Targets +from os.path import basename + + +@Rule +def objectify(self, name, src: Target, symbol): + normalrule( + replaces=self, + ins=["build/_objectify.py", src], + outs=[basename(filenameof(src)) + ".h"], + commands=["$(PYTHON) {ins[0]} {ins[1]} " + symbol + " > {outs}"], + label="OBJECTIFY", + ) + + +@Rule +def test( + self, + name, + command: Target = None, + commands=None, + ins: Targets = None, + deps: Targets = None, + label="TEST", +): + if command: + normalrule( + replaces=self, + ins=[command], + outs=["sentinel"], + commands=["{ins[0]}", "touch {outs}"], + deps=deps, + label=label, + ) + else: + normalrule( + replaces=self, + ins=ins, + outs=["sentinel"], + commands=commands + ["touch {outs}"], + deps=deps, + label=label, + ) From 6df4cafff62cd1c767f106419d24c73037e83cf8 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 29 Mar 2024 19:16:43 +0100 Subject: [PATCH 50/69] Switch to the ab builting objectify. --- tools/build.py | 11 ----------- tools/cpmemu/biosbdos.c | 3 ++- tools/cpmemu/build.py | 2 +- tools/cpmemu/globals.h | 3 --- tools/objectify | 19 ------------------- 5 files changed, 3 insertions(+), 35 deletions(-) delete mode 100755 tools/objectify diff --git a/tools/build.py b/tools/build.py index 0d0c07b6..0d0c0201 100644 --- a/tools/build.py +++ b/tools/build.py @@ -12,17 +12,6 @@ ) -@Rule -def objectify(self, name, src: Target = None, symbol=None): - normalrule( - replaces=self, - ins=["tools/objectify", src], - outs=[symbol + ".c"], - commands=["lua {ins[0]} " + symbol + " < {ins[1]} > {outs}"], - label="OBJECTIFY", - ) - - @Rule def tocpm(self, name, src: Target = None): normalrule( diff --git a/tools/cpmemu/biosbdos.c b/tools/cpmemu/biosbdos.c index ead221e0..b6053489 100644 --- a/tools/cpmemu/biosbdos.c +++ b/tools/cpmemu/biosbdos.c @@ -85,9 +85,10 @@ static void set_result(uint16_t result) z80ex_set_reg(z80, regBC, bc); } +#include "biosbdos.cim.h" void bios_coldboot(void) { - memcpy(&ram[FBASE], biosbdosdata_data, biosbdosdata_len); + memcpy(&ram[FBASE], biosbdosdata, biosbdosdata_len); z80ex_set_reg(z80, regPC, COLDSTART); } diff --git a/tools/cpmemu/build.py b/tools/cpmemu/build.py index eb5fff7b..c34232cd 100644 --- a/tools/cpmemu/build.py +++ b/tools/cpmemu/build.py @@ -1,6 +1,6 @@ from build.c import cprogram +from build.utils import objectify from third_party.zmac.build import zmac -from tools.build import objectify zmac(name="biosbdos", srcs=["./biosbdos.z80"]) diff --git a/tools/cpmemu/globals.h b/tools/cpmemu/globals.h index 35569137..4b0f6ad5 100644 --- a/tools/cpmemu/globals.h +++ b/tools/cpmemu/globals.h @@ -14,9 +14,6 @@ extern void showregs(void); extern const uint8_t ccp_data[]; extern const int ccp_len; -extern const uint8_t biosbdosdata_data[]; -extern const int biosbdosdata_len; - extern void bios_coldboot(void); extern void biosbdos_entry(int syscall); diff --git a/tools/objectify b/tools/objectify deleted file mode 100755 index 62ffaa1a..00000000 --- a/tools/objectify +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env lua5.1 - -local function main(symbol) - print("#include ") - print(string.format("const uint8_t %s_data[] = {", symbol)) - - local data = io.stdin:read("*a") - for i = 1, #data do - local c = data:byte(i) - io.stdout:write(string.format("0x%02x, ", c)) - end - print("") - - print("};") - print(string.format("const int %s_len = sizeof(%s_data);", symbol, symbol)) -end - -main(({...})[1]) - From a3d5ca83be57b7f4a31b4b40f4ccc1be22a9cef8 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 2 Apr 2024 21:25:33 +0200 Subject: [PATCH 51/69] Reformat. --- build/c.py | 2 +- src/build.py | 4 +--- third_party/apout/build.py | 16 ++++++++-------- third_party/emu2/build.py | 2 +- third_party/rc2014emu/build.py | 2 +- third_party/zmac/build.py | 3 +-- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/build/c.py b/build/c.py index 85b0fa95..6d0273a6 100644 --- a/build/c.py +++ b/build/c.py @@ -64,7 +64,7 @@ def cxxfile( def findsources(name, srcs, deps, cflags, filerule): hh = {h for h in filenamesmatchingof(srcs, "*.h")} - cflags += ["-I"+dirname(h) for h in hh] + cflags += ["-I" + dirname(h) for h in hh] deps += list(hh) objs = [] diff --git a/src/build.py b/src/build.py index ae72d99d..5e309743 100644 --- a/src/build.py +++ b/src/build.py @@ -39,9 +39,7 @@ def cowlib( ins=[toolchain.cowfe, cow] + srcs, outs=[self.localname + ".cob"], commands=[ - "chronic {ins[0]} " - + (" ".join(flags)) - + " {ins[1]} {outs[0]}" + "chronic {ins[0]} " + (" ".join(flags)) + " {ins[1]} {outs[0]}" ], label="COWFE-" + toolchain.localname.upper(), ) diff --git a/third_party/apout/build.py b/third_party/apout/build.py index 22c82b23..ef705157 100644 --- a/third_party/apout/build.py +++ b/third_party/apout/build.py @@ -23,12 +23,12 @@ ], ldflags=["-lm"], cflags=[ - "-DEMUV1", - "-DNATIVES", - "-DRUN_V1_RAW", - "-DDEBUG", - "-DZERO_MEMORY", - "-DWRITEBASE", - "-DHEX", - ] + "-DEMUV1", + "-DNATIVES", + "-DRUN_V1_RAW", + "-DDEBUG", + "-DZERO_MEMORY", + "-DWRITEBASE", + "-DHEX", + ], ) diff --git a/third_party/emu2/build.py b/third_party/emu2/build.py index 6eb513cb..46dfbc51 100644 --- a/third_party/emu2/build.py +++ b/third_party/emu2/build.py @@ -16,5 +16,5 @@ "./src/utils.c", "./src/video.c", ], - ldflags= ["-lm"], + ldflags=["-lm"], ) diff --git a/third_party/rc2014emu/build.py b/third_party/rc2014emu/build.py index 1309ec18..9e9634f1 100644 --- a/third_party/rc2014emu/build.py +++ b/third_party/rc2014emu/build.py @@ -1,3 +1,3 @@ from build.c import clibrary -clibrary(name="rc2014emu", srcs=["./6800.c"], hdrs={"6800.h":"./6800.h"}) +clibrary(name="rc2014emu", srcs=["./6800.c"], hdrs={"6800.h": "./6800.h"}) diff --git a/third_party/zmac/build.py b/third_party/zmac/build.py index 77aee274..d6b00e19 100644 --- a/third_party/zmac/build.py +++ b/third_party/zmac/build.py @@ -11,8 +11,7 @@ cprogram( name="zmac", srcs=[".+parser", "./mio.c", "./zi80dis.cpp", "./zi80dis.h"], - cflags= - ["-Ithird_party/zmac"], + cflags=["-Ithird_party/zmac"], ) From 366a518655cbdeb9ec15f49da1fb2233f9955e30 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 2 Apr 2024 21:43:54 +0200 Subject: [PATCH 52/69] Update to newest ab. --- build/ab.mk | 5 ++- build/ab.py | 20 ++++++----- build/c.py | 99 ++++++++++++++++++++++++++++++++++++++++++---------- build/pkg.py | 46 +++++++++++++++++++++--- 4 files changed, 136 insertions(+), 34 deletions(-) diff --git a/build/ab.mk b/build/ab.mk index cb7f60f3..5674b1a9 100644 --- a/build/ab.mk +++ b/build/ab.mk @@ -28,10 +28,9 @@ ifeq ($(OS), Windows_NT) endif EXT ?= -MAKEFLAGS += -r include $(OBJ)/build.mk -#.SECONDARY: +MAKEFLAGS += -r .DELETE_ON_ERROR: .PHONY: update-ab @@ -44,7 +43,7 @@ update-ab: .PHONY: clean clean:: @echo CLEAN - $(hide) rm -rf $(OBJ) bin + $(hide) rm -rf $(OBJ) export PYTHONHASHSEED = 1 build-files = $(shell find . -name 'build.py') $(wildcard build/*.py) $(wildcard config.py) diff --git a/build/ab.py b/build/ab.py index e035d754..025b33a0 100644 --- a/build/ab.py +++ b/build/ab.py @@ -386,21 +386,23 @@ def emitter_rule(rule, ins, outs, deps=[]): emit("") emit(".PHONY:", rule.name) emit(rule.name, ":", rule.sentinel) + emit( rule.sentinel, - filenamesof(outs) if outs else [], + # filenamesof(outs) if outs else [], ":", filenamesof(ins), filenamesof(deps), ) - for f in filenamesof(outs): - emit(f, ":", rule.sentinel) - -def emitter_endrule(rule): +def emitter_endrule(rule, outs): emit("\t$(hide) mkdir -p", dirname(rule.sentinel)) - emit("\t$(hide) touch $@") + emit("\t$(hide) touch", rule.sentinel) + + for f in filenamesof(outs): + emit(".SECONDARY:", f) + emit(f, ":", rule.sentinel, ";") def emitter_label(s): @@ -443,10 +445,12 @@ def simplerule( dirs += [dir] cs = [("mkdir -p %s" % dir) for dir in dirs] + for c in commands: cs += [templateexpand(c, self)] + emitter_exec(cs) - emitter_endrule(self) + emitter_endrule(self, outs) @Rule @@ -509,7 +513,7 @@ def export(self, name=None, items: TargetsMap = {}, deps: Targets = None): self.outs, [(d.outs if d.outs else d.sentinel) for d in deps], ) - emitter_endrule(self) + emitter_endrule(self, self.outs) def loadbuildfile(filename): diff --git a/build/c.py b/build/c.py index 6d0273a6..d7a6c704 100644 --- a/build/c.py +++ b/build/c.py @@ -1,4 +1,3 @@ -from os.path import basename, join from build.ab import ( ABException, List, @@ -18,6 +17,26 @@ from types import SimpleNamespace +class Toolchain: + label = "" + cfile = ["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"] + cxxfile = ["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"] + clibrary = ["$(AR) cqs {outs[0]} {ins}"] + cxxlibrary = ["$(AR) cqs {outs[0]} {ins}"] + cprogram = ["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"] + cxxprogram = ["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"] + + +class HostToolchain: + label = "HOST " + cfile = ["$(HOSTCC) -c -o {outs[0]} {ins[0]} $(HOSTCFLAGS) {cflags}"] + cxxfile = ["$(HOSTCXX) -c -o {outs[0]} {ins[0]} $(HOSTCFLAGS) {cflags}"] + clibrary = ["$(HOSTAR) cqs {outs[0]} {ins}"] + cxxlibrary = ["$(HOSTAR) cqs {outs[0]} {ins}"] + cprogram = ["$(HOSTCC) -o {outs[0]} {ins} {ldflags} $(HOSTLDFLAGS)"] + cxxprogram = ["$(HOSTCXX) -o {outs[0]} {ins} {ldflags} $(HOSTLDFLAGS)"] + + def cfileimpl(self, name, srcs, deps, suffix, commands, label, kind, cflags): outleaf = stripext(basename(filenameof(srcs[0]))) + suffix @@ -40,9 +59,14 @@ def cfile( deps: Targets = None, cflags: List = [], suffix=".o", - commands=["$(CC) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], - label="CC", + toolchain=Toolchain, + commands=None, + label=None, ): + if not label: + label = toolchain.label + "CC" + if not commands: + commands = toolchain.cfile cfileimpl(self, name, srcs, deps, suffix, commands, label, "cfile", cflags) @@ -54,18 +78,23 @@ def cxxfile( deps: Targets = None, cflags: List = [], suffix=".o", - commands=["$(CXX) -c -o {outs[0]} {ins[0]} $(CFLAGS) {cflags}"], - label="CXX", + toolchain=Toolchain, + commands=None, + label=None, ): + if not label: + label = toolchain.label + "CXX" + if not commands: + commands = toolchain.cxxfile cfileimpl( self, name, srcs, deps, suffix, commands, label, "cxxfile", cflags ) -def findsources(name, srcs, deps, cflags, filerule): - hh = {h for h in filenamesmatchingof(srcs, "*.h")} - cflags += ["-I" + dirname(h) for h in hh] - deps += list(hh) +def findsources(name, srcs, deps, cflags, toolchain, filerule): + headers = filenamesmatchingof(srcs, "*.h") + cflags = cflags + ["-I"+dirname(h) for h in headers] + deps = deps + headers objs = [] for s in flatten(srcs): @@ -75,6 +104,7 @@ def findsources(name, srcs, deps, cflags, filerule): srcs=[f], deps=deps, cflags=cflags, + toolchain=toolchain, ) for f in filenamesof(s) if f.endswith(".c") @@ -135,6 +165,7 @@ def libraryimpl( caller_ldflags, cflags, ldflags, + toolchain, commands, label, kind, @@ -163,6 +194,7 @@ def libraryimpl( srcs, targetswithtraitsof(deps, "cheaders"), cflags + bubbledattrsof(deps, "caller_cflags"), + toolchain, kind, ) @@ -192,10 +224,15 @@ def clibrary( caller_ldflags: List = [], cflags: List = [], ldflags: List = [], - commands=["$(AR) cqs {outs[0]} {ins}"], - label="LIB", + toolchain=Toolchain, + commands=None, + label=None, cfilerule=cfile, ): + if not label: + label = toolchain.label + "LIB" + if not commands: + commands = toolchain.clibrary libraryimpl( self, name, @@ -206,6 +243,7 @@ def clibrary( caller_ldflags, cflags, ldflags, + toolchain, commands, label, cfilerule, @@ -223,9 +261,14 @@ def cxxlibrary( caller_ldflags: List = [], cflags: List = [], ldflags: List = [], - commands=["$(AR) cqs {outs[0]} {ins}"], - label="LIB", + toolchain=Toolchain, + commands=None, + label=None, ): + if not label: + label = toolchain.label + "LIB" + if not commands: + commands = toolchain.clibrary libraryimpl( self, name, @@ -236,6 +279,7 @@ def cxxlibrary( caller_ldflags, cflags, ldflags, + toolchain, commands, label, cxxfile, @@ -243,19 +287,28 @@ def cxxlibrary( def programimpl( - self, name, srcs, deps, cflags, ldflags, commands, label, filerule, kind + self, + name, + srcs, + deps, + cflags, + ldflags, + toolchain, + commands, + label, + filerule, + kind, ): ars = filenamesmatchingof(deps, "*.a") - deps = deps + filenamesmatchingof(srcs, "*.h") ldflags = ldflags + bubbledattrsof(deps, "caller_ldflags") - cfiles = findsources(name, srcs, deps, cflags, filerule) + cfiles = findsources(name, srcs, deps, cflags, toolchain, filerule) normalrule( replaces=self, ins=cfiles + ars + ars, outs=[basename(name) + "$(EXT)"], deps=deps, - label=label, + label=toolchain.label + label, commands=commands, ldflags=ldflags, ) @@ -269,11 +322,14 @@ def cprogram( deps: Targets = None, cflags: List = [], ldflags: List = [], - commands=["$(CC) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"], + toolchain=Toolchain, + commands=None, label="CLINK", cfilerule=cfile, cfilekind="cprogram", ): + if not commands: + commands = toolchain.cprogram programimpl( self, name, @@ -281,6 +337,7 @@ def cprogram( deps, cflags, ldflags, + toolchain, commands, label, cfilerule, @@ -296,9 +353,12 @@ def cxxprogram( deps: Targets = None, cflags: List = [], ldflags: List = [], - commands=["$(CXX) -o {outs[0]} {ins} {ldflags} $(LDFLAGS)"], + toolchain=Toolchain, + commands=None, label="CXXLINK", ): + if not commands: + commands = toolchain.cxxprogram programimpl( self, name, @@ -306,6 +366,7 @@ def cxxprogram( deps, cflags, ldflags, + toolchain, commands, label, cxxfile, diff --git a/build/pkg.py b/build/pkg.py index a4200ad3..bff53cd7 100644 --- a/build/pkg.py +++ b/build/pkg.py @@ -1,4 +1,4 @@ -from build.ab import Rule, emit, Target, bubbledattrsof +from build.ab import Rule, emit, Target, bubbledattrsof, filenamesof from types import SimpleNamespace import os import subprocess @@ -7,6 +7,9 @@ """ PKG_CONFIG ?= pkg-config PACKAGES := $(shell $(PKG_CONFIG) --list-all | cut -d' ' -f1 | sort) + +HOST_PKG_CONFIG ?= pkg-config +HOST_PACKAGES := $(shell $(HOST_PKG_CONFIG) --list-all | cut -d' ' -f1 | sort) """ ) @@ -15,6 +18,7 @@ def package(self, name, package=None, fallback: Target = None): emit("ifeq ($(filter %s, $(PACKAGES)),)" % package) if fallback: + emit(f"PACKAGE_DEPS_{package} := ", filenamesof(fallback)) emit( f"PACKAGE_CFLAGS_{package} :=", bubbledattrsof(fallback, "caller_cflags"), @@ -22,8 +26,8 @@ def package(self, name, package=None, fallback: Target = None): emit( f"PACKAGE_LDFLAGS_{package} := ", bubbledattrsof(fallback, "caller_ldflags"), + f"$(filter %.a, $(PACKAGE_DEPS_{package}))", ) - emit(f"PACKAGE_DEP_{package} := ", fallback.name) else: emit(f"$(error Required package '{package}' not installed.)") emit("else") @@ -33,11 +37,45 @@ def package(self, name, package=None, fallback: Target = None): emit( f"PACKAGE_LDFLAGS_{package} := $(shell $(PKG_CONFIG) --libs {package})" ) - emit(f"PACKAGE_DEP_{package} := ") + emit(f"PACKAGE_DEPS_{package} :=") emit("endif") self.attr.caller_cflags = [f"$(PACKAGE_CFLAGS_{package})"] self.attr.caller_ldflags = [f"$(PACKAGE_LDFLAGS_{package})"] + self.traits.add("clibrary") + self.traits.add("cheaders") + + self.ins = [] + self.outs = [f"$(PACKAGE_DEPS_{package})"] + + +@Rule +def hostpackage(self, name, package=None, fallback: Target = None): + emit("ifeq ($(filter %s, $(HOST_PACKAGES)),)" % package) + if fallback: + emit( + f"HOST_PACKAGE_CFLAGS_{package} :=", + bubbledattrsof(fallback, "caller_cflags"), + ) + emit( + f"HOST_PACKAGE_LDFLAGS_{package} := ", + bubbledattrsof(fallback, "caller_ldflags"), + ) + emit(f"HOST_PACKAGE_DEP_{package} := ", fallback.name) + else: + emit(f"$(error Required host package '{package}' not installed.)") + emit("else") + emit( + f"HOST_PACKAGE_CFLAGS_{package} := $(shell $(HOST_PKG_CONFIG) --cflags {package})" + ) + emit( + f"HOST_PACKAGE_LDFLAGS_{package} := $(shell $(HOST_PKG_CONFIG) --libs {package})" + ) + emit(f"HOST_PACKAGE_DEP_{package} := ") + emit("endif") + + self.attr.caller_cflags = [f"$(HOST_PACKAGE_CFLAGS_{package})"] + self.attr.caller_ldflags = [f"$(HOST_PACKAGE_LDFLAGS_{package})"] self.ins = [] - self.outs = [f"$(PACKAGE_DEP_{package})"] + self.outs = [f"$(HOST_PACKAGE_DEP_{package})"] From de93b36c7b8c2e82dcb8c4a4e60eff780470521e Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 3 Apr 2024 14:23:24 +0200 Subject: [PATCH 53/69] Do update-bootstrap build in parallel. --- update-bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/update-bootstrap.sh b/update-bootstrap.sh index ed0f0469..fe03aaab 100755 --- a/update-bootstrap.sh +++ b/update-bootstrap.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e -make +make -j$(nproc) cp .obj/bin/cowfe-cgen.nncgen.c bootstrap/cowfe-cgen.bootstrap.c cp .obj/bin/cowbe-cgen.nncgen.c bootstrap/cowbe-cgen.bootstrap.c cp .obj/bin/cowlink-cgen.nncgen.c bootstrap/cowlink-cgen.bootstrap.c From 509d524be28141dad328940502e865ba4a2d41e9 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 3 Apr 2024 22:57:38 +0200 Subject: [PATCH 54/69] Make sure that case statements don't claim break. --- src/cowfe/parser.y | 9 ++++----- src/cowfe/types.coh | 3 +-- tests/case.good | 2 ++ tests/case.test.cow | 14 ++++++++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/cowfe/parser.y b/src/cowfe/parser.y index 2e51021d..73f74bff 100644 --- a/src/cowfe/parser.y +++ b/src/cowfe/parser.y @@ -248,7 +248,7 @@ statement ::= startcase whens END CASE SEMICOLON. if (current_case.seenelse == 0) and (current_case.next_label != 0) then Generate(MidLabel(current_case.next_label)); end if; - Generate(MidLabel(current_case.break_label)); + Generate(MidLabel(current_case.end_label)); Generate(MidEndcase(current_case.width)); var c := current_case; @@ -260,8 +260,7 @@ startcase ::= CASE expression(E) IS. { var c := InternalAlloc(@bytesof CaseLabels) as [CaseLabels]; c.old_case := current_case; - c.old_break_label := break_label; - c.break_label := AllocLabel(); + c.end_label := AllocLabel(); current_case := c; if IsNum(E.type) == 0 then @@ -284,7 +283,7 @@ beginwhen ::= WHEN cvalue(C) COLON. end if; if current_case.next_label != 0 then - Generate(MidJump(current_case.break_label)); + Generate(MidJump(current_case.end_label)); Generate(MidLabel(current_case.next_label)); end if; current_case.next_label := AllocLabel(); @@ -298,7 +297,7 @@ beginwhen ::= WHEN ELSE COLON. SimpleError("only one when else allowed"); end if; if current_case.next_label != 0 then - Generate(MidJump(current_case.break_label)); + Generate(MidJump(current_case.end_label)); Generate(MidLabel(current_case.next_label)); end if; current_case.next_label := 0; diff --git a/src/cowfe/types.coh b/src/cowfe/types.coh index 81f5dabe..48527b19 100644 --- a/src/cowfe/types.coh +++ b/src/cowfe/types.coh @@ -120,8 +120,7 @@ end record; record CaseLabels is next_label: LabelRef; - break_label: LabelRef; - old_break_label: LabelRef; + end_label: LabelRef; old_case: [CaseLabels]; width: uint8; seenelse: uint8; diff --git a/tests/case.good b/tests/case.good index 9eb52e45..6c8e0192 100644 --- a/tests/case.good +++ b/tests/case.good @@ -27,3 +27,5 @@ int32 of 9 == 4: yes 19 of many int16s == 119: yes 39 of many int16s == 139: yes 40 of many int16s == 0: yes +before break +after break diff --git a/tests/case.test.cow b/tests/case.test.cow index 6abb51a5..9366cf67 100644 --- a/tests/case.test.cow +++ b/tests/case.test.cow @@ -242,3 +242,17 @@ sub test_case_many_int16s() is end sub; test_case_many_int16s(); +sub test_break() is + var i: uint8 := 1; + loop + case i is + when 1: + print("before break\n"); + break; + end case; + print("bad\n"); + break; + end loop; + print("after break\n"); +end sub; +test_break(); From d56986b268529b12cc359b68e9c42f27aa21642d Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 5 Apr 2024 14:57:25 +0200 Subject: [PATCH 55/69] Raw import of libz80ex. --- README.md | 5 +- third_party/z80ex/BUGS | 0 third_party/z80ex/CMakeLists.txt | 70 + third_party/z80ex/COPYING | 340 +++ third_party/z80ex/Changelog | 88 + third_party/z80ex/HOMEPAGE | 1 + third_party/z80ex/INSTALL.cmake | 64 + third_party/z80ex/INSTALL.gmake | 29 + third_party/z80ex/Makefile | 100 + third_party/z80ex/README | 46 + third_party/z80ex/TODO | 18 + third_party/z80ex/UPSTREAM | 2 + third_party/z80ex/examples/dasm.c | 63 + third_party/z80ex/examples/version.c | 18 + third_party/z80ex/include/z80ex.h | 152 ++ third_party/z80ex/include/z80ex_common.h | 43 + third_party/z80ex/include/z80ex_dasm.h | 52 + third_party/z80ex/macros.h | 1031 ++++++++ third_party/z80ex/opcodes/build_opcodes.pl | 817 +++++++ third_party/z80ex/opcodes/opcode.dat.format | 11 + third_party/z80ex/opcodes/opcodes_base.c | 2316 ++++++++++++++++++ third_party/z80ex/opcodes/opcodes_cb.c | 2175 +++++++++++++++++ third_party/z80ex/opcodes/opcodes_dasm.c | 1834 ++++++++++++++ third_party/z80ex/opcodes/opcodes_dd.c | 871 +++++++ third_party/z80ex/opcodes/opcodes_ddcb.c | 2431 +++++++++++++++++++ third_party/z80ex/opcodes/opcodes_ed.c | 719 ++++++ third_party/z80ex/opcodes/opcodes_fd.c | 871 +++++++ third_party/z80ex/opcodes/opcodes_fdcb.c | 2431 +++++++++++++++++++ third_party/z80ex/ptables.c | 656 +++++ third_party/z80ex/typedefs.h | 80 + third_party/z80ex/z80ex.c | 414 ++++ third_party/z80ex/z80ex_dasm.c | 189 ++ 32 files changed, 17936 insertions(+), 1 deletion(-) create mode 100644 third_party/z80ex/BUGS create mode 100644 third_party/z80ex/CMakeLists.txt create mode 100644 third_party/z80ex/COPYING create mode 100644 third_party/z80ex/Changelog create mode 100644 third_party/z80ex/HOMEPAGE create mode 100644 third_party/z80ex/INSTALL.cmake create mode 100644 third_party/z80ex/INSTALL.gmake create mode 100644 third_party/z80ex/Makefile create mode 100644 third_party/z80ex/README create mode 100644 third_party/z80ex/TODO create mode 100644 third_party/z80ex/UPSTREAM create mode 100644 third_party/z80ex/examples/dasm.c create mode 100644 third_party/z80ex/examples/version.c create mode 100644 third_party/z80ex/include/z80ex.h create mode 100644 third_party/z80ex/include/z80ex_common.h create mode 100644 third_party/z80ex/include/z80ex_dasm.h create mode 100644 third_party/z80ex/macros.h create mode 100755 third_party/z80ex/opcodes/build_opcodes.pl create mode 100644 third_party/z80ex/opcodes/opcode.dat.format create mode 100644 third_party/z80ex/opcodes/opcodes_base.c create mode 100644 third_party/z80ex/opcodes/opcodes_cb.c create mode 100644 third_party/z80ex/opcodes/opcodes_dasm.c create mode 100644 third_party/z80ex/opcodes/opcodes_dd.c create mode 100644 third_party/z80ex/opcodes/opcodes_ddcb.c create mode 100644 third_party/z80ex/opcodes/opcodes_ed.c create mode 100644 third_party/z80ex/opcodes/opcodes_fd.c create mode 100644 third_party/z80ex/opcodes/opcodes_fdcb.c create mode 100644 third_party/z80ex/ptables.c create mode 100644 third_party/z80ex/typedefs.h create mode 100644 third_party/z80ex/z80ex.c create mode 100644 third_party/z80ex/z80ex_dasm.c diff --git a/README.md b/README.md index cbeff544..c6a1109f 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ dmsc@github (and others). It is distributed under the terms of the GPL 2.0 license; see `third_party/emu2/LICENSE` for the full text. `third_party/djlink` contains a copy of the djlink 16-bit linker written by -dj@delorie.com. It is distributed under the terms of the GPL 2.0 licesne; see +dj@delorie.com. It is distributed under the terms of the GPL 2.0 license; see `third_party/djlink/copying` for the full text, with additional grants described in `third_party/djlink/copying.dj`. @@ -293,3 +293,6 @@ turn contains a copy of John R. Hauser's softfloat library, distributable under a custom but MIT-like license; see `third_party/musashi/softfloat/README.txt` for the text. +`third_party/libz80ex` contains a copy of the z80ex Z80 emulation library, +written bypigmaker57@kahoh57.info. It is distributable under the terms of the +GPL GPL 2.0 license; see `third_party/z80ex/COPYING` for the text. \ No newline at end of file diff --git a/third_party/z80ex/BUGS b/third_party/z80ex/BUGS new file mode 100644 index 00000000..e69de29b diff --git a/third_party/z80ex/CMakeLists.txt b/third_party/z80ex/CMakeLists.txt new file mode 100644 index 00000000..97c3ba21 --- /dev/null +++ b/third_party/z80ex/CMakeLists.txt @@ -0,0 +1,70 @@ +cmake_minimum_required (VERSION 2.8) +project (z80ex) + +set (API_REVISION 1) +set (VERSION_MAJOR 1) +set (VERSION_MINOR 21) +set (RELEASE_TYPE "") +set (VERSION_STR "${API_REVISION}.${VERSION_MAJOR}.${VERSION_MINOR}${RELEASE_TYPE}") + +option (OPSTEP_FAST_AND_ROUGH "Fast and rough opcode step emulation mode" Off) + +#ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include +if (CMAKE_COMPILER_IS_GNUCC) + set (CMAKE_C_FLAGS "-fPIC -fno-common -ansi -pedantic -Wall -pipe -O2") +endif () + +include_directories(BEFORE . include) + +include (TestBigEndian) +test_big_endian(BIG_ENDIAN) +#endianness (one of: WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN) +if (BIG_ENDIAN) + set (ENDIANNESS WORDS_BIG_ENDIAN) +else () + set (ENDIANNESS WORDS_LITTLE_ENDIAN) +endif () + +add_definitions (-D${ENDIANNESS} -DZ80EX_VERSION_STR=${VERSION_STR} -DZ80EX_API_REVISION=${API_REVISION} -DZ80EX_VERSION_MAJOR=${VERSION_MAJOR} -DZ80EX_VERSION_MINOR=${VERSION_MINOR} -DZ80EX_RELEASE_TYPE=${RELEASE_TYPE}) + +if (OPSTEP_FAST_AND_ROUGH) + add_definitions (-DZ80EX_OPSTEP_FAST_AND_ROUGH) +endif () + +set (z80ex_sources z80ex.c) +add_library (z80ex-static STATIC ${z80ex_sources}) +set_target_properties (z80ex-static PROPERTIES OUTPUT_NAME z80ex) +if (NOT DEFINED Z80EX_STATIC_ONLY) + add_library (z80ex SHARED ${z80ex_sources}) +# Affects Win32 only: avoid dynamic/static *.lib files naming conflict + set_target_properties (z80ex-static PROPERTIES PREFIX "lib") +endif () + +set (z80ex_dasm_sources z80ex_dasm.c) +add_library (z80ex_dasm-static STATIC ${z80ex_dasm_sources}) +set_target_properties (z80ex_dasm-static PROPERTIES OUTPUT_NAME z80ex_dasm) +if (NOT DEFINED Z80EX_STATIC_ONLY) + add_library (z80ex_dasm SHARED ${z80ex_dasm_sources}) +# Affects Win32 only: avoid dynamic/static *.lib files naming conflict + set_target_properties (z80ex_dasm-static PROPERTIES PREFIX "lib") +endif () + +if (NOT DEFINED Z80EX_STATIC_ONLY) + set_target_properties(z80ex z80ex_dasm + PROPERTIES VERSION ${VERSION_STR} SOVERSION ${API_REVISION} + ) +endif () +set_target_properties(z80ex-static z80ex_dasm-static + PROPERTIES VERSION ${VERSION_STR} SOVERSION ${API_REVISION} +) + +if ("${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}" MATCHES "lib64") + set (LIB_DIR "lib64") +else () + set (LIB_DIR "lib") +endif () +if (NOT DEFINED Z80EX_STATIC_ONLY) + install (TARGETS z80ex z80ex_dasm LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION ${LIB_DIR}) +endif () +install (TARGETS z80ex-static z80ex_dasm-static LIBRARY DESTINATION ${LIB_DIR} ARCHIVE DESTINATION ${LIB_DIR}) +install (DIRECTORY include/ DESTINATION include/z80ex PATTERN "*.h" ) diff --git a/third_party/z80ex/COPYING b/third_party/z80ex/COPYING new file mode 100644 index 00000000..d60c31a9 --- /dev/null +++ b/third_party/z80ex/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/third_party/z80ex/Changelog b/third_party/z80ex/Changelog new file mode 100644 index 00000000..4acd7c91 --- /dev/null +++ b/third_party/z80ex/Changelog @@ -0,0 +1,88 @@ +29.07.2013 - 1.1.21 +- added API functions to set memory/port/int callbacks without resetting the virtual CPU +- z80ex_get_version() was fixed to return the correct version string + +19.01.2013 - 1.1.20rev1 +- fixed library version mismatch between Makefile and CMakeLists.txt + (thanks to John Paul Adrian Glaubitz) + +02.01.2013 - 1.1.20 +- cleanup of included build documentation +- email adress change + +01.09.2012 +- TOOLS_PREFIX Makefile option, useful for cross-compiling [Stewart Kay] + +21.01.2010 - 1.1.19 +- removed IFF2=IFF1 on NMI. it's contrary to zilog z80 docs, but is true +(proved by Restorer) + +24.08.2010 - 1.1.19pre1 +- cmake build support [mkoloberdin] +- fixes for MSVC compilation [mkoloberdin] + +12.09.2009 - 1.1.18 +- HALT/NMI bugfix (by Kalvis) +- some speed optimizations (by Mastermind) +- RETI callback was implemented (by Torsten Paul) + +04.06.2009 - 1.1.17 +- ability to fetch z80ex version info at runtime, see z80ex_get_version() +- makefile fixes and cleanups, OS X support +- versioning scheme changed + +28.09.2008 - 0.16.2 +- made build for Symbian possible (and maybe for other environments + which does not support the use of writable static data in DLL's) (thanks to ander) +- build option for fast and rough opcode timings emulation, see README + +31.07.2008 - 0.16.1 +- added -fPIC option to compile flags (thanks to ander) + +16.07.2008 - 0.16 +- LD A,R / LD A,I quirk implemented (If a LD A,I or LD A,R (which copy IFF2 to the P/V flag) is interrupted, + then the P/V flag is reset, even if interrupts were enabled beforehand)(thanks to Restorer) +- NMI IFF2=IFF1 fix + +03.04.2006 - 0.15 (major bugfix release) +- nasty deadlock in IM0 mode was eliminated + +29.03.2006 - 0.14 +- full MEMPTR (BIT n,(HL) flags) support! + it seems that all undocumented z80 features are emulated now. +- undocumented flags were fixed for bit n,reg8 + +17.03.2006 - 0.14pre1 +- massive code reorganisation +- include files are now installed under include/z80ex +- disassembler added + +15.03.2006 - release 0.13 +- more MEMPTR emulation +- fixed nasty bug in DD/FD prefixes behavior + +02.03.2006 +- fixed IN A,(nn) (flags) + +23.02.2006 - release 0.12 +- fixed timings for LD IIh/IIl,nn (thanks to Restorer) + +22.02.2006 +- fixed timings for IIh/IIl undocumented opcodes + +18.02.2006 +- fixed undocumented flag effects for BIT n,(IX+d) +- undocumented flag effects implemented for block I/O operations +- undocumented internal register MEMPTR emulation (incomplete, more info needed) + +16.02.2006 +- fixed sized data types declaration for MSVC (thanks to SMT) + +15.02.2006 - release 0.11 +- added M1 signal state to memory read callback parameters +- DAA emulation has been fixed (now uses table from SMT's UnrealSpeccy) + +11.02.2006 +- minor API changes + +10.02.2006 - release 0.1 diff --git a/third_party/z80ex/HOMEPAGE b/third_party/z80ex/HOMEPAGE new file mode 100644 index 00000000..0f58ab2a --- /dev/null +++ b/third_party/z80ex/HOMEPAGE @@ -0,0 +1 @@ +http://sourceforge.net/projects/z80ex/ diff --git a/third_party/z80ex/INSTALL.cmake b/third_party/z80ex/INSTALL.cmake new file mode 100644 index 00000000..d7cfb763 --- /dev/null +++ b/third_party/z80ex/INSTALL.cmake @@ -0,0 +1,64 @@ +Building with CMake: +-------------------- + +CMake (http://www.cmake.org/) is required to build the library. +If you use a popular Linux distribuion chances are that you already have +it if not installed than in the stock repository. +Out-of-source-tree building is recommended. + +To build on Unix and Unix-like environments (GCC,mingw,cygwin,DJGPP): + mkdir build + cd build + cmake .. +To build everything (static and shared z80ex and z80ex_dasm libraries): + gmake +To build only specific libraries and flavors: + gmake z80ex (shared z80ex) + gmake z80ex-static (static z80ex) + gmake z80ex_dasm (shared dasm) + gmake z80ex_dasm-static (static z80ex_dasm) + +To build using MSVC (Visual Studio): + - create a folder inside the source tree (e.g. "build") + - start cmd.exe and go to the created folder and issue: + cmake .. + - double-click z80ex.sln to open it in Visual Studio + - build ALL_BUILD or only necessary target(s) in Visual Studio + (choose Release/Debug configuration as required) + +You may override some build parameters by using ccmake or cmake-gui +or other means CMake provides (see CMake documentation and relevant man pages): +* OPSTEP_FAST_AND_ROUGH -- fast and rough opcode emulation mode (0 - off, 1 - on) + when this mode is on, timings of internal I/O operations are ignored, + and tstate callback feature is disabled + +Also, if you intend to use Z80Ex in your CMake-enabled project +and you want to ship particular Z80Ex version with your project sources +you may check "Shipping Z80Ex with CMake-enabled project" section. + + +Installing (UNIX/MacOS X): +-------------------------- + +issue "gmake install" as superuser. +(default install prefix is /usr/local, which may be changed using ccmake or +cmake-gui) +then do "/sbin/ldconfig" as superuser to update DSO links and cache + + +Shipping Z80Ex with CMake-enabled project: +----------------------------------------- + +Here's an example of what could be added to your project's CMakeLists.txt +in order to use Z80Ex whose source tree is in the same directory +as your project's source tree: + + set (Z80EX_PATH "${PROJECT_SOURCE_DIR}/../z80ex" + CACHE PATH "Path to Z80Ex library") + include_directories("${Z80EX_PATH}/include") + set (Z80EX_BINARY_DIR "${PROJECT_BINARY_DIR}/lib_z80ex") + make_directory (${Z80EX_BINARY_DIR}) + set (Z80EX_STATIC_ONLY true) + add_subdirectory (${Z80EX_PATH} ${Z80EX_BINARY_DIR}) + link_directories (${Z80EX_BINARY_DIR}) + target_link_libraries (my_app_exe_name z80ex-static z80ex_dasm-static) diff --git a/third_party/z80ex/INSTALL.gmake b/third_party/z80ex/INSTALL.gmake new file mode 100644 index 00000000..59834412 --- /dev/null +++ b/third_party/z80ex/INSTALL.gmake @@ -0,0 +1,29 @@ +Building with GNU toolset: +-------------------------------------------------------- + +NB: Only GNU C (GCC, mingw, cygwin) is supported by the included Makefile + +Issue 'gmake' in the root of Z80Ex source tree. +After a successful build the libraries could be found in "./lib". + +Alternatively you may do "gmake static" for building static libs only, +or "gmake shared" for building shared libs only. + +You may change some build options by editing the Makefile or via +gmake command line parameters (e.g. "gmake parameter=value") +these are: +* ENDIANNESS -- CPU endianness, one of WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN +* OPSTEP_FAST_AND_ROUGH -- fast and rough opcode step emulation mode (0 - off, 1 - on) + when this mode is on, timings of internal I/O operations are ignored, + and tstate callback feature is disabled +* INSTALL_PREFIX -- where to install the library +* TOOLS_PREFIX -- useful for cross-compiling, e.g., when cross-compiling to mingw32 + it should be set to something like "i586-mingw32msvc-" so "i586-mingw32msvc-gcc" + and "i586-mingw32msvc-ar" will be used instead of regular "gcc" and "ar". + +Installing: +-------------------------- + +issue "gmake install" as superuser. +(default install prefix is /usr/local, which may be changed in Makefile.) +then do "/sbin/ldconfig" as superuser to update DSO links and cache diff --git a/third_party/z80ex/Makefile b/third_party/z80ex/Makefile new file mode 100644 index 00000000..da1a14ac --- /dev/null +++ b/third_party/z80ex/Makefile @@ -0,0 +1,100 @@ +# Z80ex Makefile +# (for GNU make) +# + +################################################################# +# You may tune these values to fit your setup: +################################################################# +INSTALL_PREFIX := /usr/local +TOOLS_PREFIX := + +CC := $(TOOLS_PREFIX)gcc +LINKER := $(TOOLS_PREFIX)gcc +AR := $(TOOLS_PREFIX)ar + +ALL_CFLAGS := -fPIC -fno-common -ansi -pedantic -Wall -pipe -O2 -I. -I./include + +#endianness (one of: WORDS_LITTLE_ENDIAN, WORDS_BIG_ENDIAN) +ENDIANNESS := WORDS_LITTLE_ENDIAN +#ENDIANNESS := WORDS_BIG_ENDIAN + +#fast and rough opcode step emulation mode (0 - off, 1 - on) +OPSTEP_FAST_AND_ROUGH := 0 + + +################################################################# +# Do not change these: +################################################################# +PROJ := z80ex +EMU := libz80ex +DASM := libz80ex_dasm +API_REVISION := 1 +VERSION_MAJOR:=1 +VERSION_MINOR:=21 +RELEASE_TYPE := +VERSION_STR:= ${API_REVISION}.${VERSION_MAJOR}.${VERSION_MINOR}${RELEASE_TYPE} + +OS=${shell uname -s} + +ALL_CFLAGS += -D${ENDIANNESS} -DZ80EX_VERSION_STR=${VERSION_STR} -DZ80EX_API_REVISION=${API_REVISION} -DZ80EX_VERSION_MAJOR=${VERSION_MAJOR} -DZ80EX_VERSION_MINOR=${VERSION_MINOR} -DZ80EX_RELEASE_TYPE=${RELEASE_TYPE} + +ifneq (${OPSTEP_FAST_AND_ROUGH},0) +ALL_CFLAGS += -DZ80EX_OPSTEP_FAST_AND_ROUGH +endif + +c_files := z80ex.c z80ex_dasm.c + +%.o : %.c + ${CC} ${ALL_CFLAGS} ${CFLAGS} -c -o $@ $< + +.PHONY : all +all:: static shared + +z80ex.o: include/z80ex.h include/z80ex_common.h ptables.c typedefs.h macros.h opcodes/opcodes_base.c\ +opcodes/opcodes_dd.c opcodes/opcodes_fd.c opcodes/opcodes_cb.c\ +opcodes/opcodes_ed.c opcodes/opcodes_ddcb.c opcodes/opcodes_fdcb.c + +z80ex_dasm.o: include/z80ex_dasm.h include/z80ex_common.h opcodes/opcodes_dasm.c + +clean: + rm -f *.o + rm -f ./lib/* + rm -rf ./z80ex-${VERSION_STR}.tar.gz + +static: z80ex.o z80ex_dasm.o + ${AR} rs ./lib/${EMU}.a z80ex.o + ${AR} rs ./lib/${DASM}.a z80ex_dasm.o + +shared: z80ex.o z80ex_dasm.o +ifeq (${OS},Darwin) + ${LINKER} -dynamiclib -compatibility_version ${API_REVISION} -current_version ${VERSION_STR} -install_name ${INSTALL_PREFIX}/lib/${EMU}.${API_REVISION}.dylib -o ./lib/${EMU}.${VERSION_STR}.dylib z80ex.o + ${LINKER} -dynamiclib -compatibility_version ${API_REVISION} -current_version ${VERSION_STR} -install_name ${INSTALL_PREFIX}/lib/${DASM}.${API_REVISION}.dylib -o ./lib/${DASM}.${VERSION_STR}.dylib z80ex_dasm.o +else + ${LINKER} -shared -Wl,-soname,${EMU}.so.${API_REVISION} -o ./lib/${EMU}.so.${VERSION_STR} z80ex.o + ${LINKER} -shared -Wl,-soname,${DASM}.so.${API_REVISION} -o ./lib/${DASM}.so.${VERSION_STR} z80ex_dasm.o +endif + +install: + install -d ${INSTALL_PREFIX}/lib + install ./lib/* ${INSTALL_PREFIX}/lib + install -d ${INSTALL_PREFIX}/include/z80ex + install -m 0664 ./include/* ${INSTALL_PREFIX}/include/z80ex +ifeq (${OS},Darwin) + ln -sf ${EMU}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${EMU}.${API_REVISION}.dylib + ln -sf ${EMU}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${EMU}.dylib + ln -sf ${DASM}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${DASM}.${API_REVISION}.dylib + ln -sf ${DASM}.${VERSION_STR}.dylib ${INSTALL_PREFIX}/lib/${DASM}.dylib +else + ln -sf ${EMU}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${EMU}.so.${API_REVISION} + ln -sf ${EMU}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${EMU}.so + ln -sf ${DASM}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${DASM}.so.${API_REVISION} + ln -sf ${DASM}.so.${VERSION_STR} ${INSTALL_PREFIX}/lib/${DASM}.so +endif + +dist: clean + rm -rf ./${PROJ}-${VERSION_STR} + ln -s ./ ./${PROJ}-${VERSION_STR} + tar --exclude-vcs --exclude obsolete --exclude ${PROJ}-${VERSION_STR}/${PROJ}-${VERSION_STR} --exclude ${PROJ}-${VERSION_STR}/${PROJ}-${VERSION_STR}.tar.gz -hcf - ./${PROJ}-${VERSION_STR}/ | gzip -f9 > ${PROJ}-${VERSION_STR}.tar.gz + rm -rf ./${PROJ}-${VERSION_STR} + +#EOF diff --git a/third_party/z80ex/README b/third_party/z80ex/README new file mode 100644 index 00000000..6e0fa36e --- /dev/null +++ b/third_party/z80ex/README @@ -0,0 +1,46 @@ +Z80Ex + +ZiLOG Z80 CPU emulator +~~~~~~~~~~~~~~~~~~~~~~ + +Features: +--------- + +- precise opcode emulation (documented & undocumented) +- exact timings for each opcode (including I/O operations) +- full support for all interrupt modes +- any number of virtual CPUs may be created +- portable: written in pure ANSI C +- builds as a library with simple callback-based API +- disassembler included + + +Building and installing: +-------------------------------------------------------- + +to build and install using CMake build system, refer to INSTALL.cmake +to build and install using GNU Make, refer to INSTALL.gmake + + +Usage intro: +------------ + +emulator: + +include in your sources, +link with "libz80ex" (-lz80ex). + +for (rather subtle) API documentation see "z80ex.h". + +disassembler: + +include in your sources, +link with "libz80ex_dasm" (-lz80ex_dasm). + +for API documentation see "z80ex_dasm.h". +also you may look at "dasm.c" from the "examples" directory + + +_____________________________ +yours, Pigmaker57 aka Boo-boo +pigmaker57@kahoh57.info diff --git a/third_party/z80ex/TODO b/third_party/z80ex/TODO new file mode 100644 index 00000000..4d014418 --- /dev/null +++ b/third_party/z80ex/TODO @@ -0,0 +1,18 @@ +- [rst] option to build the library with t-state callback permanently + disabled, but with full timings (contrary to Z80EX_OPSTEP_FAST_AND_ROUGH) + in this mode two macroses must be stripped down to: + #define T_WAIT_UNTIL(t_state) \ + { \ + if (t_state > cpu->op_tstate) { \ + cpu->tstate += t_state - cpu->op_tstate; \ + cpu->op_tstate = t_state; \ + } \ + } + + #define TSTATES(amount) \ + { \ + cpu->tstate += amount; \ + } + Z80EX_OPSTEP_FAST_AND_ROUGH must enable this mode automatically + +? BUSACK/BUSREQ emulation diff --git a/third_party/z80ex/UPSTREAM b/third_party/z80ex/UPSTREAM new file mode 100644 index 00000000..caf6b75d --- /dev/null +++ b/third_party/z80ex/UPSTREAM @@ -0,0 +1,2 @@ +This is version 1.1.21 of z80ex, taken from +https://sourceforge.net/projects/z80ex/files/z80ex/. diff --git a/third_party/z80ex/examples/dasm.c b/third_party/z80ex/examples/dasm.c new file mode 100644 index 00000000..4d6f0445 --- /dev/null +++ b/third_party/z80ex/examples/dasm.c @@ -0,0 +1,63 @@ +#include +#include +#include + +Z80EX_BYTE *data=NULL; +int data_len=0; + +void usage(char *name) +{ + printf("simple z80 code disassembler\nusage: %s binary_file [base_adress]\n",name); +} + +Z80EX_BYTE readbyte_cb(Z80EX_WORD addr, void *user_data) +{ + int base_addr = *((int *)user_data); + return(data[addr-base_addr]); +} + +int main(int argc,char *argv[]) +{ + FILE *fp; + int base_addr=0,addr=0; + int t,t2; + char buf[80]; + + if(argc < 2 || argc > 3) + { + usage(argv[0]); + return(0); + } + + fp=fopen(argv[1],"rb"); + if(fp==NULL) goto fail; + + fseek(fp,0,SEEK_END); + data_len=ftell(fp); + fseek(fp,0,SEEK_SET); + + if(NULL==(data=(Z80EX_BYTE *)malloc(data_len))) goto fail; + if(fread(data,1,data_len,fp)!=data_len) goto fail; + fclose(fp); + + if(argc == 3) base_addr=atoi(argv[2]); + + addr=base_addr; + while((addr-base_addr) < data_len) + { + printf("%04X: ",addr); + addr+=z80ex_dasm(buf,80,0,&t,&t2,readbyte_cb,addr,&base_addr); + printf("%-15s t=%d",buf,t); + if(t2) printf("/%d",t2); + printf("\n"); + } + + free(data); + return(0); + +fail: + fprintf(stderr,"ERROR\n"); + if(data!=NULL) free(data); + return(1); + +} diff --git a/third_party/z80ex/examples/version.c b/third_party/z80ex/examples/version.c new file mode 100644 index 00000000..9916019e --- /dev/null +++ b/third_party/z80ex/examples/version.c @@ -0,0 +1,18 @@ +#include +#include + +int main(void) +{ + Z80EX_VERSION *ver; + + printf("z80ex version info:\n-------------------\n"); + + ver = z80ex_get_version(); + + printf("API revision: %d\nmajor version number: %d\nminor version number: %d\nrelease type: %s\n", + ver->API_revision, ver->major, ver->minor, ver->release_type); + + printf("full version number: %s\n", ver->as_string); + + return(0); +} diff --git a/third_party/z80ex/include/z80ex.h b/third_party/z80ex/include/z80ex.h new file mode 100644 index 00000000..27bf3a7c --- /dev/null +++ b/third_party/z80ex/include/z80ex.h @@ -0,0 +1,152 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#ifndef _Z80EX_H_INCLUDED +#define _Z80EX_H_INCLUDED + +#include "z80ex_common.h" + +typedef +enum {regAF,regBC,regDE,regHL,regAF_,regBC_,regDE_,regHL_,regIX,regIY,regPC,regSP,regI,regR,regR7,regIM/*0,1 or 2*/,regIFF1,regIFF2} +Z80_REG_T; + +typedef struct { + int API_revision; + int major; + int minor; + char *release_type; /*e.g., "beta", "RC"*/ + char *as_string; /*full version string, e.g., "0.16.7beta"*/ +} Z80EX_VERSION; + +#ifndef __Z80EX_SELF_INCLUDE + +struct _z80_cpu_context; +typedef struct _z80_cpu_context Z80EX_CONTEXT; + +#endif + +/*callback prototypes:*/ + +/*to be called on each T-State [optional]*/ +typedef void (*z80ex_tstate_cb)(Z80EX_CONTEXT *cpu, void *user_data); + +/*read byte from memory -- called when RD & MREQ goes active. +m1_state will be 1 if M1 signal is active*/ +typedef Z80EX_BYTE (*z80ex_mread_cb)(Z80EX_CONTEXT *cpu, Z80EX_WORD addr, int m1_state, void *user_data); + +/*write to memory -- called when WR & MREQ goes active*/ +typedef void (*z80ex_mwrite_cb)(Z80EX_CONTEXT *cpu, Z80EX_WORD addr, Z80EX_BYTE value, void *user_data); + +/*read byte from -- called when RD & IORQ goes active*/ +typedef Z80EX_BYTE (*z80ex_pread_cb)(Z80EX_CONTEXT *cpu, Z80EX_WORD port, void *user_data); + +/*write to -- called when WR & IORQ goes active*/ +typedef void (*z80ex_pwrite_cb)(Z80EX_CONTEXT *cpu, Z80EX_WORD port, Z80EX_BYTE value, void *user_data); + +/*read byte of interrupt vector -- called when M1 and IORQ goes active*/ +typedef Z80EX_BYTE (*z80ex_intread_cb)(Z80EX_CONTEXT *cpu, void *user_data); + +/*called when the RETI instruction is executed (useful for emulating Z80 PIO/CTC and such)*/ +typedef void (*z80ex_reti_cb)(Z80EX_CONTEXT *cpu, void *user_data); + +#ifndef __Z80EX_SELF_INCLUDE + +#ifdef __cplusplus +extern "C" { +#endif + +/*get version info*/ +extern Z80EX_VERSION *z80ex_get_version(); + +/*create and initialize CPU*/ +extern Z80EX_CONTEXT *z80ex_create(z80ex_mread_cb mrcb_fn, void *mrcb_data, + z80ex_mwrite_cb mwcb_fn, void *mwcb_data, + z80ex_pread_cb prcb_fn, void *prcb_data, + z80ex_pwrite_cb pwcb_fn, void *pwcb_data, + z80ex_intread_cb ircb_fn, void *ircb_data); + +/*destroy CPU*/ +extern void z80ex_destroy(Z80EX_CONTEXT *cpu); + +/*do next opcode (instruction or prefix), return number of T-states*/ +extern int z80ex_step(Z80EX_CONTEXT *cpu); + +/*returns type of the last opcode, processed with z80ex_step. +type will be 0 for complete instruction, or dd/fd/cb/ed for opcode prefix.*/ +extern Z80EX_BYTE z80ex_last_op_type(Z80EX_CONTEXT *cpu); + +/*set T-state callback*/ +extern void z80ex_set_tstate_callback(Z80EX_CONTEXT *cpu, z80ex_tstate_cb cb_fn, void *user_data); + +/*set RETI callback*/ +extern void z80ex_set_reti_callback(Z80EX_CONTEXT *cpu, z80ex_reti_cb cb_fn, void *user_data); + +/*set memory read callback*/ +extern void z80ex_set_memread_callback(Z80EX_CONTEXT *cpu, z80ex_mread_cb mrcb_fn, void *mrcb_data); + +/*set memory write callback*/ +extern void z80ex_set_memwrite_callback(Z80EX_CONTEXT *cpu, z80ex_mwrite_cb mwcb_fn, void *mwcb_data); + +/*set port read callback*/ +extern void z80ex_set_portread_callback(Z80EX_CONTEXT *cpu, z80ex_pread_cb prcb_fn, void *prcb_data); + +/*set port write callback*/ +extern void z80ex_set_portwrite_callback(Z80EX_CONTEXT *cpu, z80ex_pwrite_cb pwcb_fn, void *pwcb_data); + +/*set INT read callback*/ +extern void z80ex_set_intread_callback(Z80EX_CONTEXT *cpu, z80ex_intread_cb ircb_fn, void *ircb_data); + +/*maskable interrupt*/ +/*returns number of T-states if interrupt was accepted, otherwise 0*/ +extern int z80ex_int(Z80EX_CONTEXT *cpu); + +/*non-maskable interrupt*/ +/*returns number of T-states (11 if interrupt was accepted, or 0 if processor +is doing an instruction right now)*/ +extern int z80ex_nmi(Z80EX_CONTEXT *cpu); + +/*reset CPU*/ +extern void z80ex_reset(Z80EX_CONTEXT *cpu); + +/*get register value*/ +extern Z80EX_WORD z80ex_get_reg(Z80EX_CONTEXT *cpu, Z80_REG_T reg); + +/*set register value (for 1-byte registers lower byte of will be used)*/ +extern void z80ex_set_reg(Z80EX_CONTEXT *cpu, Z80_REG_T reg, Z80EX_WORD value); + +/*returns 1 if CPU doing HALT instruction now*/ +extern int z80ex_doing_halt(Z80EX_CONTEXT *cpu); + +/*when called from callbacks, returns current T-state of the executing opcode (instruction or prefix), +else returns T-states taken by last opcode executed*/ +extern int z80ex_op_tstate(Z80EX_CONTEXT *cpu); + +/*generate Wait-states. (T-state callback will be called times, when defined). +should be used to simulate WAIT signal or disabled CLK*/ +extern void z80ex_w_states(Z80EX_CONTEXT *cpu, unsigned w_states); + +/*spend one T-state doing nothing (often IO devices cannot handle data request on +the first T-state at which RD/WR goes active). +for I/O callbacks*/ +extern void z80ex_next_t_state(Z80EX_CONTEXT *cpu); + +/*returns 1 if maskable interrupts are possible in current z80 state*/ +extern int z80ex_int_possible(Z80EX_CONTEXT *cpu); + +/*returns 1 if non-maskable interrupts are possible in current z80 state*/ +extern int z80ex_nmi_possible(Z80EX_CONTEXT *cpu); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif diff --git a/third_party/z80ex/include/z80ex_common.h b/third_party/z80ex/include/z80ex_common.h new file mode 100644 index 00000000..4f4ffe1a --- /dev/null +++ b/third_party/z80ex/include/z80ex_common.h @@ -0,0 +1,43 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#ifndef _Z80EX_COMMON_H_INCLUDED +#define _Z80EX_COMMON_H_INCLUDED + +#ifdef _MSC_VER +#define LIB_EXPORT __declspec(dllexport) +#else +#define LIB_EXPORT +#endif + +#if defined(__SYMBIAN32__) +typedef unsigned char Z80EX_BYTE; +typedef signed char Z80EX_SIGNED_BYTE; +typedef unsigned short Z80EX_WORD; +typedef unsigned int Z80EX_DWORD; +#elif defined(__GNUC__) +#include +typedef uint8_t Z80EX_BYTE; +typedef int8_t Z80EX_SIGNED_BYTE; +typedef uint16_t Z80EX_WORD; +typedef uint32_t Z80EX_DWORD; +#elif defined(_MSC_VER) +typedef unsigned __int8 Z80EX_BYTE; +typedef signed __int8 Z80EX_SIGNED_BYTE; +typedef unsigned __int16 Z80EX_WORD; +typedef unsigned __int32 Z80EX_DWORD; +#else +typedef unsigned char Z80EX_BYTE; +typedef signed char Z80EX_SIGNED_BYTE; +typedef unsigned short Z80EX_WORD; +typedef unsigned int Z80EX_DWORD; +#endif + +#endif diff --git a/third_party/z80ex/include/z80ex_dasm.h b/third_party/z80ex/include/z80ex_dasm.h new file mode 100644 index 00000000..c1f1bf36 --- /dev/null +++ b/third_party/z80ex/include/z80ex_dasm.h @@ -0,0 +1,52 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#ifndef _Z80EX_DASM_H_INCLUDED +#define _Z80EX_DASM_H_INCLUDED + +#include "z80ex_common.h" + +/*callback that returns byte for a given adress*/ +typedef Z80EX_BYTE (*z80ex_dasm_readbyte_cb)(Z80EX_WORD addr, void *user_data); + +/*flags*/ +enum Z80EX_DASM_FLAGS { + WORDS_DEC = 1, + BYTES_DEC = 2 +}; + +#ifndef __Z80EX_SELF_INCLUDE + +#ifdef __cplusplus +extern "C" { +#endif + +/*z80ex_dasm: disassemble single instruction at the given adress +output - text buffer to write disassembly to +output_size - length of the text buffer +flags - output format settings, or 0 for defaults +t_states - will be set to T-states of the instruction +t_states2 - for branching commands: T-states when PC is changed, for other commands: 0 +readbyte_cb - callback function for reading byte at given adress +addr - adress of the first byte of the instruction to disassemble +user_data - will be passed to readbyte_cb callback + +returns: length of processed instruction in bytes +*/ +extern int z80ex_dasm(char *output, int output_size, unsigned flags, int *t_states, int *t_states2, + z80ex_dasm_readbyte_cb readbyte_cb, Z80EX_WORD addr, void *user_data); + +#ifdef __cplusplus +} +#endif + +#endif + +#endif diff --git a/third_party/z80ex/macros.h b/third_party/z80ex/macros.h new file mode 100644 index 00000000..13abaaa7 --- /dev/null +++ b/third_party/z80ex/macros.h @@ -0,0 +1,1031 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#ifndef _Z80EX_MACROS_H_INCLUDED +#define _Z80EX_MACROS_H_INCLUDED + +/* Macros used for accessing the registers */ +#define A cpu->af.b.h +#define F cpu->af.b.l +#define AF cpu->af.w + +#define B cpu->bc.b.h +#define C cpu->bc.b.l +#define BC cpu->bc.w + +#define D cpu->de.b.h +#define E cpu->de.b.l +#define DE cpu->de.w + +#define H cpu->hl.b.h +#define L cpu->hl.b.l +#define HL cpu->hl.w + +#define A_ cpu->af_.b.h +#define F_ cpu->af_.b.l +#define AF_ cpu->af_.w + +#define B_ cpu->bc_.b.h +#define C_ cpu->bc_.b.l +#define BC_ cpu->bc_.w + +#define D_ cpu->de_.b.h +#define E_ cpu->de_.b.l +#define DE_ cpu->de_.w + +#define H_ cpu->hl_.b.h +#define L_ cpu->hl_.b.l +#define HL_ cpu->hl_.w + +#define IXH cpu->ix.b.h +#define IXL cpu->ix.b.l +#define IX cpu->ix.w + +#define IYH cpu->iy.b.h +#define IYL cpu->iy.b.l +#define IY cpu->iy.w + +#define SPH cpu->sp.b.h +#define SPL cpu->sp.b.l +#define SP cpu->sp.w + +#define PCH cpu->pc.b.h +#define PCL cpu->pc.b.l +#define PC cpu->pc.w + +#define I cpu->i +#define R cpu->r +#define R7 cpu->r7 + +#define IFF1 cpu->iff1 +#define IFF2 cpu->iff2 +#define IM cpu->im + +#define MEMPTRh cpu->memptr.b.h +#define MEMPTRl cpu->memptr.b.l +#define MEMPTR cpu->memptr.w + + +/* The flags */ + +#define FLAG_C 0x01 +#define FLAG_N 0x02 +#define FLAG_P 0x04 +#define FLAG_V FLAG_P +#define FLAG_3 0x08 +#define FLAG_H 0x10 +#define FLAG_5 0x20 +#define FLAG_Z 0x40 +#define FLAG_S 0x80 + +/*read opcode*/ +#define READ_OP_M1() (cpu->int_vector_req? cpu->intread_cb(cpu, cpu->intread_cb_user_data) : cpu->mread_cb(cpu, PC++, 1, cpu->mread_cb_user_data)) + +/*read opcode argument*/ +#define READ_OP() (cpu->int_vector_req? cpu->intread_cb(cpu, cpu->intread_cb_user_data) : cpu->mread_cb(cpu, PC++, 0, cpu->mread_cb_user_data)) + + +#ifndef Z80EX_OPSTEP_FAST_AND_ROUGH + +/*wait until end of opcode-tstate given (to be used on opcode execution).*/ +#define T_WAIT_UNTIL(t_state) \ +{ \ + unsigned nn; \ + if(cpu->tstate_cb == NULL) { \ + if (t_state > cpu->op_tstate) { \ + cpu->tstate += t_state - cpu->op_tstate; \ + cpu->op_tstate = t_state; \ + } \ + } \ + else { \ + for(nn=cpu->op_tstate;nn < t_state;nn++) { \ + cpu->op_tstate++; \ + cpu->tstate++; \ + cpu->tstate_cb(cpu, cpu->tstate_cb_user_data); \ + } \ + } \ +} + +/*spend t-states (not affecting opcode-tstate counter, +for using outside of certain opcode execution)*/ +#define TSTATES(amount) \ +{\ + int nn;\ + if(cpu->tstate_cb == NULL) { \ + cpu->tstate += amount; \ + } \ + else { \ + for(nn=0; nn < amount; nn++) { \ + cpu->tstate++; \ + cpu->tstate_cb(cpu, cpu->tstate_cb_user_data); \ + }\ + } \ +} + +/*read byte from memory*/ +#define READ_MEM(result, addr, t_state) \ +{ \ + T_WAIT_UNTIL(t_state); \ + result=(cpu->mread_cb(cpu, (addr), 0, cpu->mread_cb_user_data)); \ +} + +/*read byte from port*/ +#define READ_PORT(result, port, t_state) \ +{ \ + T_WAIT_UNTIL(t_state); \ + result=(cpu->pread_cb(cpu, (port), cpu->pread_cb_user_data)); \ +} + +/*write byte to memory*/ +#define WRITE_MEM(addr, vbyte, t_state) \ +{ \ + T_WAIT_UNTIL(t_state); \ + cpu->mwrite_cb(cpu, addr, vbyte, cpu->mwrite_cb_user_data); \ +} + +/*write byte to port*/ +#define WRITE_PORT(port, vbyte, t_state) \ +{ \ + T_WAIT_UNTIL(t_state); \ + cpu->pwrite_cb(cpu, (port), vbyte, cpu->pwrite_cb_user_data); \ +} + +#else +/*Z80EX_OPSTEP_FAST_AND_ROUGH*/ + +#define T_WAIT_UNTIL(t_state) {cpu->tstate = t_state; cpu->op_tstate = t_state;} + +#define TSTATES(amount) {cpu->tstate += amount;} + +/*read byte from memory*/ +#define READ_MEM(result, addr, t_state) \ +{ \ + result=(cpu->mread_cb(cpu, (addr), 0, cpu->mread_cb_user_data)); \ +} + +/*read byte from port*/ +#define READ_PORT(result, port, t_state) \ +{ \ + result=(cpu->pread_cb(cpu, (port), cpu->pread_cb_user_data)); \ +} + +/*write byte to memory*/ +#define WRITE_MEM(addr, vbyte, t_state) \ +{ \ + cpu->mwrite_cb(cpu, addr, vbyte, cpu->mwrite_cb_user_data); \ +} + +/*write byte to port*/ +#define WRITE_PORT(port, vbyte, t_state) \ +{ \ + cpu->pwrite_cb(cpu, (port), vbyte, cpu->pwrite_cb_user_data); \ +} + +#endif +/*<< #ifndef Z80EX_OPSTEP_FAST_AND_ROUGH*/ + + +/* instructions */ + +#define AND(value)\ +{\ + A &= (value);\ + F = FLAG_H | sz53p_table[A];\ +} + +#define ADC(a, value)\ +{\ + Z80EX_WORD adctemp = A + (value) + ( F & FLAG_C ); \ + Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( ( adctemp & 0x88 ) >> 1 ); \ + A=adctemp;\ + F = ( adctemp & 0x100 ? FLAG_C : 0 ) |\ + halfcarry_add_table[lookup & 0x07] | overflow_add_table[lookup >> 4] |\ + sz53_table[A];\ +} + +#define ADC16(hl, value)\ +{\ + Z80EX_DWORD add16temp= HL + (value) + ( F & FLAG_C ); \ + Z80EX_BYTE lookup = ( ( HL & 0x8800 ) >> 11 ) | \ + ( ( (value) & 0x8800 ) >> 10 ) | \ + ( ( add16temp & 0x8800 ) >> 9 ); \ + MEMPTR=hl+1;\ + HL = add16temp;\ + F = ( add16temp & 0x10000 ? FLAG_C : 0 )|\ + overflow_add_table[lookup >> 4] |\ + ( H & ( FLAG_3 | FLAG_5 | FLAG_S ) ) |\ + halfcarry_add_table[lookup&0x07]|\ + ( HL ? 0 : FLAG_Z );\ +} + +#define ADD(a, value)\ +{\ + Z80EX_WORD addtemp = A + (value); \ + Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( ( addtemp & 0x88 ) >> 1 ); \ + A=addtemp;\ + F = ( addtemp & 0x100 ? FLAG_C : 0 ) |\ + halfcarry_add_table[lookup & 0x07] | overflow_add_table[lookup >> 4] |\ + sz53_table[A];\ +} + +#define ADD16(value1,value2)\ +{\ + Z80EX_DWORD add16temp = (value1) + (value2); \ + Z80EX_BYTE lookup = ( ( (value1) & 0x0800 ) >> 11 ) | \ + ( ( (value2) & 0x0800 ) >> 10 ) | \ + ( ( add16temp & 0x0800 ) >> 9 ); \ + MEMPTR=value1+1;\ + (value1) = add16temp;\ + F = ( F & ( FLAG_V | FLAG_Z | FLAG_S ) ) |\ + ( add16temp & 0x10000 ? FLAG_C : 0 )|\ + ( ( add16temp >> 8 ) & ( FLAG_3 | FLAG_5 ) ) |\ + halfcarry_add_table[lookup];\ +} + +#define BIT( bit, value ) \ +{ \ + F = ( F & FLAG_C ) | FLAG_H | sz53p_table[(value) & (0x01 << (bit))] | ((value) & 0x28); \ +} + +/*BIT n,(IX+d/IY+d) and BIT n,(HL)*/ +#define BIT_MPTR( bit, value) \ +{ \ + F = ( F & FLAG_C ) | FLAG_H | (sz53p_table[(value) & (0x01 << (bit))] & 0xD7) | ((MEMPTRh) & 0x28); \ +} + +#define CALL(addr, wr1, wr2) \ +{\ + PUSH(PC,wr1,wr2); \ + PC=addr; \ + MEMPTR=addr;\ +} + +#define CP(value)\ +{\ + Z80EX_WORD cptemp = A - value; \ + Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( ( cptemp & 0x88 ) >> 1 ); \ + F = ( cptemp & 0x100 ? FLAG_C : ( cptemp ? 0 : FLAG_Z ) ) | FLAG_N |\ + halfcarry_sub_table[lookup & 0x07] |\ + overflow_sub_table[lookup >> 4] |\ + ( value & ( FLAG_3 | FLAG_5 ) ) |\ + ( cptemp & FLAG_S );\ +} + +#define DEC(value)\ +{\ + F = ( F & FLAG_C ) | ( (value)&0x0f ? 0 : FLAG_H ) | FLAG_N;\ + (value)--;\ + F |= ( (value)==0x7f ? FLAG_V : 0 ) | sz53_table[value];\ +} + +#define DEC16(value)\ +{\ + (value)--;\ +} + +#define INC(value)\ +{\ + (value)++;\ + F = ( F & FLAG_C ) | ( (value)==0x80 ? FLAG_V : 0 ) |\ + ( (value)&0x0f ? 0 : FLAG_H ) | sz53_table[(value)];\ +} + +#define INC16(value)\ +{\ + (value)++;\ +} + +#define LD(dst, src) \ +{\ + dst=src; \ +} + +/*ld (nnnn|BC|DE), A*/ +#define LD_A_TO_ADDR_MPTR(dst, src, addr) \ +{\ + dst=src; \ + MEMPTRh=A;\ + MEMPTRl=((addr+1) & 0xFF);\ +} + +/*ld a,(BC|DE|nnnn)*/ +#define LD_A_FROM_ADDR_MPTR(dst, src, addr) \ +{\ + dst=src; \ + MEMPTR=addr+1;\ +} + +#define LD16(dst, src) \ +{\ + dst=src; \ +} + +/*ld (nnnn),BC|DE|SP|HL|IX|IY*/ +#define LD_RP_TO_ADDR_MPTR_16(dst, src, addr) \ +{\ + dst=src; \ + MEMPTR=addr+1;\ +} + +/*ld BC|DE|SP|HL|IX|IY,(nnnn)*/ +#define LD_RP_FROM_ADDR_MPTR_16(dst, src, addr) \ +{\ + dst=src; \ + MEMPTR=addr+1;\ +} + +#define JP_NO_MPTR(addr) \ +{ \ + PC=addr; \ +} + +#define JP(addr) \ +{ \ + PC=addr; \ + MEMPTR=addr;\ +} + +#define JR(offset) \ +{\ + PC+=offset; \ + MEMPTR=PC;\ +} + +#define OR(value)\ +{\ + A |= (value);\ + F = sz53p_table[A];\ +} + +#define OUT(port,reg, wr) \ +{\ + WRITE_PORT(port,reg,wr); \ + MEMPTR=port+1;\ +} + +/*OUT (nn),A*/ +#define OUT_A(port,reg, wr) \ +{\ + WRITE_PORT(port,reg,wr); \ + MEMPTRl=((port+1) & 0xFF);\ + MEMPTRh=A;\ +} + +#define IN(reg,port,rd) \ +{\ + READ_PORT(reg,port,rd); \ + F = ( F & FLAG_C) | sz53p_table[(reg)];\ + MEMPTR=port+1;\ +} + +/*IN A,(nn)*/ +#define IN_A(reg,port,rd) \ +{\ + READ_PORT(reg,port,rd); \ + MEMPTR=port+1;\ +} + +#define IN_F(port, rd) \ +{\ + Z80EX_BYTE val; \ + READ_PORT(val, port, rd); \ + F = ( F & FLAG_C) | sz53p_table[(val)];\ + MEMPTR=port+1;\ +} + +#define POP(rp, rd1, rd2) \ +{\ + regpair tmp; \ + READ_MEM(tmp.b.l,SP++,rd1);\ + READ_MEM(tmp.b.h,SP++,rd2);\ + rp=tmp.w;\ +} + +/*wr1=t-states before first byte, wr2=t-states before second*/ +#define PUSH(rp, wr1, wr2) \ +{\ + regpair tmp; \ + tmp.w=rp; \ + WRITE_MEM(--SP, tmp.b.h, wr1); \ + WRITE_MEM(--SP, tmp.b.l, wr2); \ +} + +#define RET(rd1, rd2) \ +{\ + POP(PC, rd1, rd2);\ + MEMPTR=PC;\ +} + +#define RL(value)\ +{\ + Z80EX_BYTE rltemp = (value); \ + (value) = ( (value)<<1 ) | ( F & FLAG_C );\ + F = ( rltemp >> 7 ) | sz53p_table[(value)];\ +} + +#define RLC(value)\ +{\ + (value) = ( (value)<<1 ) | ( (value)>>7 );\ + F = ( (value) & FLAG_C ) | sz53p_table[(value)];\ +} + +#define RR(value)\ +{\ + Z80EX_BYTE rrtemp = (value); \ + (value) = ( (value)>>1 ) | ( F << 7 );\ + F = ( rrtemp & FLAG_C ) | sz53p_table[(value)];\ +} + +#define RRC(value)\ +{\ + F = (value) & FLAG_C;\ + (value) = ( (value)>>1 ) | ( (value)<<7 );\ + F |= sz53p_table[(value)];\ +} + +#define RST(value, w1, w2)\ +{\ + PUSH(PC, w1, w2);\ + PC=(value);\ + MEMPTR=PC;\ +} + +#define SBC(a, value)\ +{\ + Z80EX_WORD sbctemp = A - (value) - ( F & FLAG_C ); \ + Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( ( sbctemp & 0x88 ) >> 1 ); \ + A=sbctemp;\ + F = ( sbctemp & 0x100 ? FLAG_C : 0 ) | FLAG_N |\ + halfcarry_sub_table[lookup & 0x07] | overflow_sub_table[lookup >> 4] |\ + sz53_table[A];\ +} + +#define SBC16(hl, value)\ +{\ + Z80EX_DWORD sub16temp = HL - (value) - (F & FLAG_C); \ + Z80EX_BYTE lookup = ( ( HL & 0x8800 ) >> 11 ) | \ + ( ( (value) & 0x8800 ) >> 10 ) | \ + ( ( sub16temp & 0x8800 ) >> 9 ); \ + MEMPTR=hl+1;\ + HL = sub16temp;\ + F = ( sub16temp & 0x10000 ? FLAG_C : 0 ) |\ + FLAG_N | overflow_sub_table[lookup >> 4] |\ + ( H & ( FLAG_3 | FLAG_5 | FLAG_S ) ) |\ + halfcarry_sub_table[lookup&0x07] |\ + ( HL ? 0 : FLAG_Z) ;\ +} + +#define SLA(value)\ +{\ + F = (value) >> 7;\ + (value) <<= 1;\ + F |= sz53p_table[(value)];\ +} + +#define SLL(value)\ +{\ + F = (value) >> 7;\ + (value) = ( (value) << 1 ) | 0x01;\ + F |= sz53p_table[(value)];\ +} + +#define SRA(value)\ +{\ + F = (value) & FLAG_C;\ + (value) = ( (value) & 0x80 ) | ( (value) >> 1 );\ + F |= sz53p_table[(value)];\ +} + +#define SRL(value)\ +{\ + F = (value) & FLAG_C;\ + (value) >>= 1;\ + F |= sz53p_table[(value)];\ +} + +#define SUB(value)\ +{\ + Z80EX_WORD subtemp = A - (value); \ + Z80EX_BYTE lookup = ( ( A & 0x88 ) >> 3 ) | \ + ( ( (value) & 0x88 ) >> 2 ) | \ + ( (subtemp & 0x88 ) >> 1 ); \ + A=subtemp;\ + F = ( subtemp & 0x100 ? FLAG_C : 0 ) | FLAG_N |\ + halfcarry_sub_table[lookup & 0x07] | overflow_sub_table[lookup >> 4] |\ + sz53_table[A];\ +} + +#define XOR(value)\ +{\ + A ^= (value);\ + F = sz53p_table[A];\ +} + +#define RRD(rd, wr) \ +{\ + Z80EX_BYTE bytetemp;\ + READ_MEM(bytetemp, HL, rd);\ + WRITE_MEM(HL, ( A << 4 ) | ( bytetemp >> 4 ) ,wr);\ + A = ( A & 0xf0 ) | ( bytetemp & 0x0f );\ + F = ( F & FLAG_C ) | sz53p_table[A];\ + MEMPTR=HL+1;\ +} + +#define RLD(rd, wr) \ +{\ + Z80EX_BYTE bytetemp;\ + READ_MEM(bytetemp, HL, rd);\ + WRITE_MEM(HL, (bytetemp << 4 ) | ( A & 0x0f ) ,wr);\ + A = ( A & 0xf0 ) | ( bytetemp >> 4 );\ + F = ( F & FLAG_C ) | sz53p_table[A];\ + MEMPTR=HL+1;\ +} + + +#define IM_(mode)\ +{\ + IM=mode;\ +} + +#define LD_A_R() \ +{\ + A=(R&0x7f) | (R7&0x80);\ + F = ( F & FLAG_C ) | sz53_table[A] | ( IFF2 ? FLAG_V : 0 );\ + cpu->reset_PV_on_int=1;\ +} + +#define LD_R_A() \ +{\ + R=R7=A;\ +} + +#define LD_A_I() \ +{\ + A=I;\ + F = ( F & FLAG_C ) | sz53_table[A] | ( IFF2 ? FLAG_V : 0 );\ + cpu->reset_PV_on_int=1;\ +} + +#define NEG() \ +{\ + Z80EX_BYTE bytetemp=A;\ + A=0;\ + SUB(bytetemp);\ +} + +#define RETI(rd1, rd2) \ +{\ + IFF1=IFF2;\ + RET(rd1, rd2);\ + if(cpu->reti_cb != NULL) cpu->reti_cb(cpu, cpu->reti_cb_user_data); \ +} + +/*same as RETI, only opcode is different*/ +#define RETN(rd1, rd2) \ +{\ + IFF1=IFF2;\ + RET(rd1, rd2);\ +} + +#define LDI(rd, wr) \ +{\ + Z80EX_BYTE bytetemp;\ + READ_MEM(bytetemp, HL, rd);\ + BC--;\ + WRITE_MEM(DE,bytetemp,wr);\ + DE++; HL++;\ + bytetemp += A;\ + F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\ + ( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\ +} + +#define CPI(rd) \ +{\ + Z80EX_BYTE value,bytetemp,lookup;\ + READ_MEM(value, HL, rd);\ + bytetemp = A - value;\ + lookup = ( ( A & 0x08 ) >> 3 ) |\ + ( ( (value) & 0x08 ) >> 2 ) |\ + ( ( bytetemp & 0x08 ) >> 1 );\ + HL++; BC--;\ + F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\ + halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\ + ( bytetemp & FLAG_S );\ + if(F & FLAG_H) bytetemp--;\ + F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\ + MEMPTR=MEMPTR+1;\ +} + +/*undocumented flag effects for block output operations*/ +#define OUT_BL(pbyte) \ +{\ + Z80EX_BYTE kval;\ + kval=pbyte+L;\ + if((pbyte+L) > 255) F |= (FLAG_C | FLAG_H);\ + F |= parity_table[((kval & 7) ^ B)];\ +} + +/*undocumented flag effects for block input operations*/ +#define IN_BL(pbyte, c_add) \ +{\ + Z80EX_BYTE kval;\ + kval=pbyte+((C+(c_add)) & 0xff);\ + if((pbyte+((C+(c_add)) & 0xff)) > 255) F |= (FLAG_C | FLAG_H);\ + F |= parity_table[((kval & 7) ^ B)];\ +} + +#define INI(rd, wr) \ +{\ + Z80EX_BYTE initemp;\ + MEMPTR=BC+1;\ + READ_PORT(initemp, BC, rd);\ + WRITE_MEM( HL, initemp, wr );\ + B--; HL++;\ + F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + IN_BL(initemp,1);\ +} + +#define OUTI(rd, wr) \ +{\ + Z80EX_BYTE outitemp;\ + READ_MEM(outitemp, HL, rd);\ + B--; \ + MEMPTR=BC+1;\ + WRITE_PORT(BC,outitemp,wr);\ + HL++;\ + F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + OUT_BL(outitemp);\ +} + +#define LDD(rd, wr) \ +{\ + Z80EX_BYTE bytetemp;\ + READ_MEM(bytetemp, HL, rd);\ + BC--;\ + WRITE_MEM(DE,bytetemp,wr);\ + DE--; HL--;\ + bytetemp += A;\ + F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\ + ( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\ +} + +#define CPD(rd) \ +{\ + Z80EX_BYTE value,bytetemp,lookup;\ + READ_MEM(value, HL, rd);\ + bytetemp = A - value;\ + lookup = ( ( A & 0x08 ) >> 3 ) |\ + ( ( (value) & 0x08 ) >> 2 ) |\ + ( ( bytetemp & 0x08 ) >> 1 );\ + HL--; BC--;\ + F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\ + halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\ + ( bytetemp & FLAG_S );\ + if(F & FLAG_H) bytetemp--;\ + F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\ + MEMPTR=MEMPTR-1;\ +} + +#define IND(rd,wr) \ +{\ + Z80EX_BYTE initemp;\ + MEMPTR=BC-1;\ + READ_PORT(initemp, BC, rd);\ + WRITE_MEM( HL, initemp, wr );\ + B--; HL--;\ + F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + IN_BL(initemp,-1)\ +} + +#define OUTD(rd, wr) \ +{\ + Z80EX_BYTE outitemp;\ + READ_MEM(outitemp, HL, rd);\ + B--;\ + MEMPTR=BC-1;\ + WRITE_PORT(BC,outitemp,wr);\ + HL--;\ + F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + OUT_BL(outitemp);\ +} + +#define LDIR(t1,t2,rd,wr) \ +{\ + Z80EX_BYTE bytetemp;\ + READ_MEM(bytetemp, HL, rd);\ + WRITE_MEM(DE,bytetemp,wr);\ + HL++; DE++; BC--;\ + bytetemp += A;\ + F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\ + ( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\ + if(BC) {\ + PC-=2;\ + T_WAIT_UNTIL(t2);\ + MEMPTR=PC+1;\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ +} + +#define CPIR(t1, t2, rd) \ +{\ + Z80EX_BYTE value,bytetemp,lookup;\ + READ_MEM(value, HL, rd);\ + bytetemp = A - value;\ + lookup = ( ( A & 0x08 ) >> 3 ) |\ + ( ( (value) & 0x08 ) >> 2 ) |\ + ( ( bytetemp & 0x08 ) >> 1 );\ + HL++; BC--;\ + F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\ + halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\ + ( bytetemp & FLAG_S );\ + if(F & FLAG_H) bytetemp--;\ + F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\ + if( ( F & ( FLAG_V | FLAG_Z ) ) == FLAG_V ) {\ + PC-=2;\ + MEMPTR=PC+1;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + MEMPTR=MEMPTR+1;\ + T_WAIT_UNTIL(t1);\ + }\ +} + +#define INIR(t1,t2,rd,wr) \ +{\ + Z80EX_BYTE initemp;\ + READ_PORT(initemp, BC, rd);\ + WRITE_MEM( HL, initemp, wr);\ + MEMPTR=BC+1;\ + B--; HL++;\ + F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + if( B ) {\ + PC -= 2;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ + IN_BL(initemp,1)\ +} + +#define OTIR(t1,t2,rd,wr) \ +{\ + Z80EX_BYTE outitemp;\ + READ_MEM(outitemp, HL, rd);\ + B--;\ + MEMPTR=BC+1;\ + WRITE_PORT(BC, outitemp, wr);\ + HL++;\ + F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + if( B ) {\ + PC -= 2;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ + OUT_BL(outitemp);\ +} + +#define LDDR(t1,t2,rd,wr) \ +{\ + Z80EX_BYTE bytetemp;\ + READ_MEM(bytetemp, HL, rd);\ + WRITE_MEM(DE,bytetemp,wr);\ + HL--; DE--; BC--;\ + bytetemp += A;\ + F = ( F & ( FLAG_C | FLAG_Z | FLAG_S ) ) | ( BC ? FLAG_V : 0 ) |\ + ( bytetemp & FLAG_3 ) | ( (bytetemp & 0x02) ? FLAG_5 : 0 );\ + if(BC) {\ + PC-=2;\ + T_WAIT_UNTIL(t2);\ + MEMPTR=PC+1;\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ +} + +#define CPDR(t1,t2,rd) \ +{\ + Z80EX_BYTE value,bytetemp,lookup;\ + READ_MEM(value, HL, rd);\ + bytetemp = A - value;\ + lookup = ( ( A & 0x08 ) >> 3 ) |\ + ( ( (value) & 0x08 ) >> 2 ) |\ + ( ( bytetemp & 0x08 ) >> 1 );\ + HL--; BC--;\ + F = ( F & FLAG_C ) | ( BC ? ( FLAG_V | FLAG_N ) : FLAG_N ) |\ + halfcarry_sub_table[lookup] | ( bytetemp ? 0 : FLAG_Z ) |\ + ( bytetemp & FLAG_S );\ + if(F & FLAG_H) bytetemp--;\ + F |= ( bytetemp & FLAG_3 ) | ( (bytetemp&0x02) ? FLAG_5 : 0 );\ + if( ( F & ( FLAG_V | FLAG_Z ) ) == FLAG_V ) {\ + PC-=2;\ + MEMPTR=PC+1;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + MEMPTR=MEMPTR-1;\ + T_WAIT_UNTIL(t1);\ + }\ +} + +#define INDR(t1,t2,rd,wr) \ +{\ + Z80EX_BYTE initemp;\ + READ_PORT(initemp, BC, rd);\ + WRITE_MEM( HL, initemp, wr );\ + MEMPTR=BC-1;\ + B--; HL--;\ + F = ( initemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + if( B ) {\ + PC -= 2;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ + IN_BL(initemp,-1)\ +} + +#define OTDR(t1,t2,rd,wr) \ +{\ + Z80EX_BYTE outitemp;\ + READ_MEM(outitemp, HL, rd);\ + B--;\ + MEMPTR=BC-1;\ + WRITE_PORT(BC,outitemp,wr);\ + HL--;\ + F = (outitemp & 0x80 ? FLAG_N : 0 ) | sz53_table[B];\ + if( B ) {\ + PC -= 2;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ + OUT_BL(outitemp);\ +} + +#define RLCA() \ +{\ + A = ( A << 1 ) | ( A >> 7 );\ + F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\ + ( A & ( FLAG_C | FLAG_3 | FLAG_5 ) );\ +} + +#define RRCA() \ +{\ + F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) | ( A & FLAG_C );\ + A = ( A >> 1) | ( A << 7 );\ + F |= ( A & ( FLAG_3 | FLAG_5 ) );\ +} + +#define DJNZ(offset, t1, t2) \ +{\ + B--;\ + if(B) {\ + PC += offset;\ + MEMPTR=PC;\ + T_WAIT_UNTIL(t2);\ + }\ + else\ + {\ + T_WAIT_UNTIL(t1);\ + }\ +} + +#define RLA() \ +{\ + Z80EX_BYTE bytetemp = A;\ + A = ( A << 1 ) | ( F & FLAG_C );\ + F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\ + ( A & ( FLAG_3 | FLAG_5 ) ) | ( bytetemp >> 7 );\ +} + +#define RRA() \ +{\ + Z80EX_BYTE bytetemp = A;\ + A = ( A >> 1 ) | ( F << 7 );\ + F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\ + ( A & ( FLAG_3 | FLAG_5 ) ) | ( bytetemp & FLAG_C ) ;\ +} + +#define DAA() \ +{\ + const Z80EX_BYTE *tdaa = (daatab+(A+0x100*((F & 3) + ((F >> 2) & 4)))*2);\ + F = *tdaa; A = *(tdaa + 1);\ +} + +/* old, non-exact version, from FUSE +#define DAA() \ +{\ + Z80EX_BYTE add = 0, carry = ( F & FLAG_C );\ + if( ( F & FLAG_H ) || ( (A & 0x0f)>9 ) ) add=6;\ + if( carry || (A > 0x9f ) ) add|=0x60;\ + if( A > 0x99 ) carry=1;\ + if ( F & FLAG_N ) {\ + SUB(add);\ + } else {\ + if( (A>0x90) && ( (A & 0x0f)>9) ) add|=0x60;\ + ADD(A, add);\ + }\ + F = ( F & ~( FLAG_C | FLAG_P) ) | carry | parity_table[A];\ +} +*/ + +#define EX(rp1,rp2) \ +{\ + Z80EX_WORD wordtemp=rp1; rp1=rp2; rp2=wordtemp;\ +} + +#define EX_MPTR(rp1,rp2) \ +{\ + Z80EX_WORD wordtemp=rp1; rp1=rp2; rp2=wordtemp;\ + MEMPTR=wordtemp;\ +} + +#define CPL() \ +{\ + A ^= 0xff;\ + F = ( F & ( FLAG_C | FLAG_P | FLAG_Z | FLAG_S ) ) |\ + ( A & ( FLAG_3 | FLAG_5 ) ) | ( FLAG_N | FLAG_H );\ +} + +#define SCF() \ +{\ + F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\ + ( A & ( FLAG_3 | FLAG_5 ) ) |\ + FLAG_C;\ +} + +#define CCF() \ +{\ + F = ( F & ( FLAG_P | FLAG_Z | FLAG_S ) ) |\ + ( ( F & FLAG_C ) ? FLAG_H : FLAG_C ) | ( A & ( FLAG_3 | FLAG_5 ) );\ +} + +#define HALT() \ +{\ + cpu->halted=1;\ + PC--;\ +} + +#define EXX() \ +{\ + Z80EX_WORD wordtemp;\ + wordtemp = BC; BC = BC_; BC_ = wordtemp;\ + wordtemp = DE; DE = DE_; DE_ = wordtemp;\ + wordtemp = HL; HL = HL_; HL_ = wordtemp;\ +} + +#define DI() \ +{\ + IFF1=IFF2=0;\ +} + +#define EI() \ +{\ + IFF1 = IFF2 = 1;\ + cpu->noint_once=1;\ +} + +#define SET(bit, val) \ +{\ + val |= (1 << bit);\ +} + +#define RES(bit, val) \ +{\ + val &= ~(1 << bit);\ +} + + +#endif diff --git a/third_party/z80ex/opcodes/build_opcodes.pl b/third_party/z80ex/opcodes/build_opcodes.pl new file mode 100755 index 00000000..466d479e --- /dev/null +++ b/third_party/z80ex/opcodes/build_opcodes.pl @@ -0,0 +1,817 @@ +#!/usr/bin/perl -w + +use strict; + +sub next_t +{ + my $arref = shift; + my $val = splice @$arref,0,1; + die "No more timings available!" if(!defined($val)); + return($val); +} + +sub get_flag_co +{ + my $fl = shift; + my $out=""; + my $is_n=0; + + if($fl eq 'P') {$fl = 'NS';} + elsif($fl eq 'M') {$fl = 'S';} + elsif($fl eq 'PE') {$fl = 'P';} + elsif($fl eq 'PO') {$fl = 'NP';} + + $is_n=1 if(substr($fl,0,1) eq 'N'); + + + $out.=" if("; + $out.="!(" if($is_n); + $out.="F & FLAG_"; + if($is_n) {$out.=substr($fl,1,1);} + else {$out.=$fl;} + $out.=")" if($is_n); + $out.=")"; + + return($out); +} + +sub is_arg_16bit +{ + my $arg = shift; + my $res=0; + + $res=1 if((length($arg) == 2) and ($arg !~ /^\w+[Hh]/) and ($arg ne '#')); + +#print "checking $arg gives $res\n"; + return($res); +} + +# convert one command to C code +sub convert_to_c +{ + my $readbyte="READ_MEM("; + my $writebyte="WRITE_MEM("; + + my $opc = shift; + my $def = shift; + my $fnname = shift; + my $out = ''; + my $head = ''; + my $foot = ''; + my $arg_str = ''; + my @arguments =(); + + my @ww=(); + my @rr=(); + + ###### + # for commands that writes to memory or port + my $cmd_mwrite = 0; #cmd writes to memory thru (regpair[+d]) or (adress) + my $cmd_pwrite = 0; #cmd writes to port thru (port) + my $cmd_memmod = 0; #cmd modifyes data in memory, ie read-modify-write + my $cmd_is_16bit = 0; + my $cmd_cyclic = 0; + my $cmd_branch = 0; + my $cmd_memptr = 0; + ###### + + my $addr_mptr=0; + + ###### + + if(!$$opc{'asm'}) {return("");} + + if($def eq 'base') + { + $$fnname = 'op_'.$$opc{'opcode'}; + } + else + { + $$fnname = 'op_'.uc($def).'_'.$$opc{'opcode'}; + } + #$$fnname = 'opc_'.$$opc{'asm'}.'_'.$def; + #$$fnname =~ s/\s/_/g; + #$$fnname =~ s/\(/_bR_/g; + #$$fnname =~ s/\)/_Rb_/g; + #$$fnname =~ s/\+/_plus_/g; + #$$fnname =~ s/\,/_cm_/g; + + $head.="/*$$opc{asm}*/\n" if($$opc{asm}); + $$opc{'asm'} =~ s/\'/_/g; + $head.="static void $$fnname(Z80EX_CONTEXT *cpu)\n{\n"; + + if($$opc{'asm'} =~ /^(LD\sA,R|LD\sR,A|LD\sA,I)$/) + { + $$opc{'asm'} =~ s/\s/_/g; + $$opc{'asm'} =~ s/,/_/g; + } + + if($$opc{rd}) + { + @rr=split /,/,$$opc{rd}; + + if($def ne 'base') + { + #for prefixed ops: min. time used to fetch the prefix (4) must be substracted + for(my $i = 0;$i <= $#rr;++$i) + { + $rr[$i]-=4; + } + } + } + + if($$opc{wr}) + { + @ww=split /,/,$$opc{wr}; + + if($def ne 'base') + { + #for prefixed ops: min. time used to fetch the prefix (4) must be substracted + for(my $i = 0;$i <= $#ww;++$i) + { + $ww[$i]-=4; + } + } + } + + my @pair = split /\s/,$$opc{'asm'}; + #$pair[0] == command name now... + + $pair[0]='IM_' if($pair[0] eq 'IM'); + + $cmd_cyclic=1 if($pair[0] =~ /^(LDIR|LDDR|OTIR|OTDR|INIR|INDR|CPDR|CPIR|DJNZ)$/); + + if($pair[0] eq 'shift') + { + if($def ne 'base') + { + $$fnname = "NULL"; #"opc_".uc($def).$pair[1]; + return(""); + } + + $$fnname = "op_p_".$pair[1]; + return("static void ".$$fnname."(Z80EX_CONTEXT *cpu)\n{\n cpu->prefix=0x".$pair[1].";\n cpu->noint_once=1;\n}\n"); + } + elsif($pair[0] eq 'ignore' or $pair[0] eq 'reset') + { + $$fnname = "NULL"; + return(""); + } + + my @tst = split /\//,$$opc{t}; #t-states + if($def ne 'base') + { + #for prefixed ops: min. time used to fetch the prefix (4) must be substracted + $tst[0]-=4; + $tst[1]-=4 if($tst[1]); + } + + if(defined($pair[1])) #mnemonic with args + { + my $dbus_arg=0; #number of argument that references memory, or 0 + @arguments = split /,/,$pair[1]; #split args + + if(($pair[0] eq 'JP') and ($arguments[0] =~ /^(HL|IX|IY)$/)) + { + $pair[0] = 'JP_NO_MPTR'; + } + + #support for ld a, rlc(ix+d) -alike constructs + if($pair[2]) + { + splice @arguments,$#arguments+1,1,(split /,/,$pair[2]); + } + + die "err1" if($#arguments > 1 and !$pair[2]); + + my $nnn=1; + foreach my $argg (@arguments) + { +#print "$arg--"; + $dbus_arg = $nnn if($argg =~ /^\([\w\+\@\#\$]+\)$/); + $nnn++; + } +#print "\n"; + + $cmd_branch=1 if(($#arguments && $pair[0] =~ /^(CALL|JP|JR)$/) || $pair[0] =~ /^RET$/); + + #command works with port or memory data... clarify its type + if($dbus_arg) + { + if($pair[0] eq 'LD') + { + if($arguments[1] =~ /^(RLC|RRC|RL|RR|SLA|SRA|SLL|SRL|SET|RES)$/) + { + $cmd_mwrite = 1; + } + elsif($dbus_arg == 1) #first arg is (ptr) + { + die ("LD with one arg!") if(!$arguments[1]); + $cmd_mwrite = 1; + $cmd_is_16bit=is_arg_16bit($arguments[1]); + + if(($arguments[0] =~ /^\((BC|DE|\@)\)$/) and ($arguments[1] eq 'A')) + { + #ld (nnnn|BC|DE), A + $pair[0]='LD_A_TO_ADDR_MPTR'; + $cmd_memptr=1; + } + elsif($arguments[0] =~ /^\(\@\)$/) + { + #ld (nnnn),rp + $pair[0]='LD_RP_TO_ADDR_MPTR_'; + $cmd_memptr=1; + } + } + else + { + $cmd_is_16bit=is_arg_16bit($arguments[0]); + + if(($arguments[0] eq 'A') and ($arguments[1] =~ /^\((BC|DE|\@)\)$/)) + { + #ld a,(BC|DE|nnnn) + $pair[0]='LD_A_FROM_ADDR_MPTR'; + $cmd_memptr=1; + } + elsif($arguments[1] =~ /^\(\@\)$/) + { + #ld rp,(nnnn) + $pair[0]='LD_RP_FROM_ADDR_MPTR_'; + $cmd_memptr=1; + } + + } + } + elsif($pair[0] eq 'EX') + { + die("no such EX") if ($dbus_arg == 2); + $cmd_mwrite = 1; + $cmd_is_16bit = 1; + $cmd_memmod = 1; + $pair[0]='EX_MPTR'; + } + elsif($pair[0] =~ /^(ADD|SUB|ADC|SBC)$/) + { + $cmd_mwrite = 0; + } + elsif($pair[0] eq 'INC' or $pair[0] eq 'DEC') + { + die("no such inc/dec") if ($dbus_arg == 2 or $arguments[1]); + $cmd_mwrite = 1; + $cmd_memmod = 1; + } + elsif($pair[0] =~ /^(RLC|RRC|RR|RL|SLA|SRA|SLL|SRL)$/) + { + die("no such rotate cmd") if ($dbus_arg == 2 or $arguments[1]); + $cmd_mwrite = 1; + $cmd_memmod = 1; + } + elsif($pair[0] eq 'BIT') + { + die("no such bit cmd") if ($dbus_arg == 1); + $cmd_mwrite = 0; + } + elsif($pair[0] eq 'RES' or $pair[0] eq 'SET') + { + die("no such set/res cmd") if ($dbus_arg == 1); + $cmd_mwrite = 1; + $cmd_memmod = 1; + } + elsif($pair[0] eq 'JP') + { + $cmd_is_16bit = 1; + $cmd_mwrite = 0; + } + elsif($pair[0] =~ /^(OR|XOR|AND)$/) + { + $cmd_mwrite = 0; + } + elsif($pair[0] eq 'CP') + { + $cmd_mwrite = 0; + } + elsif($pair[0] eq 'SUB') + { + $cmd_mwrite = 0; + } + elsif($pair[0] eq 'IN' or $pair[0] eq 'IN_F') + { + $cmd_pwrite = 0; + } + elsif($pair[0] eq 'OUT') + { + $cmd_pwrite = 1; + } + else + { + die("unknown cmd that references mem adress or port: $pair[0]\n") + } + } + + die "not all timings given for $$opc{'asm'}!" if((!defined($$opc{rd}) or !defined($$opc{wr})) and $cmd_memmod); + + #branching + if($cmd_branch) + { + $out.= get_flag_co($arguments[0])." {\n"; + splice(@arguments,0,1); + } + + #process the rest args (numbers or registers) + + my $nn=1; + my $add_op=0; + my $add_op_arg=''; + my $skip_next=0; + #print "-- cmd_mwrite=$cmd_mwrite, dbus_arg=$dbus_arg --\n"; + foreach my $arg (@arguments) + { + if($skip_next) + { + $skip_next=0; + $nn++; + next; + } + + if($pair[0] eq 'IM_') + { + $arg='IM'.$arg; + } + + if($arg =~ /^(RLC|RRC|RL|RR|SLA|SRA|SLL|SRL)$/) + { + $add_op = $arg; + $nn++; + next; + } + elsif($arg =~ /^(SET|RES)$/) + { + $add_op = $arg; + die "jopa" if(!$arguments[$nn] && !$arguments[$nn+1]); + $add_op_arg = $arguments[$nn].','; + + $nn++; + $skip_next=1; + next; + } + elsif($arg eq '%') #offset + { + $head.=" temp_byte=READ_OP();\n"; + $head.=" temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte;\n"; + $arg_str.="temp_byte_s"; + } + + elsif($arg =~ /^\#$/) #byte + { + $head.=" temp_byte=READ_OP();\n"; + $arg_str.="temp_byte"; + } + + elsif($arg =~ /^\@$/) #word + { + $head.=" temp_word.b.l=READ_OP();\n"; + $head.=" temp_word.b.h=READ_OP();\n"; + $arg_str.="temp_word.w"; + + $addr_mptr="temp_word.w" if($pair[0] =~/^(JP|JR|CALL)$/); + } + elsif($arg =~ /^\(\@\)$/) #memory referenced by word + { + die "err22" if(!$dbus_arg or $dbus_arg!=$nn); + + $head.=" temp_addr.b.l=READ_OP();\n"; + $head.=" temp_addr.b.h=READ_OP();\n"; + + $addr_mptr = "temp_addr.w"; + + if($cmd_is_16bit) + { + $arg_str.="temp_word.w"; + + if(!$cmd_mwrite or $cmd_memmod) + { + die "2nd shift-op for 16bit cmd" if($add_op); + + $head.=" ".$readbyte."temp_word.b.l,temp_addr.w,".next_t(\@rr).");\n"; + $head.=" ".$readbyte."temp_word.b.h,temp_addr.w+1,".next_t(\@rr).");\n"; + } + + if($cmd_mwrite) + { + die "wr isnt given for 16bit memory-write op" if(!$$opc{wr}); + + $foot.=" ".$writebyte."temp_addr.w,temp_word.b.l,".next_t(\@ww).");\n"; + $foot.=" ".$writebyte."temp_addr.w+1,temp_word.b.h,".next_t(\@ww).");\n"; + } + } + else + { + $arg_str.="temp_byte"; + + if(!$cmd_mwrite or $cmd_memmod) + { + $head.=" ".$readbyte."temp_byte,temp_addr.w,".next_t(\@rr).");\n"; + $head.=" $add_op(".$add_op_arg."temp_byte,".next_t(\@rr).");\n" if($add_op); + } + + if($cmd_mwrite) + { + if($add_op) + { + $head.=" ".$readbyte."temp_byte,temp_addr.w,".next_t(\@rr).");\n"; + $head.=" $add_op(".$add_op_arg."temp_byte);\n" if($add_op); + } + + $foot.=" ".$writebyte."temp_addr.w,temp_byte,".next_t(\@ww).");\n"; + } + } + } + elsif($arg =~ /^\(\#\)$/) #dealing with port + { + die "err22" if(!$dbus_arg or $dbus_arg!=$nn); + die ("(\#) notation, but it isnt 'out' or 'in' command -- $pair[0]") if(!$cmd_pwrite and ($pair[0] !~ /^(IN|IN_F)$/)); + + $head.=" temp_word.w=(READ_OP() + ( A << 8 ));\n"; + $arg_str.="temp_word.w"; + + $pair[0].='_A'; # IN A,(nn) and OUT (nn),A behaves somewhat differently + + } + elsif($arg eq '(C)') #dealing with port + { + die "err22" if(!$dbus_arg or $dbus_arg!=$nn); + die ("(C) notation, but it isnt 'out' or 'in' command -- $pair[0]") if(!$cmd_pwrite and ($pair[0] !~ /^(IN|IN_F)$/)); + + $arg_str.= "BC"; + } + elsif($arg =~ /^\([\w\+\$]+\)$/) #memory adressing by regpair (or regpair+d) + { + die "err22: dbus_arg=$dbus_arg" if(!$dbus_arg or $dbus_arg!=$nn); + + (my $ref) = $arg =~ /^\(([\w\+\$]+)\)$/; + die "err66" if(!$ref); + + if($ref =~ /\+/) # (IX/IY + $) + { + #����� ����� � ��������� ��� � ref ������ $ + if(($def ne 'ddcb') and ($def ne 'fdcb')) + { + $head.=" temp_byte=READ_OP();\n"; + $head.=" temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte;\n"; + } + + (my $regg) = $ref =~ /^(\w+)\+\$$/; + die "err 889 (ref=$ref)" if(!$regg); + $ref = $regg.'+temp_byte_s'; + + if($pair[0] eq 'BIT') #BIT n,(INDEX+$) is a special case... + { + $pair[0]="BIT_MPTR"; + } + + $head.=" MEMPTR=($ref);\n"; + } + else + { + if(($ref eq 'HL') and ($pair[0] eq 'BIT')) #BIT n,(HL) is a special case... + { + $pair[0]="BIT_MPTR"; + } + } + + $addr_mptr = "($ref)"; + + #$head.=" temp_addr.w=$ref;\n"; + + if($cmd_is_16bit) + { + $arg_str.="temp_word.w"; + + if(!$cmd_mwrite or $cmd_memmod) + { + die "2nd shift-op for 16bit cmd" if($add_op); + + $head.=" ".$readbyte."temp_word.b.l,($ref),".next_t(\@rr).");\n"; + $head.=" ".$readbyte."temp_word.b.h,($ref+1),".next_t(\@rr).");\n"; + } + + if($cmd_mwrite) + { + die "wr isnt given for 16bit memory-write op" if(!$$opc{wr}); + + + $foot.=" ".$writebyte."($ref),temp_word.b.l,".next_t(\@ww).");\n"; + $foot.=" ".$writebyte."($ref+1),temp_word.b.h,".next_t(\@ww).");\n"; + } + } + else + { + $arg_str.="temp_byte"; + + if(!$cmd_mwrite or $cmd_memmod) + { + $head.=" ".$readbyte."temp_byte,($ref),".next_t(\@rr).");\n"; + $head.=" $add_op(".$add_op_arg."temp_byte);\n" if($add_op); + + } + + if($cmd_mwrite) + { + if($add_op) + { + $head.=" ".$readbyte."temp_byte,($ref),".next_t(\@rr).");\n"; + $head.=" $add_op(".$add_op_arg."temp_byte);\n" if($add_op); + } + + $foot.=" ".$writebyte."($ref),temp_byte,".next_t(\@ww).");\n"; + } + } + } + else + { + $arg_str.=$arg; + } + + $arg_str.=',' if($nn-1 < $#arguments); + $nn++; + } + } + + if($cmd_memptr) #pass adress to commands that modifyes MEMPTR register + { + $arg_str.= ', ' if($arg_str ne ''); + $arg_str.= $addr_mptr; + } + + if(($pair[0] =~ /^(LD|ADD|ADC|SBC|INC|DEC)$/) or ($pair[0] =~ /^LD_/)) + { + foreach my $aa (@arguments) + { + if(is_arg_16bit($aa)) + { + $pair[0] = $pair[0].'16'; + last; + } + } + } + + + ######## give timing info for some cmds + + if($cmd_cyclic) #give ciclyc commands full timing info + { + die("block/cycle command, but only one timing given!") if(!$tst[0] or !$tst[0]); + $arg_str.= ', ' if($arg_str ne ''); + $arg_str.= "/*t:*/ /*t1*/$tst[0],/*t2*/$tst[1]"; + } + + ######## + + if($#rr >= 0) + { + $arg_str.= ', ' if($arg_str ne ''); + $arg_str.= '/*rd*/'; + + my $nnum=0; + foreach my $rarg (@rr) #it there's rd-timings left, pass them as arguments + { + $arg_str.=',' if($nnum); + $arg_str.=$rarg; + $nnum++; + } + } + + + if($#ww >= 0) + { + $arg_str.= ', ' if($arg_str ne ''); + $arg_str.= '/*wr*/'; + + my $nnum=0; + foreach my $warg (@ww) #it there's wr-timings left, pass them as arguments + { + $arg_str.=',' if($nnum); + $arg_str.=$warg; + $nnum++; + } + } + + + $out.=" $pair[0]".'('.$arg_str.");\n" if($pair[0] ne 'NOP'); + + if($cmd_branch) + { + die "branching cmd, two timings must be given!" if(!$tst[0] or !$tst[1]); + $foot.=" T_WAIT_UNTIL($tst[1]);\n }\n else { T_WAIT_UNTIL($tst[0]);"; + + if($cmd_branch and $pair[0] =~ /^(JP|CALL)$/) + { + $foot.="MEMPTR=$addr_mptr;" + } + + $foot.="}\n"; + } + else + { + $foot.=" T_WAIT_UNTIL($tst[0]);\n" if(!$cmd_cyclic); + } + + $foot.=" return;"; + + return($head.$out.$foot."\n}\n"); +} + + +sub convert_to_c_disasm +{ + +} + + +sub process_ofile +{ + my $fname = shift; + my $def = shift; + my $disasmt = shift; + my $to_file = shift; + my $fnname; + my $pair; + + my @tbl=(); + my @tbl_dasm=(); + my %nm_hash=(); + + print "/*processing $fname.dat...*/\n\n"; + + open(NP,"<$fname.dat") or die ("cannot open $fname"); + open(OFILE,'>./opcodes_'.$def.'.c') or die ("cannot create ".'./'.$fname.'.c.inc') if($to_file); + + select(OFILE) if($to_file); + + my $header = "/* autogenerated from $fname.dat, do not edit */\n\n"; + + print $header; + + while() + { + my $out = ""; + chomp; + next if(/^\s*$/); + next if(/^#/); + my %opc; + + if(lc($def) eq 'dd' or lc($def) eq 'ddcb') + { + $_ =~ s/REGISTER/IX/g; + } + elsif(lc($def) eq 'fd' or lc($def) eq 'fdcb') + { + $_ =~ s/REGISTER/IY/g; + } + + #my($opcode, $mnemonic, $tstates, $w) = $_ =~ /^(\w+)=\"(.*)\"/; + foreach $pair (split /\s\s+/) + { + die("wrong format -- tab detected") if($pair =~ /\t/); + + $pair =~ s/^\s*//; + $pair =~ s/\s*$//; + #print "pair = [$pair]\n"; + + if($pair =~ /^0x\w\w$/) + { + $opc{"opcode"}=$pair; + } + else + { + my($nm,$val) = $pair =~ /^(\w+)=\"(.*)\"$/; + die "parse error for $pair" if(!$nm or !defined($val)); + if($nm =~ /^(t|wr|rd)$/) + { + $opc{"$nm"}=$val; + } + else + { + $opc{"opcode"}=$nm; + $opc{"asm"}=$val; + } + } + } + + my $c = &convert_to_c(\%opc, $def, \$fnname); + + print "$c\n" if(!$nm_hash{$fnname} && $opc{"asm"}); + + #add to tables + if($opc{"asm"}) + { + $tbl[hex($opc{"opcode"})]=$fnname; + $nm_hash{$fnname}=1; + + if($opc{"t"} =~ /\//) + { + my @tts = split /\//,$opc{"t"}; + die "bad t format" if($#tts != 1); + $tts[1]=0 if($tts[1] == $tts[0]); + $tbl_dasm[hex($opc{"opcode"})]=[($opc{"asm"} =~ /^(ignore|reset)\s/)? '#': $opc{"asm"},$tts[0],$tts[1]]; + } + else + { + $tbl_dasm[hex($opc{"opcode"})]=[($opc{"asm"} =~ /^(ignore|reset)\s/)? '#': $opc{"asm"},$opc{"t"},0]; + } + } + else + { + $tbl[hex($opc{"opcode"})]='#'; + } + + undef(%opc); + } + + my$ii; + + #empty fields means NULL + for($ii=0;$ii < 256;$ii++) + { + if(!defined($tbl[$ii])) + { + $tbl[$ii]='NULL'; + $tbl_dasm[$ii] = ['#',0,0]; + } + } + + # for cloned BIT ddcb/fdcb opcodes + my $last; + for($ii=255;$ii >= 0;$ii--) + { + if($tbl[$ii] eq '#') + { + $tbl[$ii]=$tbl[$last]; + $tbl_dasm[$ii]=$tbl_dasm[$last]; + } + + + $last=$ii; + } + + + $$disasmt="\n\n/**/\nstatic const z80ex_opc_dasm dasm_".$def."[0x100] = {\n"; + + my $footer="\n\n/**/\n"; + $footer .= "static const z80ex_opcode_fn opcodes_".$def."[0x100] = {\n"; + + for($ii=0;$ii < 256;$ii++) + { + $footer.= sprintf(' %-14s',$tbl[$ii]); + + my $ddasm = ($tbl_dasm[$ii]->[0] eq '#')? 'NULL': '"'.$tbl_dasm[$ii]->[0].'"'; + + $ddasm =~ s/AF_/AF'/g; + + $$disasmt.=sprintf('{ %-20s, %2d , %2d } /* %02X */',$ddasm,$tbl_dasm[$ii]->[1],$tbl_dasm[$ii]->[2],$ii); + + if($ii != 255) + { + $footer.=','; + $$disasmt.=','; + } + + $$disasmt.="\n"; + + $footer.= "\n" if(($ii+1)/4 == int(($ii+1)/4)); + } + + chop $footer; + $footer.="\n};\n"; + $$disasmt.="\n};\n"; + + print $footer; + + close(OFILE) if($to_file); + select(STDOUT); + close(NP); +} + +my $to_file = 1; +my $disasmt; + +open(DFILE,'>./opcodes_dasm.c') or die ("cannot open dasm.c for writing\n"); +print DFILE "/* autogenerated, do not edit */"; + +&process_ofile('./opcodes_base','base',\$disasmt,$to_file); +print DFILE $disasmt; +&process_ofile('./opcodes_cb','cb',\$disasmt,$to_file); +print DFILE $disasmt; +&process_ofile('./opcodes_ed','ed',\$disasmt,$to_file); +print DFILE $disasmt; +&process_ofile('./opcodes_ddfd','dd',\$disasmt,$to_file); +print DFILE $disasmt; +&process_ofile('./opcodes_ddfd','fd',\$disasmt,$to_file); +print DFILE $disasmt; +&process_ofile('./opcodes_ddfdcb','ddcb',\$disasmt,$to_file); +print DFILE $disasmt; +&process_ofile('./opcodes_ddfdcb','fdcb',\$disasmt,$to_file); +print DFILE $disasmt; + +close(DFILE); + diff --git a/third_party/z80ex/opcodes/opcode.dat.format b/third_party/z80ex/opcodes/opcode.dat.format new file mode 100644 index 00000000..aab2c97e --- /dev/null +++ b/third_party/z80ex/opcodes/opcode.dat.format @@ -0,0 +1,11 @@ +opcode="asm" + t="t-states[/t-states for branching/cyclic cmd, if it succeded (changes PC)]" + [rd="delay in t-states before RD goes active for memory/port operation (first byte)"[, -//- second byte]] + [wr="delay in t-states before WR goes active for memory/port operation (first byte)"[,-//- second byte]] + +in mnemonics: + +@ - word +# - byte +$ - displacement for IX/IY+d +% - jump offset diff --git a/third_party/z80ex/opcodes/opcodes_base.c b/third_party/z80ex/opcodes/opcodes_base.c new file mode 100644 index 00000000..ec604447 --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_base.c @@ -0,0 +1,2316 @@ +/* autogenerated from ./opcodes_base.dat, do not edit */ + +/*NOP*/ +static void op_0x00(Z80EX_CONTEXT *cpu) +{ + T_WAIT_UNTIL(4); + return; +} + +/*LD BC,@*/ +static void op_0x01(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + LD16(BC,temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*LD (BC),A*/ +static void op_0x02(Z80EX_CONTEXT *cpu) +{ + LD_A_TO_ADDR_MPTR(temp_byte,A, (BC)); + WRITE_MEM((BC),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*INC BC*/ +static void op_0x03(Z80EX_CONTEXT *cpu) +{ + INC16(BC); + T_WAIT_UNTIL(6); + return; +} + +/*INC B*/ +static void op_0x04(Z80EX_CONTEXT *cpu) +{ + INC(B); + T_WAIT_UNTIL(4); + return; +} + +/*DEC B*/ +static void op_0x05(Z80EX_CONTEXT *cpu) +{ + DEC(B); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,#*/ +static void op_0x06(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(B,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RLCA*/ +static void op_0x07(Z80EX_CONTEXT *cpu) +{ + RLCA(); + T_WAIT_UNTIL(4); + return; +} + +/*EX AF,AF'*/ +static void op_0x08(Z80EX_CONTEXT *cpu) +{ + EX(AF,AF_); + T_WAIT_UNTIL(4); + return; +} + +/*ADD HL,BC*/ +static void op_0x09(Z80EX_CONTEXT *cpu) +{ + ADD16(HL,BC); + T_WAIT_UNTIL(11); + return; +} + +/*LD A,(BC)*/ +static void op_0x0a(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(BC),4); + LD_A_FROM_ADDR_MPTR(A,temp_byte, (BC)); + T_WAIT_UNTIL(7); + return; +} + +/*DEC BC*/ +static void op_0x0b(Z80EX_CONTEXT *cpu) +{ + DEC16(BC); + T_WAIT_UNTIL(6); + return; +} + +/*INC C*/ +static void op_0x0c(Z80EX_CONTEXT *cpu) +{ + INC(C); + T_WAIT_UNTIL(4); + return; +} + +/*DEC C*/ +static void op_0x0d(Z80EX_CONTEXT *cpu) +{ + DEC(C); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,#*/ +static void op_0x0e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(C,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RRCA*/ +static void op_0x0f(Z80EX_CONTEXT *cpu) +{ + RRCA(); + T_WAIT_UNTIL(4); + return; +} + +/*DJNZ %*/ +static void op_0x10(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + DJNZ(temp_byte_s, /*t:*/ /*t1*/8,/*t2*/13); + return; +} + +/*LD DE,@*/ +static void op_0x11(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + LD16(DE,temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*LD (DE),A*/ +static void op_0x12(Z80EX_CONTEXT *cpu) +{ + LD_A_TO_ADDR_MPTR(temp_byte,A, (DE)); + WRITE_MEM((DE),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*INC DE*/ +static void op_0x13(Z80EX_CONTEXT *cpu) +{ + INC16(DE); + T_WAIT_UNTIL(6); + return; +} + +/*INC D*/ +static void op_0x14(Z80EX_CONTEXT *cpu) +{ + INC(D); + T_WAIT_UNTIL(4); + return; +} + +/*DEC D*/ +static void op_0x15(Z80EX_CONTEXT *cpu) +{ + DEC(D); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,#*/ +static void op_0x16(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(D,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RLA*/ +static void op_0x17(Z80EX_CONTEXT *cpu) +{ + RLA(); + T_WAIT_UNTIL(4); + return; +} + +/*JR %*/ +static void op_0x18(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + JR(temp_byte_s); + T_WAIT_UNTIL(12); + return; +} + +/*ADD HL,DE*/ +static void op_0x19(Z80EX_CONTEXT *cpu) +{ + ADD16(HL,DE); + T_WAIT_UNTIL(11); + return; +} + +/*LD A,(DE)*/ +static void op_0x1a(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(DE),4); + LD_A_FROM_ADDR_MPTR(A,temp_byte, (DE)); + T_WAIT_UNTIL(7); + return; +} + +/*DEC DE*/ +static void op_0x1b(Z80EX_CONTEXT *cpu) +{ + DEC16(DE); + T_WAIT_UNTIL(6); + return; +} + +/*INC E*/ +static void op_0x1c(Z80EX_CONTEXT *cpu) +{ + INC(E); + T_WAIT_UNTIL(4); + return; +} + +/*DEC E*/ +static void op_0x1d(Z80EX_CONTEXT *cpu) +{ + DEC(E); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,#*/ +static void op_0x1e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(E,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RRA*/ +static void op_0x1f(Z80EX_CONTEXT *cpu) +{ + RRA(); + T_WAIT_UNTIL(4); + return; +} + +/*JR NZ,%*/ +static void op_0x20(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + if(!(F & FLAG_Z)) { + JR(temp_byte_s); + T_WAIT_UNTIL(12); + } + else { T_WAIT_UNTIL(7);} + return; +} + +/*LD HL,@*/ +static void op_0x21(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + LD16(HL,temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*LD (@),HL*/ +static void op_0x22(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,HL, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*INC HL*/ +static void op_0x23(Z80EX_CONTEXT *cpu) +{ + INC16(HL); + T_WAIT_UNTIL(6); + return; +} + +/*INC H*/ +static void op_0x24(Z80EX_CONTEXT *cpu) +{ + INC(H); + T_WAIT_UNTIL(4); + return; +} + +/*DEC H*/ +static void op_0x25(Z80EX_CONTEXT *cpu) +{ + DEC(H); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,#*/ +static void op_0x26(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(H,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*DAA*/ +static void op_0x27(Z80EX_CONTEXT *cpu) +{ + DAA(); + T_WAIT_UNTIL(4); + return; +} + +/*JR Z,%*/ +static void op_0x28(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + if(F & FLAG_Z) { + JR(temp_byte_s); + T_WAIT_UNTIL(12); + } + else { T_WAIT_UNTIL(7);} + return; +} + +/*ADD HL,HL*/ +static void op_0x29(Z80EX_CONTEXT *cpu) +{ + ADD16(HL,HL); + T_WAIT_UNTIL(11); + return; +} + +/*LD HL,(@)*/ +static void op_0x2a(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(HL,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*DEC HL*/ +static void op_0x2b(Z80EX_CONTEXT *cpu) +{ + DEC16(HL); + T_WAIT_UNTIL(6); + return; +} + +/*INC L*/ +static void op_0x2c(Z80EX_CONTEXT *cpu) +{ + INC(L); + T_WAIT_UNTIL(4); + return; +} + +/*DEC L*/ +static void op_0x2d(Z80EX_CONTEXT *cpu) +{ + DEC(L); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,#*/ +static void op_0x2e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(L,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*CPL*/ +static void op_0x2f(Z80EX_CONTEXT *cpu) +{ + CPL(); + T_WAIT_UNTIL(4); + return; +} + +/*JR NC,%*/ +static void op_0x30(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + if(!(F & FLAG_C)) { + JR(temp_byte_s); + T_WAIT_UNTIL(12); + } + else { T_WAIT_UNTIL(7);} + return; +} + +/*LD SP,@*/ +static void op_0x31(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + LD16(SP,temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*LD (@),A*/ +static void op_0x32(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_A_TO_ADDR_MPTR(temp_byte,A, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_byte,10); + T_WAIT_UNTIL(13); + return; +} + +/*INC SP*/ +static void op_0x33(Z80EX_CONTEXT *cpu) +{ + INC16(SP); + T_WAIT_UNTIL(6); + return; +} + +/*INC (HL)*/ +static void op_0x34(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + INC(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*DEC (HL)*/ +static void op_0x35(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + DEC(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*LD (HL),#*/ +static void op_0x36(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(temp_byte,temp_byte); + WRITE_MEM((HL),temp_byte,7); + T_WAIT_UNTIL(10); + return; +} + +/*SCF*/ +static void op_0x37(Z80EX_CONTEXT *cpu) +{ + SCF(); + T_WAIT_UNTIL(4); + return; +} + +/*JR C,%*/ +static void op_0x38(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + if(F & FLAG_C) { + JR(temp_byte_s); + T_WAIT_UNTIL(12); + } + else { T_WAIT_UNTIL(7);} + return; +} + +/*ADD HL,SP*/ +static void op_0x39(Z80EX_CONTEXT *cpu) +{ + ADD16(HL,SP); + T_WAIT_UNTIL(11); + return; +} + +/*LD A,(@)*/ +static void op_0x3a(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_byte,temp_addr.w,10); + LD_A_FROM_ADDR_MPTR(A,temp_byte, temp_addr.w); + T_WAIT_UNTIL(13); + return; +} + +/*DEC SP*/ +static void op_0x3b(Z80EX_CONTEXT *cpu) +{ + DEC16(SP); + T_WAIT_UNTIL(6); + return; +} + +/*INC A*/ +static void op_0x3c(Z80EX_CONTEXT *cpu) +{ + INC(A); + T_WAIT_UNTIL(4); + return; +} + +/*DEC A*/ +static void op_0x3d(Z80EX_CONTEXT *cpu) +{ + DEC(A); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,#*/ +static void op_0x3e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*CCF*/ +static void op_0x3f(Z80EX_CONTEXT *cpu) +{ + CCF(); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,B*/ +static void op_0x40(Z80EX_CONTEXT *cpu) +{ + LD(B,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,C*/ +static void op_0x41(Z80EX_CONTEXT *cpu) +{ + LD(B,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,D*/ +static void op_0x42(Z80EX_CONTEXT *cpu) +{ + LD(B,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,E*/ +static void op_0x43(Z80EX_CONTEXT *cpu) +{ + LD(B,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,H*/ +static void op_0x44(Z80EX_CONTEXT *cpu) +{ + LD(B,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,L*/ +static void op_0x45(Z80EX_CONTEXT *cpu) +{ + LD(B,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,(HL)*/ +static void op_0x46(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(B,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD B,A*/ +static void op_0x47(Z80EX_CONTEXT *cpu) +{ + LD(B,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,B*/ +static void op_0x48(Z80EX_CONTEXT *cpu) +{ + LD(C,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,C*/ +static void op_0x49(Z80EX_CONTEXT *cpu) +{ + LD(C,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,D*/ +static void op_0x4a(Z80EX_CONTEXT *cpu) +{ + LD(C,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,E*/ +static void op_0x4b(Z80EX_CONTEXT *cpu) +{ + LD(C,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,H*/ +static void op_0x4c(Z80EX_CONTEXT *cpu) +{ + LD(C,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,L*/ +static void op_0x4d(Z80EX_CONTEXT *cpu) +{ + LD(C,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,(HL)*/ +static void op_0x4e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(C,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD C,A*/ +static void op_0x4f(Z80EX_CONTEXT *cpu) +{ + LD(C,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,B*/ +static void op_0x50(Z80EX_CONTEXT *cpu) +{ + LD(D,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,C*/ +static void op_0x51(Z80EX_CONTEXT *cpu) +{ + LD(D,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,D*/ +static void op_0x52(Z80EX_CONTEXT *cpu) +{ + LD(D,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,E*/ +static void op_0x53(Z80EX_CONTEXT *cpu) +{ + LD(D,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,H*/ +static void op_0x54(Z80EX_CONTEXT *cpu) +{ + LD(D,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,L*/ +static void op_0x55(Z80EX_CONTEXT *cpu) +{ + LD(D,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,(HL)*/ +static void op_0x56(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(D,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD D,A*/ +static void op_0x57(Z80EX_CONTEXT *cpu) +{ + LD(D,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,B*/ +static void op_0x58(Z80EX_CONTEXT *cpu) +{ + LD(E,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,C*/ +static void op_0x59(Z80EX_CONTEXT *cpu) +{ + LD(E,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,D*/ +static void op_0x5a(Z80EX_CONTEXT *cpu) +{ + LD(E,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,E*/ +static void op_0x5b(Z80EX_CONTEXT *cpu) +{ + LD(E,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,H*/ +static void op_0x5c(Z80EX_CONTEXT *cpu) +{ + LD(E,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,L*/ +static void op_0x5d(Z80EX_CONTEXT *cpu) +{ + LD(E,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,(HL)*/ +static void op_0x5e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(E,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD E,A*/ +static void op_0x5f(Z80EX_CONTEXT *cpu) +{ + LD(E,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,B*/ +static void op_0x60(Z80EX_CONTEXT *cpu) +{ + LD(H,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,C*/ +static void op_0x61(Z80EX_CONTEXT *cpu) +{ + LD(H,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,D*/ +static void op_0x62(Z80EX_CONTEXT *cpu) +{ + LD(H,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,E*/ +static void op_0x63(Z80EX_CONTEXT *cpu) +{ + LD(H,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,H*/ +static void op_0x64(Z80EX_CONTEXT *cpu) +{ + LD(H,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,L*/ +static void op_0x65(Z80EX_CONTEXT *cpu) +{ + LD(H,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,(HL)*/ +static void op_0x66(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(H,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD H,A*/ +static void op_0x67(Z80EX_CONTEXT *cpu) +{ + LD(H,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,B*/ +static void op_0x68(Z80EX_CONTEXT *cpu) +{ + LD(L,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,C*/ +static void op_0x69(Z80EX_CONTEXT *cpu) +{ + LD(L,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,D*/ +static void op_0x6a(Z80EX_CONTEXT *cpu) +{ + LD(L,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,E*/ +static void op_0x6b(Z80EX_CONTEXT *cpu) +{ + LD(L,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,H*/ +static void op_0x6c(Z80EX_CONTEXT *cpu) +{ + LD(L,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,L*/ +static void op_0x6d(Z80EX_CONTEXT *cpu) +{ + LD(L,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,(HL)*/ +static void op_0x6e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(L,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD L,A*/ +static void op_0x6f(Z80EX_CONTEXT *cpu) +{ + LD(L,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD (HL),B*/ +static void op_0x70(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,B); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*LD (HL),C*/ +static void op_0x71(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,C); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*LD (HL),D*/ +static void op_0x72(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,D); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*LD (HL),E*/ +static void op_0x73(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,E); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*LD (HL),H*/ +static void op_0x74(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,H); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*LD (HL),L*/ +static void op_0x75(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,L); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*HALT*/ +static void op_0x76(Z80EX_CONTEXT *cpu) +{ + HALT(); + T_WAIT_UNTIL(4); + return; +} + +/*LD (HL),A*/ +static void op_0x77(Z80EX_CONTEXT *cpu) +{ + LD(temp_byte,A); + WRITE_MEM((HL),temp_byte,4); + T_WAIT_UNTIL(7); + return; +} + +/*LD A,B*/ +static void op_0x78(Z80EX_CONTEXT *cpu) +{ + LD(A,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,C*/ +static void op_0x79(Z80EX_CONTEXT *cpu) +{ + LD(A,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,D*/ +static void op_0x7a(Z80EX_CONTEXT *cpu) +{ + LD(A,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,E*/ +static void op_0x7b(Z80EX_CONTEXT *cpu) +{ + LD(A,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,H*/ +static void op_0x7c(Z80EX_CONTEXT *cpu) +{ + LD(A,H); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,L*/ +static void op_0x7d(Z80EX_CONTEXT *cpu) +{ + LD(A,L); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,(HL)*/ +static void op_0x7e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + LD(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*LD A,A*/ +static void op_0x7f(Z80EX_CONTEXT *cpu) +{ + LD(A,A); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,B*/ +static void op_0x80(Z80EX_CONTEXT *cpu) +{ + ADD(A,B); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,C*/ +static void op_0x81(Z80EX_CONTEXT *cpu) +{ + ADD(A,C); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,D*/ +static void op_0x82(Z80EX_CONTEXT *cpu) +{ + ADD(A,D); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,E*/ +static void op_0x83(Z80EX_CONTEXT *cpu) +{ + ADD(A,E); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,H*/ +static void op_0x84(Z80EX_CONTEXT *cpu) +{ + ADD(A,H); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,L*/ +static void op_0x85(Z80EX_CONTEXT *cpu) +{ + ADD(A,L); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,(HL)*/ +static void op_0x86(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + ADD(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*ADD A,A*/ +static void op_0x87(Z80EX_CONTEXT *cpu) +{ + ADD(A,A); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,B*/ +static void op_0x88(Z80EX_CONTEXT *cpu) +{ + ADC(A,B); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,C*/ +static void op_0x89(Z80EX_CONTEXT *cpu) +{ + ADC(A,C); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,D*/ +static void op_0x8a(Z80EX_CONTEXT *cpu) +{ + ADC(A,D); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,E*/ +static void op_0x8b(Z80EX_CONTEXT *cpu) +{ + ADC(A,E); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,H*/ +static void op_0x8c(Z80EX_CONTEXT *cpu) +{ + ADC(A,H); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,L*/ +static void op_0x8d(Z80EX_CONTEXT *cpu) +{ + ADC(A,L); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,(HL)*/ +static void op_0x8e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + ADC(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*ADC A,A*/ +static void op_0x8f(Z80EX_CONTEXT *cpu) +{ + ADC(A,A); + T_WAIT_UNTIL(4); + return; +} + +/*SUB B*/ +static void op_0x90(Z80EX_CONTEXT *cpu) +{ + SUB(B); + T_WAIT_UNTIL(4); + return; +} + +/*SUB C*/ +static void op_0x91(Z80EX_CONTEXT *cpu) +{ + SUB(C); + T_WAIT_UNTIL(4); + return; +} + +/*SUB D*/ +static void op_0x92(Z80EX_CONTEXT *cpu) +{ + SUB(D); + T_WAIT_UNTIL(4); + return; +} + +/*SUB E*/ +static void op_0x93(Z80EX_CONTEXT *cpu) +{ + SUB(E); + T_WAIT_UNTIL(4); + return; +} + +/*SUB H*/ +static void op_0x94(Z80EX_CONTEXT *cpu) +{ + SUB(H); + T_WAIT_UNTIL(4); + return; +} + +/*SUB L*/ +static void op_0x95(Z80EX_CONTEXT *cpu) +{ + SUB(L); + T_WAIT_UNTIL(4); + return; +} + +/*SUB (HL)*/ +static void op_0x96(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SUB(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*SUB A*/ +static void op_0x97(Z80EX_CONTEXT *cpu) +{ + SUB(A); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,B*/ +static void op_0x98(Z80EX_CONTEXT *cpu) +{ + SBC(A,B); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,C*/ +static void op_0x99(Z80EX_CONTEXT *cpu) +{ + SBC(A,C); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,D*/ +static void op_0x9a(Z80EX_CONTEXT *cpu) +{ + SBC(A,D); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,E*/ +static void op_0x9b(Z80EX_CONTEXT *cpu) +{ + SBC(A,E); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,H*/ +static void op_0x9c(Z80EX_CONTEXT *cpu) +{ + SBC(A,H); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,L*/ +static void op_0x9d(Z80EX_CONTEXT *cpu) +{ + SBC(A,L); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,(HL)*/ +static void op_0x9e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SBC(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*SBC A,A*/ +static void op_0x9f(Z80EX_CONTEXT *cpu) +{ + SBC(A,A); + T_WAIT_UNTIL(4); + return; +} + +/*AND B*/ +static void op_0xa0(Z80EX_CONTEXT *cpu) +{ + AND(B); + T_WAIT_UNTIL(4); + return; +} + +/*AND C*/ +static void op_0xa1(Z80EX_CONTEXT *cpu) +{ + AND(C); + T_WAIT_UNTIL(4); + return; +} + +/*AND D*/ +static void op_0xa2(Z80EX_CONTEXT *cpu) +{ + AND(D); + T_WAIT_UNTIL(4); + return; +} + +/*AND E*/ +static void op_0xa3(Z80EX_CONTEXT *cpu) +{ + AND(E); + T_WAIT_UNTIL(4); + return; +} + +/*AND H*/ +static void op_0xa4(Z80EX_CONTEXT *cpu) +{ + AND(H); + T_WAIT_UNTIL(4); + return; +} + +/*AND L*/ +static void op_0xa5(Z80EX_CONTEXT *cpu) +{ + AND(L); + T_WAIT_UNTIL(4); + return; +} + +/*AND (HL)*/ +static void op_0xa6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + AND(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*AND A*/ +static void op_0xa7(Z80EX_CONTEXT *cpu) +{ + AND(A); + T_WAIT_UNTIL(4); + return; +} + +/*XOR B*/ +static void op_0xa8(Z80EX_CONTEXT *cpu) +{ + XOR(B); + T_WAIT_UNTIL(4); + return; +} + +/*XOR C*/ +static void op_0xa9(Z80EX_CONTEXT *cpu) +{ + XOR(C); + T_WAIT_UNTIL(4); + return; +} + +/*XOR D*/ +static void op_0xaa(Z80EX_CONTEXT *cpu) +{ + XOR(D); + T_WAIT_UNTIL(4); + return; +} + +/*XOR E*/ +static void op_0xab(Z80EX_CONTEXT *cpu) +{ + XOR(E); + T_WAIT_UNTIL(4); + return; +} + +/*XOR H*/ +static void op_0xac(Z80EX_CONTEXT *cpu) +{ + XOR(H); + T_WAIT_UNTIL(4); + return; +} + +/*XOR L*/ +static void op_0xad(Z80EX_CONTEXT *cpu) +{ + XOR(L); + T_WAIT_UNTIL(4); + return; +} + +/*XOR (HL)*/ +static void op_0xae(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + XOR(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*XOR A*/ +static void op_0xaf(Z80EX_CONTEXT *cpu) +{ + XOR(A); + T_WAIT_UNTIL(4); + return; +} + +/*OR B*/ +static void op_0xb0(Z80EX_CONTEXT *cpu) +{ + OR(B); + T_WAIT_UNTIL(4); + return; +} + +/*OR C*/ +static void op_0xb1(Z80EX_CONTEXT *cpu) +{ + OR(C); + T_WAIT_UNTIL(4); + return; +} + +/*OR D*/ +static void op_0xb2(Z80EX_CONTEXT *cpu) +{ + OR(D); + T_WAIT_UNTIL(4); + return; +} + +/*OR E*/ +static void op_0xb3(Z80EX_CONTEXT *cpu) +{ + OR(E); + T_WAIT_UNTIL(4); + return; +} + +/*OR H*/ +static void op_0xb4(Z80EX_CONTEXT *cpu) +{ + OR(H); + T_WAIT_UNTIL(4); + return; +} + +/*OR L*/ +static void op_0xb5(Z80EX_CONTEXT *cpu) +{ + OR(L); + T_WAIT_UNTIL(4); + return; +} + +/*OR (HL)*/ +static void op_0xb6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + OR(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*OR A*/ +static void op_0xb7(Z80EX_CONTEXT *cpu) +{ + OR(A); + T_WAIT_UNTIL(4); + return; +} + +/*CP B*/ +static void op_0xb8(Z80EX_CONTEXT *cpu) +{ + CP(B); + T_WAIT_UNTIL(4); + return; +} + +/*CP C*/ +static void op_0xb9(Z80EX_CONTEXT *cpu) +{ + CP(C); + T_WAIT_UNTIL(4); + return; +} + +/*CP D*/ +static void op_0xba(Z80EX_CONTEXT *cpu) +{ + CP(D); + T_WAIT_UNTIL(4); + return; +} + +/*CP E*/ +static void op_0xbb(Z80EX_CONTEXT *cpu) +{ + CP(E); + T_WAIT_UNTIL(4); + return; +} + +/*CP H*/ +static void op_0xbc(Z80EX_CONTEXT *cpu) +{ + CP(H); + T_WAIT_UNTIL(4); + return; +} + +/*CP L*/ +static void op_0xbd(Z80EX_CONTEXT *cpu) +{ + CP(L); + T_WAIT_UNTIL(4); + return; +} + +/*CP (HL)*/ +static void op_0xbe(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + CP(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*CP A*/ +static void op_0xbf(Z80EX_CONTEXT *cpu) +{ + CP(A); + T_WAIT_UNTIL(4); + return; +} + +/*RET NZ*/ +static void op_0xc0(Z80EX_CONTEXT *cpu) +{ + if(!(F & FLAG_Z)) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*POP BC*/ +static void op_0xc1(Z80EX_CONTEXT *cpu) +{ + POP(BC, /*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*JP NZ,@*/ +static void op_0xc2(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_Z)) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*JP @*/ +static void op_0xc3(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + JP(temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*CALL NZ,@*/ +static void op_0xc4(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_Z)) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*PUSH BC*/ +static void op_0xc5(Z80EX_CONTEXT *cpu) +{ + PUSH(BC, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*ADD A,#*/ +static void op_0xc6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + ADD(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x00*/ +static void op_0xc7(Z80EX_CONTEXT *cpu) +{ + RST(0x00, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET Z*/ +static void op_0xc8(Z80EX_CONTEXT *cpu) +{ + if(F & FLAG_Z) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*RET*/ +static void op_0xc9(Z80EX_CONTEXT *cpu) +{ + RET(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*JP Z,@*/ +static void op_0xca(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_Z) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +static void op_p_CB(Z80EX_CONTEXT *cpu) +{ + cpu->prefix=0xCB; + cpu->noint_once=1; +} + +/*CALL Z,@*/ +static void op_0xcc(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_Z) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*CALL @*/ +static void op_0xcd(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + return; +} + +/*ADC A,#*/ +static void op_0xce(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + ADC(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x08*/ +static void op_0xcf(Z80EX_CONTEXT *cpu) +{ + RST(0x08, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET NC*/ +static void op_0xd0(Z80EX_CONTEXT *cpu) +{ + if(!(F & FLAG_C)) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*POP DE*/ +static void op_0xd1(Z80EX_CONTEXT *cpu) +{ + POP(DE, /*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*JP NC,@*/ +static void op_0xd2(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_C)) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*OUT (#),A*/ +static void op_0xd3(Z80EX_CONTEXT *cpu) +{ + temp_word.w=(READ_OP() + ( A << 8 )); + OUT_A(temp_word.w,A, /*wr*/8); + T_WAIT_UNTIL(11); + return; +} + +/*CALL NC,@*/ +static void op_0xd4(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_C)) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*PUSH DE*/ +static void op_0xd5(Z80EX_CONTEXT *cpu) +{ + PUSH(DE, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*SUB #*/ +static void op_0xd6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + SUB(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x10*/ +static void op_0xd7(Z80EX_CONTEXT *cpu) +{ + RST(0x10, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET C*/ +static void op_0xd8(Z80EX_CONTEXT *cpu) +{ + if(F & FLAG_C) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*EXX*/ +static void op_0xd9(Z80EX_CONTEXT *cpu) +{ + EXX(); + T_WAIT_UNTIL(4); + return; +} + +/*JP C,@*/ +static void op_0xda(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_C) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*IN A,(#)*/ +static void op_0xdb(Z80EX_CONTEXT *cpu) +{ + temp_word.w=(READ_OP() + ( A << 8 )); + IN_A(A,temp_word.w, /*rd*/8); + T_WAIT_UNTIL(11); + return; +} + +/*CALL C,@*/ +static void op_0xdc(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_C) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +static void op_p_DD(Z80EX_CONTEXT *cpu) +{ + cpu->prefix=0xDD; + cpu->noint_once=1; +} + +/*SBC A,#*/ +static void op_0xde(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + SBC(A,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x18*/ +static void op_0xdf(Z80EX_CONTEXT *cpu) +{ + RST(0x18, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET PO*/ +static void op_0xe0(Z80EX_CONTEXT *cpu) +{ + if(!(F & FLAG_P)) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*POP HL*/ +static void op_0xe1(Z80EX_CONTEXT *cpu) +{ + POP(HL, /*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*JP PO,@*/ +static void op_0xe2(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_P)) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*EX (SP),HL*/ +static void op_0xe3(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_word.b.l,(SP),4); + READ_MEM(temp_word.b.h,(SP+1),7); + EX_MPTR(temp_word.w,HL); + WRITE_MEM((SP),temp_word.b.l,11); + WRITE_MEM((SP+1),temp_word.b.h,14); + T_WAIT_UNTIL(19); + return; +} + +/*CALL PO,@*/ +static void op_0xe4(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_P)) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*PUSH HL*/ +static void op_0xe5(Z80EX_CONTEXT *cpu) +{ + PUSH(HL, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*AND #*/ +static void op_0xe6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + AND(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x20*/ +static void op_0xe7(Z80EX_CONTEXT *cpu) +{ + RST(0x20, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET PE*/ +static void op_0xe8(Z80EX_CONTEXT *cpu) +{ + if(F & FLAG_P) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*JP HL*/ +static void op_0xe9(Z80EX_CONTEXT *cpu) +{ + JP_NO_MPTR(HL); + T_WAIT_UNTIL(4); + return; +} + +/*JP PE,@*/ +static void op_0xea(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_P) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*EX DE,HL*/ +static void op_0xeb(Z80EX_CONTEXT *cpu) +{ + EX(DE,HL); + T_WAIT_UNTIL(4); + return; +} + +/*CALL PE,@*/ +static void op_0xec(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_P) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +static void op_p_ED(Z80EX_CONTEXT *cpu) +{ + cpu->prefix=0xED; + cpu->noint_once=1; +} + +/*XOR #*/ +static void op_0xee(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + XOR(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x28*/ +static void op_0xef(Z80EX_CONTEXT *cpu) +{ + RST(0x28, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET P*/ +static void op_0xf0(Z80EX_CONTEXT *cpu) +{ + if(!(F & FLAG_S)) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*POP AF*/ +static void op_0xf1(Z80EX_CONTEXT *cpu) +{ + POP(AF, /*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*JP P,@*/ +static void op_0xf2(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_S)) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*DI*/ +static void op_0xf3(Z80EX_CONTEXT *cpu) +{ + DI(); + T_WAIT_UNTIL(4); + return; +} + +/*CALL P,@*/ +static void op_0xf4(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(!(F & FLAG_S)) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*PUSH AF*/ +static void op_0xf5(Z80EX_CONTEXT *cpu) +{ + PUSH(AF, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*OR #*/ +static void op_0xf6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + OR(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x30*/ +static void op_0xf7(Z80EX_CONTEXT *cpu) +{ + RST(0x30, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*RET M*/ +static void op_0xf8(Z80EX_CONTEXT *cpu) +{ + if(F & FLAG_S) { + RET(/*rd*/5,8); + T_WAIT_UNTIL(11); + } + else { T_WAIT_UNTIL(5);} + return; +} + +/*LD SP,HL*/ +static void op_0xf9(Z80EX_CONTEXT *cpu) +{ + LD16(SP,HL); + T_WAIT_UNTIL(6); + return; +} + +/*JP M,@*/ +static void op_0xfa(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_S) { + JP(temp_word.w); + T_WAIT_UNTIL(10); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +/*EI*/ +static void op_0xfb(Z80EX_CONTEXT *cpu) +{ + EI(); + T_WAIT_UNTIL(4); + return; +} + +/*CALL M,@*/ +static void op_0xfc(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + if(F & FLAG_S) { + CALL(temp_word.w, /*wr*/11,14); + T_WAIT_UNTIL(17); + } + else { T_WAIT_UNTIL(10);MEMPTR=temp_word.w;} + return; +} + +static void op_p_FD(Z80EX_CONTEXT *cpu) +{ + cpu->prefix=0xFD; + cpu->noint_once=1; +} + +/*CP #*/ +static void op_0xfe(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + CP(temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*RST 0x38*/ +static void op_0xff(Z80EX_CONTEXT *cpu) +{ + RST(0x38, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_base[0x100] = { + op_0x00 , op_0x01 , op_0x02 , op_0x03 , + op_0x04 , op_0x05 , op_0x06 , op_0x07 , + op_0x08 , op_0x09 , op_0x0a , op_0x0b , + op_0x0c , op_0x0d , op_0x0e , op_0x0f , + op_0x10 , op_0x11 , op_0x12 , op_0x13 , + op_0x14 , op_0x15 , op_0x16 , op_0x17 , + op_0x18 , op_0x19 , op_0x1a , op_0x1b , + op_0x1c , op_0x1d , op_0x1e , op_0x1f , + op_0x20 , op_0x21 , op_0x22 , op_0x23 , + op_0x24 , op_0x25 , op_0x26 , op_0x27 , + op_0x28 , op_0x29 , op_0x2a , op_0x2b , + op_0x2c , op_0x2d , op_0x2e , op_0x2f , + op_0x30 , op_0x31 , op_0x32 , op_0x33 , + op_0x34 , op_0x35 , op_0x36 , op_0x37 , + op_0x38 , op_0x39 , op_0x3a , op_0x3b , + op_0x3c , op_0x3d , op_0x3e , op_0x3f , + op_0x40 , op_0x41 , op_0x42 , op_0x43 , + op_0x44 , op_0x45 , op_0x46 , op_0x47 , + op_0x48 , op_0x49 , op_0x4a , op_0x4b , + op_0x4c , op_0x4d , op_0x4e , op_0x4f , + op_0x50 , op_0x51 , op_0x52 , op_0x53 , + op_0x54 , op_0x55 , op_0x56 , op_0x57 , + op_0x58 , op_0x59 , op_0x5a , op_0x5b , + op_0x5c , op_0x5d , op_0x5e , op_0x5f , + op_0x60 , op_0x61 , op_0x62 , op_0x63 , + op_0x64 , op_0x65 , op_0x66 , op_0x67 , + op_0x68 , op_0x69 , op_0x6a , op_0x6b , + op_0x6c , op_0x6d , op_0x6e , op_0x6f , + op_0x70 , op_0x71 , op_0x72 , op_0x73 , + op_0x74 , op_0x75 , op_0x76 , op_0x77 , + op_0x78 , op_0x79 , op_0x7a , op_0x7b , + op_0x7c , op_0x7d , op_0x7e , op_0x7f , + op_0x80 , op_0x81 , op_0x82 , op_0x83 , + op_0x84 , op_0x85 , op_0x86 , op_0x87 , + op_0x88 , op_0x89 , op_0x8a , op_0x8b , + op_0x8c , op_0x8d , op_0x8e , op_0x8f , + op_0x90 , op_0x91 , op_0x92 , op_0x93 , + op_0x94 , op_0x95 , op_0x96 , op_0x97 , + op_0x98 , op_0x99 , op_0x9a , op_0x9b , + op_0x9c , op_0x9d , op_0x9e , op_0x9f , + op_0xa0 , op_0xa1 , op_0xa2 , op_0xa3 , + op_0xa4 , op_0xa5 , op_0xa6 , op_0xa7 , + op_0xa8 , op_0xa9 , op_0xaa , op_0xab , + op_0xac , op_0xad , op_0xae , op_0xaf , + op_0xb0 , op_0xb1 , op_0xb2 , op_0xb3 , + op_0xb4 , op_0xb5 , op_0xb6 , op_0xb7 , + op_0xb8 , op_0xb9 , op_0xba , op_0xbb , + op_0xbc , op_0xbd , op_0xbe , op_0xbf , + op_0xc0 , op_0xc1 , op_0xc2 , op_0xc3 , + op_0xc4 , op_0xc5 , op_0xc6 , op_0xc7 , + op_0xc8 , op_0xc9 , op_0xca , op_p_CB , + op_0xcc , op_0xcd , op_0xce , op_0xcf , + op_0xd0 , op_0xd1 , op_0xd2 , op_0xd3 , + op_0xd4 , op_0xd5 , op_0xd6 , op_0xd7 , + op_0xd8 , op_0xd9 , op_0xda , op_0xdb , + op_0xdc , op_p_DD , op_0xde , op_0xdf , + op_0xe0 , op_0xe1 , op_0xe2 , op_0xe3 , + op_0xe4 , op_0xe5 , op_0xe6 , op_0xe7 , + op_0xe8 , op_0xe9 , op_0xea , op_0xeb , + op_0xec , op_p_ED , op_0xee , op_0xef , + op_0xf0 , op_0xf1 , op_0xf2 , op_0xf3 , + op_0xf4 , op_0xf5 , op_0xf6 , op_0xf7 , + op_0xf8 , op_0xf9 , op_0xfa , op_0xfb , + op_0xfc , op_p_FD , op_0xfe , op_0xff +}; diff --git a/third_party/z80ex/opcodes/opcodes_cb.c b/third_party/z80ex/opcodes/opcodes_cb.c new file mode 100644 index 00000000..4bef847d --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_cb.c @@ -0,0 +1,2175 @@ +/* autogenerated from ./opcodes_cb.dat, do not edit */ + +/*RLC B*/ +static void op_CB_0x00(Z80EX_CONTEXT *cpu) +{ + RLC(B); + T_WAIT_UNTIL(4); + return; +} + +/*RLC C*/ +static void op_CB_0x01(Z80EX_CONTEXT *cpu) +{ + RLC(C); + T_WAIT_UNTIL(4); + return; +} + +/*RLC D*/ +static void op_CB_0x02(Z80EX_CONTEXT *cpu) +{ + RLC(D); + T_WAIT_UNTIL(4); + return; +} + +/*RLC E*/ +static void op_CB_0x03(Z80EX_CONTEXT *cpu) +{ + RLC(E); + T_WAIT_UNTIL(4); + return; +} + +/*RLC H*/ +static void op_CB_0x04(Z80EX_CONTEXT *cpu) +{ + RLC(H); + T_WAIT_UNTIL(4); + return; +} + +/*RLC L*/ +static void op_CB_0x05(Z80EX_CONTEXT *cpu) +{ + RLC(L); + T_WAIT_UNTIL(4); + return; +} + +/*RLC (HL)*/ +static void op_CB_0x06(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RLC(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RLC A*/ +static void op_CB_0x07(Z80EX_CONTEXT *cpu) +{ + RLC(A); + T_WAIT_UNTIL(4); + return; +} + +/*RRC B*/ +static void op_CB_0x08(Z80EX_CONTEXT *cpu) +{ + RRC(B); + T_WAIT_UNTIL(4); + return; +} + +/*RRC C*/ +static void op_CB_0x09(Z80EX_CONTEXT *cpu) +{ + RRC(C); + T_WAIT_UNTIL(4); + return; +} + +/*RRC D*/ +static void op_CB_0x0a(Z80EX_CONTEXT *cpu) +{ + RRC(D); + T_WAIT_UNTIL(4); + return; +} + +/*RRC E*/ +static void op_CB_0x0b(Z80EX_CONTEXT *cpu) +{ + RRC(E); + T_WAIT_UNTIL(4); + return; +} + +/*RRC H*/ +static void op_CB_0x0c(Z80EX_CONTEXT *cpu) +{ + RRC(H); + T_WAIT_UNTIL(4); + return; +} + +/*RRC L*/ +static void op_CB_0x0d(Z80EX_CONTEXT *cpu) +{ + RRC(L); + T_WAIT_UNTIL(4); + return; +} + +/*RRC (HL)*/ +static void op_CB_0x0e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RRC(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RRC A*/ +static void op_CB_0x0f(Z80EX_CONTEXT *cpu) +{ + RRC(A); + T_WAIT_UNTIL(4); + return; +} + +/*RL B*/ +static void op_CB_0x10(Z80EX_CONTEXT *cpu) +{ + RL(B); + T_WAIT_UNTIL(4); + return; +} + +/*RL C*/ +static void op_CB_0x11(Z80EX_CONTEXT *cpu) +{ + RL(C); + T_WAIT_UNTIL(4); + return; +} + +/*RL D*/ +static void op_CB_0x12(Z80EX_CONTEXT *cpu) +{ + RL(D); + T_WAIT_UNTIL(4); + return; +} + +/*RL E*/ +static void op_CB_0x13(Z80EX_CONTEXT *cpu) +{ + RL(E); + T_WAIT_UNTIL(4); + return; +} + +/*RL H*/ +static void op_CB_0x14(Z80EX_CONTEXT *cpu) +{ + RL(H); + T_WAIT_UNTIL(4); + return; +} + +/*RL L*/ +static void op_CB_0x15(Z80EX_CONTEXT *cpu) +{ + RL(L); + T_WAIT_UNTIL(4); + return; +} + +/*RL (HL)*/ +static void op_CB_0x16(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RL(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RL A*/ +static void op_CB_0x17(Z80EX_CONTEXT *cpu) +{ + RL(A); + T_WAIT_UNTIL(4); + return; +} + +/*RR B*/ +static void op_CB_0x18(Z80EX_CONTEXT *cpu) +{ + RR(B); + T_WAIT_UNTIL(4); + return; +} + +/*RR C*/ +static void op_CB_0x19(Z80EX_CONTEXT *cpu) +{ + RR(C); + T_WAIT_UNTIL(4); + return; +} + +/*RR D*/ +static void op_CB_0x1a(Z80EX_CONTEXT *cpu) +{ + RR(D); + T_WAIT_UNTIL(4); + return; +} + +/*RR E*/ +static void op_CB_0x1b(Z80EX_CONTEXT *cpu) +{ + RR(E); + T_WAIT_UNTIL(4); + return; +} + +/*RR H*/ +static void op_CB_0x1c(Z80EX_CONTEXT *cpu) +{ + RR(H); + T_WAIT_UNTIL(4); + return; +} + +/*RR L*/ +static void op_CB_0x1d(Z80EX_CONTEXT *cpu) +{ + RR(L); + T_WAIT_UNTIL(4); + return; +} + +/*RR (HL)*/ +static void op_CB_0x1e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RR(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RR A*/ +static void op_CB_0x1f(Z80EX_CONTEXT *cpu) +{ + RR(A); + T_WAIT_UNTIL(4); + return; +} + +/*SLA B*/ +static void op_CB_0x20(Z80EX_CONTEXT *cpu) +{ + SLA(B); + T_WAIT_UNTIL(4); + return; +} + +/*SLA C*/ +static void op_CB_0x21(Z80EX_CONTEXT *cpu) +{ + SLA(C); + T_WAIT_UNTIL(4); + return; +} + +/*SLA D*/ +static void op_CB_0x22(Z80EX_CONTEXT *cpu) +{ + SLA(D); + T_WAIT_UNTIL(4); + return; +} + +/*SLA E*/ +static void op_CB_0x23(Z80EX_CONTEXT *cpu) +{ + SLA(E); + T_WAIT_UNTIL(4); + return; +} + +/*SLA H*/ +static void op_CB_0x24(Z80EX_CONTEXT *cpu) +{ + SLA(H); + T_WAIT_UNTIL(4); + return; +} + +/*SLA L*/ +static void op_CB_0x25(Z80EX_CONTEXT *cpu) +{ + SLA(L); + T_WAIT_UNTIL(4); + return; +} + +/*SLA (HL)*/ +static void op_CB_0x26(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SLA(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SLA A*/ +static void op_CB_0x27(Z80EX_CONTEXT *cpu) +{ + SLA(A); + T_WAIT_UNTIL(4); + return; +} + +/*SRA B*/ +static void op_CB_0x28(Z80EX_CONTEXT *cpu) +{ + SRA(B); + T_WAIT_UNTIL(4); + return; +} + +/*SRA C*/ +static void op_CB_0x29(Z80EX_CONTEXT *cpu) +{ + SRA(C); + T_WAIT_UNTIL(4); + return; +} + +/*SRA D*/ +static void op_CB_0x2a(Z80EX_CONTEXT *cpu) +{ + SRA(D); + T_WAIT_UNTIL(4); + return; +} + +/*SRA E*/ +static void op_CB_0x2b(Z80EX_CONTEXT *cpu) +{ + SRA(E); + T_WAIT_UNTIL(4); + return; +} + +/*SRA H*/ +static void op_CB_0x2c(Z80EX_CONTEXT *cpu) +{ + SRA(H); + T_WAIT_UNTIL(4); + return; +} + +/*SRA L*/ +static void op_CB_0x2d(Z80EX_CONTEXT *cpu) +{ + SRA(L); + T_WAIT_UNTIL(4); + return; +} + +/*SRA (HL)*/ +static void op_CB_0x2e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SRA(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SRA A*/ +static void op_CB_0x2f(Z80EX_CONTEXT *cpu) +{ + SRA(A); + T_WAIT_UNTIL(4); + return; +} + +/*SLL B*/ +static void op_CB_0x30(Z80EX_CONTEXT *cpu) +{ + SLL(B); + T_WAIT_UNTIL(4); + return; +} + +/*SLL C*/ +static void op_CB_0x31(Z80EX_CONTEXT *cpu) +{ + SLL(C); + T_WAIT_UNTIL(4); + return; +} + +/*SLL D*/ +static void op_CB_0x32(Z80EX_CONTEXT *cpu) +{ + SLL(D); + T_WAIT_UNTIL(4); + return; +} + +/*SLL E*/ +static void op_CB_0x33(Z80EX_CONTEXT *cpu) +{ + SLL(E); + T_WAIT_UNTIL(4); + return; +} + +/*SLL H*/ +static void op_CB_0x34(Z80EX_CONTEXT *cpu) +{ + SLL(H); + T_WAIT_UNTIL(4); + return; +} + +/*SLL L*/ +static void op_CB_0x35(Z80EX_CONTEXT *cpu) +{ + SLL(L); + T_WAIT_UNTIL(4); + return; +} + +/*SLL (HL)*/ +static void op_CB_0x36(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SLL(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SLL A*/ +static void op_CB_0x37(Z80EX_CONTEXT *cpu) +{ + SLL(A); + T_WAIT_UNTIL(4); + return; +} + +/*SRL B*/ +static void op_CB_0x38(Z80EX_CONTEXT *cpu) +{ + SRL(B); + T_WAIT_UNTIL(4); + return; +} + +/*SRL C*/ +static void op_CB_0x39(Z80EX_CONTEXT *cpu) +{ + SRL(C); + T_WAIT_UNTIL(4); + return; +} + +/*SRL D*/ +static void op_CB_0x3a(Z80EX_CONTEXT *cpu) +{ + SRL(D); + T_WAIT_UNTIL(4); + return; +} + +/*SRL E*/ +static void op_CB_0x3b(Z80EX_CONTEXT *cpu) +{ + SRL(E); + T_WAIT_UNTIL(4); + return; +} + +/*SRL H*/ +static void op_CB_0x3c(Z80EX_CONTEXT *cpu) +{ + SRL(H); + T_WAIT_UNTIL(4); + return; +} + +/*SRL L*/ +static void op_CB_0x3d(Z80EX_CONTEXT *cpu) +{ + SRL(L); + T_WAIT_UNTIL(4); + return; +} + +/*SRL (HL)*/ +static void op_CB_0x3e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SRL(temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SRL A*/ +static void op_CB_0x3f(Z80EX_CONTEXT *cpu) +{ + SRL(A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,B*/ +static void op_CB_0x40(Z80EX_CONTEXT *cpu) +{ + BIT(0,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,C*/ +static void op_CB_0x41(Z80EX_CONTEXT *cpu) +{ + BIT(0,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,D*/ +static void op_CB_0x42(Z80EX_CONTEXT *cpu) +{ + BIT(0,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,E*/ +static void op_CB_0x43(Z80EX_CONTEXT *cpu) +{ + BIT(0,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,H*/ +static void op_CB_0x44(Z80EX_CONTEXT *cpu) +{ + BIT(0,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,L*/ +static void op_CB_0x45(Z80EX_CONTEXT *cpu) +{ + BIT(0,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 0,(HL)*/ +static void op_CB_0x46(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(0,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 0,A*/ +static void op_CB_0x47(Z80EX_CONTEXT *cpu) +{ + BIT(0,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,B*/ +static void op_CB_0x48(Z80EX_CONTEXT *cpu) +{ + BIT(1,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,C*/ +static void op_CB_0x49(Z80EX_CONTEXT *cpu) +{ + BIT(1,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,D*/ +static void op_CB_0x4a(Z80EX_CONTEXT *cpu) +{ + BIT(1,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,E*/ +static void op_CB_0x4b(Z80EX_CONTEXT *cpu) +{ + BIT(1,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,H*/ +static void op_CB_0x4c(Z80EX_CONTEXT *cpu) +{ + BIT(1,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,L*/ +static void op_CB_0x4d(Z80EX_CONTEXT *cpu) +{ + BIT(1,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 1,(HL)*/ +static void op_CB_0x4e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(1,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 1,A*/ +static void op_CB_0x4f(Z80EX_CONTEXT *cpu) +{ + BIT(1,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,B*/ +static void op_CB_0x50(Z80EX_CONTEXT *cpu) +{ + BIT(2,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,C*/ +static void op_CB_0x51(Z80EX_CONTEXT *cpu) +{ + BIT(2,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,D*/ +static void op_CB_0x52(Z80EX_CONTEXT *cpu) +{ + BIT(2,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,E*/ +static void op_CB_0x53(Z80EX_CONTEXT *cpu) +{ + BIT(2,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,H*/ +static void op_CB_0x54(Z80EX_CONTEXT *cpu) +{ + BIT(2,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,L*/ +static void op_CB_0x55(Z80EX_CONTEXT *cpu) +{ + BIT(2,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 2,(HL)*/ +static void op_CB_0x56(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(2,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 2,A*/ +static void op_CB_0x57(Z80EX_CONTEXT *cpu) +{ + BIT(2,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,B*/ +static void op_CB_0x58(Z80EX_CONTEXT *cpu) +{ + BIT(3,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,C*/ +static void op_CB_0x59(Z80EX_CONTEXT *cpu) +{ + BIT(3,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,D*/ +static void op_CB_0x5a(Z80EX_CONTEXT *cpu) +{ + BIT(3,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,E*/ +static void op_CB_0x5b(Z80EX_CONTEXT *cpu) +{ + BIT(3,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,H*/ +static void op_CB_0x5c(Z80EX_CONTEXT *cpu) +{ + BIT(3,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,L*/ +static void op_CB_0x5d(Z80EX_CONTEXT *cpu) +{ + BIT(3,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 3,(HL)*/ +static void op_CB_0x5e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(3,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 3,A*/ +static void op_CB_0x5f(Z80EX_CONTEXT *cpu) +{ + BIT(3,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,B*/ +static void op_CB_0x60(Z80EX_CONTEXT *cpu) +{ + BIT(4,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,C*/ +static void op_CB_0x61(Z80EX_CONTEXT *cpu) +{ + BIT(4,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,D*/ +static void op_CB_0x62(Z80EX_CONTEXT *cpu) +{ + BIT(4,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,E*/ +static void op_CB_0x63(Z80EX_CONTEXT *cpu) +{ + BIT(4,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,H*/ +static void op_CB_0x64(Z80EX_CONTEXT *cpu) +{ + BIT(4,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,L*/ +static void op_CB_0x65(Z80EX_CONTEXT *cpu) +{ + BIT(4,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 4,(HL)*/ +static void op_CB_0x66(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(4,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 4,A*/ +static void op_CB_0x67(Z80EX_CONTEXT *cpu) +{ + BIT(4,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,B*/ +static void op_CB_0x68(Z80EX_CONTEXT *cpu) +{ + BIT(5,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,C*/ +static void op_CB_0x69(Z80EX_CONTEXT *cpu) +{ + BIT(5,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,D*/ +static void op_CB_0x6a(Z80EX_CONTEXT *cpu) +{ + BIT(5,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,E*/ +static void op_CB_0x6b(Z80EX_CONTEXT *cpu) +{ + BIT(5,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,H*/ +static void op_CB_0x6c(Z80EX_CONTEXT *cpu) +{ + BIT(5,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,L*/ +static void op_CB_0x6d(Z80EX_CONTEXT *cpu) +{ + BIT(5,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 5,(HL)*/ +static void op_CB_0x6e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(5,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 5,A*/ +static void op_CB_0x6f(Z80EX_CONTEXT *cpu) +{ + BIT(5,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,B*/ +static void op_CB_0x70(Z80EX_CONTEXT *cpu) +{ + BIT(6,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,C*/ +static void op_CB_0x71(Z80EX_CONTEXT *cpu) +{ + BIT(6,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,D*/ +static void op_CB_0x72(Z80EX_CONTEXT *cpu) +{ + BIT(6,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,E*/ +static void op_CB_0x73(Z80EX_CONTEXT *cpu) +{ + BIT(6,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,H*/ +static void op_CB_0x74(Z80EX_CONTEXT *cpu) +{ + BIT(6,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,L*/ +static void op_CB_0x75(Z80EX_CONTEXT *cpu) +{ + BIT(6,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 6,(HL)*/ +static void op_CB_0x76(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(6,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 6,A*/ +static void op_CB_0x77(Z80EX_CONTEXT *cpu) +{ + BIT(6,A); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,B*/ +static void op_CB_0x78(Z80EX_CONTEXT *cpu) +{ + BIT(7,B); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,C*/ +static void op_CB_0x79(Z80EX_CONTEXT *cpu) +{ + BIT(7,C); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,D*/ +static void op_CB_0x7a(Z80EX_CONTEXT *cpu) +{ + BIT(7,D); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,E*/ +static void op_CB_0x7b(Z80EX_CONTEXT *cpu) +{ + BIT(7,E); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,H*/ +static void op_CB_0x7c(Z80EX_CONTEXT *cpu) +{ + BIT(7,H); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,L*/ +static void op_CB_0x7d(Z80EX_CONTEXT *cpu) +{ + BIT(7,L); + T_WAIT_UNTIL(4); + return; +} + +/*BIT 7,(HL)*/ +static void op_CB_0x7e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + BIT_MPTR(7,temp_byte); + T_WAIT_UNTIL(8); + return; +} + +/*BIT 7,A*/ +static void op_CB_0x7f(Z80EX_CONTEXT *cpu) +{ + BIT(7,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,B*/ +static void op_CB_0x80(Z80EX_CONTEXT *cpu) +{ + RES(0,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,C*/ +static void op_CB_0x81(Z80EX_CONTEXT *cpu) +{ + RES(0,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,D*/ +static void op_CB_0x82(Z80EX_CONTEXT *cpu) +{ + RES(0,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,E*/ +static void op_CB_0x83(Z80EX_CONTEXT *cpu) +{ + RES(0,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,H*/ +static void op_CB_0x84(Z80EX_CONTEXT *cpu) +{ + RES(0,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,L*/ +static void op_CB_0x85(Z80EX_CONTEXT *cpu) +{ + RES(0,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 0,(HL)*/ +static void op_CB_0x86(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(0,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 0,A*/ +static void op_CB_0x87(Z80EX_CONTEXT *cpu) +{ + RES(0,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,B*/ +static void op_CB_0x88(Z80EX_CONTEXT *cpu) +{ + RES(1,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,C*/ +static void op_CB_0x89(Z80EX_CONTEXT *cpu) +{ + RES(1,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,D*/ +static void op_CB_0x8a(Z80EX_CONTEXT *cpu) +{ + RES(1,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,E*/ +static void op_CB_0x8b(Z80EX_CONTEXT *cpu) +{ + RES(1,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,H*/ +static void op_CB_0x8c(Z80EX_CONTEXT *cpu) +{ + RES(1,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,L*/ +static void op_CB_0x8d(Z80EX_CONTEXT *cpu) +{ + RES(1,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 1,(HL)*/ +static void op_CB_0x8e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(1,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 1,A*/ +static void op_CB_0x8f(Z80EX_CONTEXT *cpu) +{ + RES(1,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,B*/ +static void op_CB_0x90(Z80EX_CONTEXT *cpu) +{ + RES(2,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,C*/ +static void op_CB_0x91(Z80EX_CONTEXT *cpu) +{ + RES(2,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,D*/ +static void op_CB_0x92(Z80EX_CONTEXT *cpu) +{ + RES(2,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,E*/ +static void op_CB_0x93(Z80EX_CONTEXT *cpu) +{ + RES(2,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,H*/ +static void op_CB_0x94(Z80EX_CONTEXT *cpu) +{ + RES(2,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,L*/ +static void op_CB_0x95(Z80EX_CONTEXT *cpu) +{ + RES(2,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 2,(HL)*/ +static void op_CB_0x96(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(2,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 2,A*/ +static void op_CB_0x97(Z80EX_CONTEXT *cpu) +{ + RES(2,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,B*/ +static void op_CB_0x98(Z80EX_CONTEXT *cpu) +{ + RES(3,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,C*/ +static void op_CB_0x99(Z80EX_CONTEXT *cpu) +{ + RES(3,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,D*/ +static void op_CB_0x9a(Z80EX_CONTEXT *cpu) +{ + RES(3,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,E*/ +static void op_CB_0x9b(Z80EX_CONTEXT *cpu) +{ + RES(3,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,H*/ +static void op_CB_0x9c(Z80EX_CONTEXT *cpu) +{ + RES(3,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,L*/ +static void op_CB_0x9d(Z80EX_CONTEXT *cpu) +{ + RES(3,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 3,(HL)*/ +static void op_CB_0x9e(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(3,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 3,A*/ +static void op_CB_0x9f(Z80EX_CONTEXT *cpu) +{ + RES(3,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,B*/ +static void op_CB_0xa0(Z80EX_CONTEXT *cpu) +{ + RES(4,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,C*/ +static void op_CB_0xa1(Z80EX_CONTEXT *cpu) +{ + RES(4,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,D*/ +static void op_CB_0xa2(Z80EX_CONTEXT *cpu) +{ + RES(4,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,E*/ +static void op_CB_0xa3(Z80EX_CONTEXT *cpu) +{ + RES(4,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,H*/ +static void op_CB_0xa4(Z80EX_CONTEXT *cpu) +{ + RES(4,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,L*/ +static void op_CB_0xa5(Z80EX_CONTEXT *cpu) +{ + RES(4,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 4,(HL)*/ +static void op_CB_0xa6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(4,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 4,A*/ +static void op_CB_0xa7(Z80EX_CONTEXT *cpu) +{ + RES(4,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,B*/ +static void op_CB_0xa8(Z80EX_CONTEXT *cpu) +{ + RES(5,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,C*/ +static void op_CB_0xa9(Z80EX_CONTEXT *cpu) +{ + RES(5,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,D*/ +static void op_CB_0xaa(Z80EX_CONTEXT *cpu) +{ + RES(5,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,E*/ +static void op_CB_0xab(Z80EX_CONTEXT *cpu) +{ + RES(5,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,H*/ +static void op_CB_0xac(Z80EX_CONTEXT *cpu) +{ + RES(5,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,L*/ +static void op_CB_0xad(Z80EX_CONTEXT *cpu) +{ + RES(5,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 5,(HL)*/ +static void op_CB_0xae(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(5,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 5,A*/ +static void op_CB_0xaf(Z80EX_CONTEXT *cpu) +{ + RES(5,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,B*/ +static void op_CB_0xb0(Z80EX_CONTEXT *cpu) +{ + RES(6,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,C*/ +static void op_CB_0xb1(Z80EX_CONTEXT *cpu) +{ + RES(6,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,D*/ +static void op_CB_0xb2(Z80EX_CONTEXT *cpu) +{ + RES(6,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,E*/ +static void op_CB_0xb3(Z80EX_CONTEXT *cpu) +{ + RES(6,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,H*/ +static void op_CB_0xb4(Z80EX_CONTEXT *cpu) +{ + RES(6,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,L*/ +static void op_CB_0xb5(Z80EX_CONTEXT *cpu) +{ + RES(6,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 6,(HL)*/ +static void op_CB_0xb6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(6,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 6,A*/ +static void op_CB_0xb7(Z80EX_CONTEXT *cpu) +{ + RES(6,A); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,B*/ +static void op_CB_0xb8(Z80EX_CONTEXT *cpu) +{ + RES(7,B); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,C*/ +static void op_CB_0xb9(Z80EX_CONTEXT *cpu) +{ + RES(7,C); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,D*/ +static void op_CB_0xba(Z80EX_CONTEXT *cpu) +{ + RES(7,D); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,E*/ +static void op_CB_0xbb(Z80EX_CONTEXT *cpu) +{ + RES(7,E); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,H*/ +static void op_CB_0xbc(Z80EX_CONTEXT *cpu) +{ + RES(7,H); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,L*/ +static void op_CB_0xbd(Z80EX_CONTEXT *cpu) +{ + RES(7,L); + T_WAIT_UNTIL(4); + return; +} + +/*RES 7,(HL)*/ +static void op_CB_0xbe(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + RES(7,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*RES 7,A*/ +static void op_CB_0xbf(Z80EX_CONTEXT *cpu) +{ + RES(7,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,B*/ +static void op_CB_0xc0(Z80EX_CONTEXT *cpu) +{ + SET(0,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,C*/ +static void op_CB_0xc1(Z80EX_CONTEXT *cpu) +{ + SET(0,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,D*/ +static void op_CB_0xc2(Z80EX_CONTEXT *cpu) +{ + SET(0,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,E*/ +static void op_CB_0xc3(Z80EX_CONTEXT *cpu) +{ + SET(0,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,H*/ +static void op_CB_0xc4(Z80EX_CONTEXT *cpu) +{ + SET(0,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,L*/ +static void op_CB_0xc5(Z80EX_CONTEXT *cpu) +{ + SET(0,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 0,(HL)*/ +static void op_CB_0xc6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(0,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 0,A*/ +static void op_CB_0xc7(Z80EX_CONTEXT *cpu) +{ + SET(0,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,B*/ +static void op_CB_0xc8(Z80EX_CONTEXT *cpu) +{ + SET(1,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,C*/ +static void op_CB_0xc9(Z80EX_CONTEXT *cpu) +{ + SET(1,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,D*/ +static void op_CB_0xca(Z80EX_CONTEXT *cpu) +{ + SET(1,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,E*/ +static void op_CB_0xcb(Z80EX_CONTEXT *cpu) +{ + SET(1,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,H*/ +static void op_CB_0xcc(Z80EX_CONTEXT *cpu) +{ + SET(1,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,L*/ +static void op_CB_0xcd(Z80EX_CONTEXT *cpu) +{ + SET(1,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 1,(HL)*/ +static void op_CB_0xce(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(1,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 1,A*/ +static void op_CB_0xcf(Z80EX_CONTEXT *cpu) +{ + SET(1,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,B*/ +static void op_CB_0xd0(Z80EX_CONTEXT *cpu) +{ + SET(2,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,C*/ +static void op_CB_0xd1(Z80EX_CONTEXT *cpu) +{ + SET(2,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,D*/ +static void op_CB_0xd2(Z80EX_CONTEXT *cpu) +{ + SET(2,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,E*/ +static void op_CB_0xd3(Z80EX_CONTEXT *cpu) +{ + SET(2,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,H*/ +static void op_CB_0xd4(Z80EX_CONTEXT *cpu) +{ + SET(2,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,L*/ +static void op_CB_0xd5(Z80EX_CONTEXT *cpu) +{ + SET(2,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 2,(HL)*/ +static void op_CB_0xd6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(2,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 2,A*/ +static void op_CB_0xd7(Z80EX_CONTEXT *cpu) +{ + SET(2,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,B*/ +static void op_CB_0xd8(Z80EX_CONTEXT *cpu) +{ + SET(3,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,C*/ +static void op_CB_0xd9(Z80EX_CONTEXT *cpu) +{ + SET(3,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,D*/ +static void op_CB_0xda(Z80EX_CONTEXT *cpu) +{ + SET(3,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,E*/ +static void op_CB_0xdb(Z80EX_CONTEXT *cpu) +{ + SET(3,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,H*/ +static void op_CB_0xdc(Z80EX_CONTEXT *cpu) +{ + SET(3,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,L*/ +static void op_CB_0xdd(Z80EX_CONTEXT *cpu) +{ + SET(3,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 3,(HL)*/ +static void op_CB_0xde(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(3,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 3,A*/ +static void op_CB_0xdf(Z80EX_CONTEXT *cpu) +{ + SET(3,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,B*/ +static void op_CB_0xe0(Z80EX_CONTEXT *cpu) +{ + SET(4,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,C*/ +static void op_CB_0xe1(Z80EX_CONTEXT *cpu) +{ + SET(4,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,D*/ +static void op_CB_0xe2(Z80EX_CONTEXT *cpu) +{ + SET(4,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,E*/ +static void op_CB_0xe3(Z80EX_CONTEXT *cpu) +{ + SET(4,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,H*/ +static void op_CB_0xe4(Z80EX_CONTEXT *cpu) +{ + SET(4,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,L*/ +static void op_CB_0xe5(Z80EX_CONTEXT *cpu) +{ + SET(4,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 4,(HL)*/ +static void op_CB_0xe6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(4,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 4,A*/ +static void op_CB_0xe7(Z80EX_CONTEXT *cpu) +{ + SET(4,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,B*/ +static void op_CB_0xe8(Z80EX_CONTEXT *cpu) +{ + SET(5,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,C*/ +static void op_CB_0xe9(Z80EX_CONTEXT *cpu) +{ + SET(5,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,D*/ +static void op_CB_0xea(Z80EX_CONTEXT *cpu) +{ + SET(5,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,E*/ +static void op_CB_0xeb(Z80EX_CONTEXT *cpu) +{ + SET(5,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,H*/ +static void op_CB_0xec(Z80EX_CONTEXT *cpu) +{ + SET(5,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,L*/ +static void op_CB_0xed(Z80EX_CONTEXT *cpu) +{ + SET(5,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 5,(HL)*/ +static void op_CB_0xee(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(5,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 5,A*/ +static void op_CB_0xef(Z80EX_CONTEXT *cpu) +{ + SET(5,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,B*/ +static void op_CB_0xf0(Z80EX_CONTEXT *cpu) +{ + SET(6,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,C*/ +static void op_CB_0xf1(Z80EX_CONTEXT *cpu) +{ + SET(6,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,D*/ +static void op_CB_0xf2(Z80EX_CONTEXT *cpu) +{ + SET(6,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,E*/ +static void op_CB_0xf3(Z80EX_CONTEXT *cpu) +{ + SET(6,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,H*/ +static void op_CB_0xf4(Z80EX_CONTEXT *cpu) +{ + SET(6,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,L*/ +static void op_CB_0xf5(Z80EX_CONTEXT *cpu) +{ + SET(6,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 6,(HL)*/ +static void op_CB_0xf6(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(6,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 6,A*/ +static void op_CB_0xf7(Z80EX_CONTEXT *cpu) +{ + SET(6,A); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,B*/ +static void op_CB_0xf8(Z80EX_CONTEXT *cpu) +{ + SET(7,B); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,C*/ +static void op_CB_0xf9(Z80EX_CONTEXT *cpu) +{ + SET(7,C); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,D*/ +static void op_CB_0xfa(Z80EX_CONTEXT *cpu) +{ + SET(7,D); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,E*/ +static void op_CB_0xfb(Z80EX_CONTEXT *cpu) +{ + SET(7,E); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,H*/ +static void op_CB_0xfc(Z80EX_CONTEXT *cpu) +{ + SET(7,H); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,L*/ +static void op_CB_0xfd(Z80EX_CONTEXT *cpu) +{ + SET(7,L); + T_WAIT_UNTIL(4); + return; +} + +/*SET 7,(HL)*/ +static void op_CB_0xfe(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_byte,(HL),4); + SET(7,temp_byte); + WRITE_MEM((HL),temp_byte,8); + T_WAIT_UNTIL(11); + return; +} + +/*SET 7,A*/ +static void op_CB_0xff(Z80EX_CONTEXT *cpu) +{ + SET(7,A); + T_WAIT_UNTIL(4); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_cb[0x100] = { + op_CB_0x00 , op_CB_0x01 , op_CB_0x02 , op_CB_0x03 , + op_CB_0x04 , op_CB_0x05 , op_CB_0x06 , op_CB_0x07 , + op_CB_0x08 , op_CB_0x09 , op_CB_0x0a , op_CB_0x0b , + op_CB_0x0c , op_CB_0x0d , op_CB_0x0e , op_CB_0x0f , + op_CB_0x10 , op_CB_0x11 , op_CB_0x12 , op_CB_0x13 , + op_CB_0x14 , op_CB_0x15 , op_CB_0x16 , op_CB_0x17 , + op_CB_0x18 , op_CB_0x19 , op_CB_0x1a , op_CB_0x1b , + op_CB_0x1c , op_CB_0x1d , op_CB_0x1e , op_CB_0x1f , + op_CB_0x20 , op_CB_0x21 , op_CB_0x22 , op_CB_0x23 , + op_CB_0x24 , op_CB_0x25 , op_CB_0x26 , op_CB_0x27 , + op_CB_0x28 , op_CB_0x29 , op_CB_0x2a , op_CB_0x2b , + op_CB_0x2c , op_CB_0x2d , op_CB_0x2e , op_CB_0x2f , + op_CB_0x30 , op_CB_0x31 , op_CB_0x32 , op_CB_0x33 , + op_CB_0x34 , op_CB_0x35 , op_CB_0x36 , op_CB_0x37 , + op_CB_0x38 , op_CB_0x39 , op_CB_0x3a , op_CB_0x3b , + op_CB_0x3c , op_CB_0x3d , op_CB_0x3e , op_CB_0x3f , + op_CB_0x40 , op_CB_0x41 , op_CB_0x42 , op_CB_0x43 , + op_CB_0x44 , op_CB_0x45 , op_CB_0x46 , op_CB_0x47 , + op_CB_0x48 , op_CB_0x49 , op_CB_0x4a , op_CB_0x4b , + op_CB_0x4c , op_CB_0x4d , op_CB_0x4e , op_CB_0x4f , + op_CB_0x50 , op_CB_0x51 , op_CB_0x52 , op_CB_0x53 , + op_CB_0x54 , op_CB_0x55 , op_CB_0x56 , op_CB_0x57 , + op_CB_0x58 , op_CB_0x59 , op_CB_0x5a , op_CB_0x5b , + op_CB_0x5c , op_CB_0x5d , op_CB_0x5e , op_CB_0x5f , + op_CB_0x60 , op_CB_0x61 , op_CB_0x62 , op_CB_0x63 , + op_CB_0x64 , op_CB_0x65 , op_CB_0x66 , op_CB_0x67 , + op_CB_0x68 , op_CB_0x69 , op_CB_0x6a , op_CB_0x6b , + op_CB_0x6c , op_CB_0x6d , op_CB_0x6e , op_CB_0x6f , + op_CB_0x70 , op_CB_0x71 , op_CB_0x72 , op_CB_0x73 , + op_CB_0x74 , op_CB_0x75 , op_CB_0x76 , op_CB_0x77 , + op_CB_0x78 , op_CB_0x79 , op_CB_0x7a , op_CB_0x7b , + op_CB_0x7c , op_CB_0x7d , op_CB_0x7e , op_CB_0x7f , + op_CB_0x80 , op_CB_0x81 , op_CB_0x82 , op_CB_0x83 , + op_CB_0x84 , op_CB_0x85 , op_CB_0x86 , op_CB_0x87 , + op_CB_0x88 , op_CB_0x89 , op_CB_0x8a , op_CB_0x8b , + op_CB_0x8c , op_CB_0x8d , op_CB_0x8e , op_CB_0x8f , + op_CB_0x90 , op_CB_0x91 , op_CB_0x92 , op_CB_0x93 , + op_CB_0x94 , op_CB_0x95 , op_CB_0x96 , op_CB_0x97 , + op_CB_0x98 , op_CB_0x99 , op_CB_0x9a , op_CB_0x9b , + op_CB_0x9c , op_CB_0x9d , op_CB_0x9e , op_CB_0x9f , + op_CB_0xa0 , op_CB_0xa1 , op_CB_0xa2 , op_CB_0xa3 , + op_CB_0xa4 , op_CB_0xa5 , op_CB_0xa6 , op_CB_0xa7 , + op_CB_0xa8 , op_CB_0xa9 , op_CB_0xaa , op_CB_0xab , + op_CB_0xac , op_CB_0xad , op_CB_0xae , op_CB_0xaf , + op_CB_0xb0 , op_CB_0xb1 , op_CB_0xb2 , op_CB_0xb3 , + op_CB_0xb4 , op_CB_0xb5 , op_CB_0xb6 , op_CB_0xb7 , + op_CB_0xb8 , op_CB_0xb9 , op_CB_0xba , op_CB_0xbb , + op_CB_0xbc , op_CB_0xbd , op_CB_0xbe , op_CB_0xbf , + op_CB_0xc0 , op_CB_0xc1 , op_CB_0xc2 , op_CB_0xc3 , + op_CB_0xc4 , op_CB_0xc5 , op_CB_0xc6 , op_CB_0xc7 , + op_CB_0xc8 , op_CB_0xc9 , op_CB_0xca , op_CB_0xcb , + op_CB_0xcc , op_CB_0xcd , op_CB_0xce , op_CB_0xcf , + op_CB_0xd0 , op_CB_0xd1 , op_CB_0xd2 , op_CB_0xd3 , + op_CB_0xd4 , op_CB_0xd5 , op_CB_0xd6 , op_CB_0xd7 , + op_CB_0xd8 , op_CB_0xd9 , op_CB_0xda , op_CB_0xdb , + op_CB_0xdc , op_CB_0xdd , op_CB_0xde , op_CB_0xdf , + op_CB_0xe0 , op_CB_0xe1 , op_CB_0xe2 , op_CB_0xe3 , + op_CB_0xe4 , op_CB_0xe5 , op_CB_0xe6 , op_CB_0xe7 , + op_CB_0xe8 , op_CB_0xe9 , op_CB_0xea , op_CB_0xeb , + op_CB_0xec , op_CB_0xed , op_CB_0xee , op_CB_0xef , + op_CB_0xf0 , op_CB_0xf1 , op_CB_0xf2 , op_CB_0xf3 , + op_CB_0xf4 , op_CB_0xf5 , op_CB_0xf6 , op_CB_0xf7 , + op_CB_0xf8 , op_CB_0xf9 , op_CB_0xfa , op_CB_0xfb , + op_CB_0xfc , op_CB_0xfd , op_CB_0xfe , op_CB_0xff +}; diff --git a/third_party/z80ex/opcodes/opcodes_dasm.c b/third_party/z80ex/opcodes/opcodes_dasm.c new file mode 100644 index 00000000..6f6311a5 --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_dasm.c @@ -0,0 +1,1834 @@ +/* autogenerated, do not edit */ + +/**/ +static const z80ex_opc_dasm dasm_base[0x100] = { +{ "NOP" , 4 , 0 } /* 00 */, +{ "LD BC,@" , 10 , 0 } /* 01 */, +{ "LD (BC),A" , 7 , 0 } /* 02 */, +{ "INC BC" , 6 , 0 } /* 03 */, +{ "INC B" , 4 , 0 } /* 04 */, +{ "DEC B" , 4 , 0 } /* 05 */, +{ "LD B,#" , 7 , 0 } /* 06 */, +{ "RLCA" , 4 , 0 } /* 07 */, +{ "EX AF,AF'" , 4 , 0 } /* 08 */, +{ "ADD HL,BC" , 11 , 0 } /* 09 */, +{ "LD A,(BC)" , 7 , 0 } /* 0A */, +{ "DEC BC" , 6 , 0 } /* 0B */, +{ "INC C" , 4 , 0 } /* 0C */, +{ "DEC C" , 4 , 0 } /* 0D */, +{ "LD C,#" , 7 , 0 } /* 0E */, +{ "RRCA" , 4 , 0 } /* 0F */, +{ "DJNZ %" , 8 , 13 } /* 10 */, +{ "LD DE,@" , 10 , 0 } /* 11 */, +{ "LD (DE),A" , 7 , 0 } /* 12 */, +{ "INC DE" , 6 , 0 } /* 13 */, +{ "INC D" , 4 , 0 } /* 14 */, +{ "DEC D" , 4 , 0 } /* 15 */, +{ "LD D,#" , 7 , 0 } /* 16 */, +{ "RLA" , 4 , 0 } /* 17 */, +{ "JR %" , 12 , 0 } /* 18 */, +{ "ADD HL,DE" , 11 , 0 } /* 19 */, +{ "LD A,(DE)" , 7 , 0 } /* 1A */, +{ "DEC DE" , 6 , 0 } /* 1B */, +{ "INC E" , 4 , 0 } /* 1C */, +{ "DEC E" , 4 , 0 } /* 1D */, +{ "LD E,#" , 7 , 0 } /* 1E */, +{ "RRA" , 4 , 0 } /* 1F */, +{ "JR NZ,%" , 7 , 12 } /* 20 */, +{ "LD HL,@" , 10 , 0 } /* 21 */, +{ "LD (@),HL" , 16 , 0 } /* 22 */, +{ "INC HL" , 6 , 0 } /* 23 */, +{ "INC H" , 4 , 0 } /* 24 */, +{ "DEC H" , 4 , 0 } /* 25 */, +{ "LD H,#" , 7 , 0 } /* 26 */, +{ "DAA" , 4 , 0 } /* 27 */, +{ "JR Z,%" , 7 , 12 } /* 28 */, +{ "ADD HL,HL" , 11 , 0 } /* 29 */, +{ "LD HL,(@)" , 16 , 0 } /* 2A */, +{ "DEC HL" , 6 , 0 } /* 2B */, +{ "INC L" , 4 , 0 } /* 2C */, +{ "DEC L" , 4 , 0 } /* 2D */, +{ "LD L,#" , 7 , 0 } /* 2E */, +{ "CPL" , 4 , 0 } /* 2F */, +{ "JR NC,%" , 7 , 12 } /* 30 */, +{ "LD SP,@" , 10 , 0 } /* 31 */, +{ "LD (@),A" , 13 , 0 } /* 32 */, +{ "INC SP" , 6 , 0 } /* 33 */, +{ "INC (HL)" , 11 , 0 } /* 34 */, +{ "DEC (HL)" , 11 , 0 } /* 35 */, +{ "LD (HL),#" , 10 , 0 } /* 36 */, +{ "SCF" , 4 , 0 } /* 37 */, +{ "JR C,%" , 7 , 12 } /* 38 */, +{ "ADD HL,SP" , 11 , 0 } /* 39 */, +{ "LD A,(@)" , 13 , 0 } /* 3A */, +{ "DEC SP" , 6 , 0 } /* 3B */, +{ "INC A" , 4 , 0 } /* 3C */, +{ "DEC A" , 4 , 0 } /* 3D */, +{ "LD A,#" , 7 , 0 } /* 3E */, +{ "CCF" , 4 , 0 } /* 3F */, +{ "LD B,B" , 4 , 0 } /* 40 */, +{ "LD B,C" , 4 , 0 } /* 41 */, +{ "LD B,D" , 4 , 0 } /* 42 */, +{ "LD B,E" , 4 , 0 } /* 43 */, +{ "LD B,H" , 4 , 0 } /* 44 */, +{ "LD B,L" , 4 , 0 } /* 45 */, +{ "LD B,(HL)" , 7 , 0 } /* 46 */, +{ "LD B,A" , 4 , 0 } /* 47 */, +{ "LD C,B" , 4 , 0 } /* 48 */, +{ "LD C,C" , 4 , 0 } /* 49 */, +{ "LD C,D" , 4 , 0 } /* 4A */, +{ "LD C,E" , 4 , 0 } /* 4B */, +{ "LD C,H" , 4 , 0 } /* 4C */, +{ "LD C,L" , 4 , 0 } /* 4D */, +{ "LD C,(HL)" , 7 , 0 } /* 4E */, +{ "LD C,A" , 4 , 0 } /* 4F */, +{ "LD D,B" , 4 , 0 } /* 50 */, +{ "LD D,C" , 4 , 0 } /* 51 */, +{ "LD D,D" , 4 , 0 } /* 52 */, +{ "LD D,E" , 4 , 0 } /* 53 */, +{ "LD D,H" , 4 , 0 } /* 54 */, +{ "LD D,L" , 4 , 0 } /* 55 */, +{ "LD D,(HL)" , 7 , 0 } /* 56 */, +{ "LD D,A" , 4 , 0 } /* 57 */, +{ "LD E,B" , 4 , 0 } /* 58 */, +{ "LD E,C" , 4 , 0 } /* 59 */, +{ "LD E,D" , 4 , 0 } /* 5A */, +{ "LD E,E" , 4 , 0 } /* 5B */, +{ "LD E,H" , 4 , 0 } /* 5C */, +{ "LD E,L" , 4 , 0 } /* 5D */, +{ "LD E,(HL)" , 7 , 0 } /* 5E */, +{ "LD E,A" , 4 , 0 } /* 5F */, +{ "LD H,B" , 4 , 0 } /* 60 */, +{ "LD H,C" , 4 , 0 } /* 61 */, +{ "LD H,D" , 4 , 0 } /* 62 */, +{ "LD H,E" , 4 , 0 } /* 63 */, +{ "LD H,H" , 4 , 0 } /* 64 */, +{ "LD H,L" , 4 , 0 } /* 65 */, +{ "LD H,(HL)" , 7 , 0 } /* 66 */, +{ "LD H,A" , 4 , 0 } /* 67 */, +{ "LD L,B" , 4 , 0 } /* 68 */, +{ "LD L,C" , 4 , 0 } /* 69 */, +{ "LD L,D" , 4 , 0 } /* 6A */, +{ "LD L,E" , 4 , 0 } /* 6B */, +{ "LD L,H" , 4 , 0 } /* 6C */, +{ "LD L,L" , 4 , 0 } /* 6D */, +{ "LD L,(HL)" , 7 , 0 } /* 6E */, +{ "LD L,A" , 4 , 0 } /* 6F */, +{ "LD (HL),B" , 7 , 0 } /* 70 */, +{ "LD (HL),C" , 7 , 0 } /* 71 */, +{ "LD (HL),D" , 7 , 0 } /* 72 */, +{ "LD (HL),E" , 7 , 0 } /* 73 */, +{ "LD (HL),H" , 7 , 0 } /* 74 */, +{ "LD (HL),L" , 7 , 0 } /* 75 */, +{ "HALT" , 4 , 0 } /* 76 */, +{ "LD (HL),A" , 7 , 0 } /* 77 */, +{ "LD A,B" , 4 , 0 } /* 78 */, +{ "LD A,C" , 4 , 0 } /* 79 */, +{ "LD A,D" , 4 , 0 } /* 7A */, +{ "LD A,E" , 4 , 0 } /* 7B */, +{ "LD A,H" , 4 , 0 } /* 7C */, +{ "LD A,L" , 4 , 0 } /* 7D */, +{ "LD A,(HL)" , 7 , 0 } /* 7E */, +{ "LD A,A" , 4 , 0 } /* 7F */, +{ "ADD A,B" , 4 , 0 } /* 80 */, +{ "ADD A,C" , 4 , 0 } /* 81 */, +{ "ADD A,D" , 4 , 0 } /* 82 */, +{ "ADD A,E" , 4 , 0 } /* 83 */, +{ "ADD A,H" , 4 , 0 } /* 84 */, +{ "ADD A,L" , 4 , 0 } /* 85 */, +{ "ADD A,(HL)" , 7 , 0 } /* 86 */, +{ "ADD A,A" , 4 , 0 } /* 87 */, +{ "ADC A,B" , 4 , 0 } /* 88 */, +{ "ADC A,C" , 4 , 0 } /* 89 */, +{ "ADC A,D" , 4 , 0 } /* 8A */, +{ "ADC A,E" , 4 , 0 } /* 8B */, +{ "ADC A,H" , 4 , 0 } /* 8C */, +{ "ADC A,L" , 4 , 0 } /* 8D */, +{ "ADC A,(HL)" , 7 , 0 } /* 8E */, +{ "ADC A,A" , 4 , 0 } /* 8F */, +{ "SUB B" , 4 , 0 } /* 90 */, +{ "SUB C" , 4 , 0 } /* 91 */, +{ "SUB D" , 4 , 0 } /* 92 */, +{ "SUB E" , 4 , 0 } /* 93 */, +{ "SUB H" , 4 , 0 } /* 94 */, +{ "SUB L" , 4 , 0 } /* 95 */, +{ "SUB (HL)" , 7 , 0 } /* 96 */, +{ "SUB A" , 4 , 0 } /* 97 */, +{ "SBC A,B" , 4 , 0 } /* 98 */, +{ "SBC A,C" , 4 , 0 } /* 99 */, +{ "SBC A,D" , 4 , 0 } /* 9A */, +{ "SBC A,E" , 4 , 0 } /* 9B */, +{ "SBC A,H" , 4 , 0 } /* 9C */, +{ "SBC A,L" , 4 , 0 } /* 9D */, +{ "SBC A,(HL)" , 7 , 0 } /* 9E */, +{ "SBC A,A" , 4 , 0 } /* 9F */, +{ "AND B" , 4 , 0 } /* A0 */, +{ "AND C" , 4 , 0 } /* A1 */, +{ "AND D" , 4 , 0 } /* A2 */, +{ "AND E" , 4 , 0 } /* A3 */, +{ "AND H" , 4 , 0 } /* A4 */, +{ "AND L" , 4 , 0 } /* A5 */, +{ "AND (HL)" , 7 , 0 } /* A6 */, +{ "AND A" , 4 , 0 } /* A7 */, +{ "XOR B" , 4 , 0 } /* A8 */, +{ "XOR C" , 4 , 0 } /* A9 */, +{ "XOR D" , 4 , 0 } /* AA */, +{ "XOR E" , 4 , 0 } /* AB */, +{ "XOR H" , 4 , 0 } /* AC */, +{ "XOR L" , 4 , 0 } /* AD */, +{ "XOR (HL)" , 7 , 0 } /* AE */, +{ "XOR A" , 4 , 0 } /* AF */, +{ "OR B" , 4 , 0 } /* B0 */, +{ "OR C" , 4 , 0 } /* B1 */, +{ "OR D" , 4 , 0 } /* B2 */, +{ "OR E" , 4 , 0 } /* B3 */, +{ "OR H" , 4 , 0 } /* B4 */, +{ "OR L" , 4 , 0 } /* B5 */, +{ "OR (HL)" , 7 , 0 } /* B6 */, +{ "OR A" , 4 , 0 } /* B7 */, +{ "CP B" , 4 , 0 } /* B8 */, +{ "CP C" , 4 , 0 } /* B9 */, +{ "CP D" , 4 , 0 } /* BA */, +{ "CP E" , 4 , 0 } /* BB */, +{ "CP H" , 4 , 0 } /* BC */, +{ "CP L" , 4 , 0 } /* BD */, +{ "CP (HL)" , 7 , 0 } /* BE */, +{ "CP A" , 4 , 0 } /* BF */, +{ "RET NZ" , 5 , 11 } /* C0 */, +{ "POP BC" , 10 , 0 } /* C1 */, +{ "JP NZ,@" , 10 , 0 } /* C2 */, +{ "JP @" , 10 , 0 } /* C3 */, +{ "CALL NZ,@" , 10 , 17 } /* C4 */, +{ "PUSH BC" , 11 , 0 } /* C5 */, +{ "ADD A,#" , 7 , 0 } /* C6 */, +{ "RST 0x00" , 11 , 0 } /* C7 */, +{ "RET Z" , 5 , 11 } /* C8 */, +{ "RET" , 10 , 0 } /* C9 */, +{ "JP Z,@" , 10 , 0 } /* CA */, +{ "shift CB" , 4 , 0 } /* CB */, +{ "CALL Z,@" , 10 , 17 } /* CC */, +{ "CALL @" , 17 , 0 } /* CD */, +{ "ADC A,#" , 7 , 0 } /* CE */, +{ "RST 0x08" , 11 , 0 } /* CF */, +{ "RET NC" , 5 , 11 } /* D0 */, +{ "POP DE" , 10 , 0 } /* D1 */, +{ "JP NC,@" , 10 , 0 } /* D2 */, +{ "OUT (#),A" , 11 , 0 } /* D3 */, +{ "CALL NC,@" , 10 , 17 } /* D4 */, +{ "PUSH DE" , 11 , 0 } /* D5 */, +{ "SUB #" , 7 , 0 } /* D6 */, +{ "RST 0x10" , 11 , 0 } /* D7 */, +{ "RET C" , 5 , 11 } /* D8 */, +{ "EXX" , 4 , 0 } /* D9 */, +{ "JP C,@" , 10 , 0 } /* DA */, +{ "IN A,(#)" , 11 , 0 } /* DB */, +{ "CALL C,@" , 10 , 17 } /* DC */, +{ "shift DD" , 0 , 0 } /* DD */, +{ "SBC A,#" , 7 , 0 } /* DE */, +{ "RST 0x18" , 11 , 0 } /* DF */, +{ "RET PO" , 5 , 11 } /* E0 */, +{ "POP HL" , 10 , 0 } /* E1 */, +{ "JP PO,@" , 10 , 0 } /* E2 */, +{ "EX (SP),HL" , 19 , 0 } /* E3 */, +{ "CALL PO,@" , 10 , 17 } /* E4 */, +{ "PUSH HL" , 11 , 0 } /* E5 */, +{ "AND #" , 7 , 0 } /* E6 */, +{ "RST 0x20" , 11 , 0 } /* E7 */, +{ "RET PE" , 5 , 11 } /* E8 */, +{ "JP HL" , 4 , 0 } /* E9 */, +{ "JP PE,@" , 10 , 0 } /* EA */, +{ "EX DE,HL" , 4 , 0 } /* EB */, +{ "CALL PE,@" , 10 , 17 } /* EC */, +{ "shift ED" , 0 , 0 } /* ED */, +{ "XOR #" , 7 , 0 } /* EE */, +{ "RST 0x28" , 11 , 0 } /* EF */, +{ "RET P" , 5 , 11 } /* F0 */, +{ "POP AF" , 10 , 0 } /* F1 */, +{ "JP P,@" , 10 , 0 } /* F2 */, +{ "DI" , 4 , 0 } /* F3 */, +{ "CALL P,@" , 10 , 17 } /* F4 */, +{ "PUSH AF" , 11 , 0 } /* F5 */, +{ "OR #" , 7 , 0 } /* F6 */, +{ "RST 0x30" , 11 , 0 } /* F7 */, +{ "RET M" , 5 , 11 } /* F8 */, +{ "LD SP,HL" , 6 , 0 } /* F9 */, +{ "JP M,@" , 10 , 0 } /* FA */, +{ "EI" , 4 , 0 } /* FB */, +{ "CALL M,@" , 10 , 17 } /* FC */, +{ "shift FD" , 4 , 0 } /* FD */, +{ "CP #" , 7 , 0 } /* FE */, +{ "RST 0x38" , 11 , 0 } /* FF */ + +}; + + +/**/ +static const z80ex_opc_dasm dasm_cb[0x100] = { +{ "RLC B" , 8 , 0 } /* 00 */, +{ "RLC C" , 8 , 0 } /* 01 */, +{ "RLC D" , 8 , 0 } /* 02 */, +{ "RLC E" , 8 , 0 } /* 03 */, +{ "RLC H" , 8 , 0 } /* 04 */, +{ "RLC L" , 8 , 0 } /* 05 */, +{ "RLC (HL)" , 15 , 0 } /* 06 */, +{ "RLC A" , 8 , 0 } /* 07 */, +{ "RRC B" , 8 , 0 } /* 08 */, +{ "RRC C" , 8 , 0 } /* 09 */, +{ "RRC D" , 8 , 0 } /* 0A */, +{ "RRC E" , 8 , 0 } /* 0B */, +{ "RRC H" , 8 , 0 } /* 0C */, +{ "RRC L" , 8 , 0 } /* 0D */, +{ "RRC (HL)" , 15 , 0 } /* 0E */, +{ "RRC A" , 8 , 0 } /* 0F */, +{ "RL B" , 8 , 0 } /* 10 */, +{ "RL C" , 8 , 0 } /* 11 */, +{ "RL D" , 8 , 0 } /* 12 */, +{ "RL E" , 8 , 0 } /* 13 */, +{ "RL H" , 8 , 0 } /* 14 */, +{ "RL L" , 8 , 0 } /* 15 */, +{ "RL (HL)" , 15 , 0 } /* 16 */, +{ "RL A" , 8 , 0 } /* 17 */, +{ "RR B" , 8 , 0 } /* 18 */, +{ "RR C" , 8 , 0 } /* 19 */, +{ "RR D" , 8 , 0 } /* 1A */, +{ "RR E" , 8 , 0 } /* 1B */, +{ "RR H" , 8 , 0 } /* 1C */, +{ "RR L" , 8 , 0 } /* 1D */, +{ "RR (HL)" , 15 , 0 } /* 1E */, +{ "RR A" , 8 , 0 } /* 1F */, +{ "SLA B" , 8 , 0 } /* 20 */, +{ "SLA C" , 8 , 0 } /* 21 */, +{ "SLA D" , 8 , 0 } /* 22 */, +{ "SLA E" , 8 , 0 } /* 23 */, +{ "SLA H" , 8 , 0 } /* 24 */, +{ "SLA L" , 8 , 0 } /* 25 */, +{ "SLA (HL)" , 15 , 0 } /* 26 */, +{ "SLA A" , 8 , 0 } /* 27 */, +{ "SRA B" , 8 , 0 } /* 28 */, +{ "SRA C" , 8 , 0 } /* 29 */, +{ "SRA D" , 8 , 0 } /* 2A */, +{ "SRA E" , 8 , 0 } /* 2B */, +{ "SRA H" , 8 , 0 } /* 2C */, +{ "SRA L" , 8 , 0 } /* 2D */, +{ "SRA (HL)" , 15 , 0 } /* 2E */, +{ "SRA A" , 8 , 0 } /* 2F */, +{ "SLL B" , 8 , 0 } /* 30 */, +{ "SLL C" , 8 , 0 } /* 31 */, +{ "SLL D" , 8 , 0 } /* 32 */, +{ "SLL E" , 8 , 0 } /* 33 */, +{ "SLL H" , 8 , 0 } /* 34 */, +{ "SLL L" , 8 , 0 } /* 35 */, +{ "SLL (HL)" , 15 , 0 } /* 36 */, +{ "SLL A" , 8 , 0 } /* 37 */, +{ "SRL B" , 8 , 0 } /* 38 */, +{ "SRL C" , 8 , 0 } /* 39 */, +{ "SRL D" , 8 , 0 } /* 3A */, +{ "SRL E" , 8 , 0 } /* 3B */, +{ "SRL H" , 8 , 0 } /* 3C */, +{ "SRL L" , 8 , 0 } /* 3D */, +{ "SRL (HL)" , 15 , 0 } /* 3E */, +{ "SRL A" , 8 , 0 } /* 3F */, +{ "BIT 0,B" , 8 , 0 } /* 40 */, +{ "BIT 0,C" , 8 , 0 } /* 41 */, +{ "BIT 0,D" , 8 , 0 } /* 42 */, +{ "BIT 0,E" , 8 , 0 } /* 43 */, +{ "BIT 0,H" , 8 , 0 } /* 44 */, +{ "BIT 0,L" , 8 , 0 } /* 45 */, +{ "BIT 0,(HL)" , 12 , 0 } /* 46 */, +{ "BIT 0,A" , 8 , 0 } /* 47 */, +{ "BIT 1,B" , 8 , 0 } /* 48 */, +{ "BIT 1,C" , 8 , 0 } /* 49 */, +{ "BIT 1,D" , 8 , 0 } /* 4A */, +{ "BIT 1,E" , 8 , 0 } /* 4B */, +{ "BIT 1,H" , 8 , 0 } /* 4C */, +{ "BIT 1,L" , 8 , 0 } /* 4D */, +{ "BIT 1,(HL)" , 12 , 0 } /* 4E */, +{ "BIT 1,A" , 8 , 0 } /* 4F */, +{ "BIT 2,B" , 8 , 0 } /* 50 */, +{ "BIT 2,C" , 8 , 0 } /* 51 */, +{ "BIT 2,D" , 8 , 0 } /* 52 */, +{ "BIT 2,E" , 8 , 0 } /* 53 */, +{ "BIT 2,H" , 8 , 0 } /* 54 */, +{ "BIT 2,L" , 8 , 0 } /* 55 */, +{ "BIT 2,(HL)" , 12 , 0 } /* 56 */, +{ "BIT 2,A" , 8 , 0 } /* 57 */, +{ "BIT 3,B" , 8 , 0 } /* 58 */, +{ "BIT 3,C" , 8 , 0 } /* 59 */, +{ "BIT 3,D" , 8 , 0 } /* 5A */, +{ "BIT 3,E" , 8 , 0 } /* 5B */, +{ "BIT 3,H" , 8 , 0 } /* 5C */, +{ "BIT 3,L" , 8 , 0 } /* 5D */, +{ "BIT 3,(HL)" , 12 , 0 } /* 5E */, +{ "BIT 3,A" , 8 , 0 } /* 5F */, +{ "BIT 4,B" , 8 , 0 } /* 60 */, +{ "BIT 4,C" , 8 , 0 } /* 61 */, +{ "BIT 4,D" , 8 , 0 } /* 62 */, +{ "BIT 4,E" , 8 , 0 } /* 63 */, +{ "BIT 4,H" , 8 , 0 } /* 64 */, +{ "BIT 4,L" , 8 , 0 } /* 65 */, +{ "BIT 4,(HL)" , 12 , 0 } /* 66 */, +{ "BIT 4,A" , 8 , 0 } /* 67 */, +{ "BIT 5,B" , 8 , 0 } /* 68 */, +{ "BIT 5,C" , 8 , 0 } /* 69 */, +{ "BIT 5,D" , 8 , 0 } /* 6A */, +{ "BIT 5,E" , 8 , 0 } /* 6B */, +{ "BIT 5,H" , 8 , 0 } /* 6C */, +{ "BIT 5,L" , 8 , 0 } /* 6D */, +{ "BIT 5,(HL)" , 12 , 0 } /* 6E */, +{ "BIT 5,A" , 8 , 0 } /* 6F */, +{ "BIT 6,B" , 8 , 0 } /* 70 */, +{ "BIT 6,C" , 8 , 0 } /* 71 */, +{ "BIT 6,D" , 8 , 0 } /* 72 */, +{ "BIT 6,E" , 8 , 0 } /* 73 */, +{ "BIT 6,H" , 8 , 0 } /* 74 */, +{ "BIT 6,L" , 8 , 0 } /* 75 */, +{ "BIT 6,(HL)" , 12 , 0 } /* 76 */, +{ "BIT 6,A" , 8 , 0 } /* 77 */, +{ "BIT 7,B" , 8 , 0 } /* 78 */, +{ "BIT 7,C" , 8 , 0 } /* 79 */, +{ "BIT 7,D" , 8 , 0 } /* 7A */, +{ "BIT 7,E" , 8 , 0 } /* 7B */, +{ "BIT 7,H" , 8 , 0 } /* 7C */, +{ "BIT 7,L" , 8 , 0 } /* 7D */, +{ "BIT 7,(HL)" , 12 , 0 } /* 7E */, +{ "BIT 7,A" , 8 , 0 } /* 7F */, +{ "RES 0,B" , 8 , 0 } /* 80 */, +{ "RES 0,C" , 8 , 0 } /* 81 */, +{ "RES 0,D" , 8 , 0 } /* 82 */, +{ "RES 0,E" , 8 , 0 } /* 83 */, +{ "RES 0,H" , 8 , 0 } /* 84 */, +{ "RES 0,L" , 8 , 0 } /* 85 */, +{ "RES 0,(HL)" , 15 , 0 } /* 86 */, +{ "RES 0,A" , 8 , 0 } /* 87 */, +{ "RES 1,B" , 8 , 0 } /* 88 */, +{ "RES 1,C" , 8 , 0 } /* 89 */, +{ "RES 1,D" , 8 , 0 } /* 8A */, +{ "RES 1,E" , 8 , 0 } /* 8B */, +{ "RES 1,H" , 8 , 0 } /* 8C */, +{ "RES 1,L" , 8 , 0 } /* 8D */, +{ "RES 1,(HL)" , 15 , 0 } /* 8E */, +{ "RES 1,A" , 8 , 0 } /* 8F */, +{ "RES 2,B" , 8 , 0 } /* 90 */, +{ "RES 2,C" , 8 , 0 } /* 91 */, +{ "RES 2,D" , 8 , 0 } /* 92 */, +{ "RES 2,E" , 8 , 0 } /* 93 */, +{ "RES 2,H" , 8 , 0 } /* 94 */, +{ "RES 2,L" , 8 , 0 } /* 95 */, +{ "RES 2,(HL)" , 15 , 0 } /* 96 */, +{ "RES 2,A" , 8 , 0 } /* 97 */, +{ "RES 3,B" , 8 , 0 } /* 98 */, +{ "RES 3,C" , 8 , 0 } /* 99 */, +{ "RES 3,D" , 8 , 0 } /* 9A */, +{ "RES 3,E" , 8 , 0 } /* 9B */, +{ "RES 3,H" , 8 , 0 } /* 9C */, +{ "RES 3,L" , 8 , 0 } /* 9D */, +{ "RES 3,(HL)" , 15 , 0 } /* 9E */, +{ "RES 3,A" , 8 , 0 } /* 9F */, +{ "RES 4,B" , 8 , 0 } /* A0 */, +{ "RES 4,C" , 8 , 0 } /* A1 */, +{ "RES 4,D" , 8 , 0 } /* A2 */, +{ "RES 4,E" , 8 , 0 } /* A3 */, +{ "RES 4,H" , 8 , 0 } /* A4 */, +{ "RES 4,L" , 8 , 0 } /* A5 */, +{ "RES 4,(HL)" , 15 , 0 } /* A6 */, +{ "RES 4,A" , 8 , 0 } /* A7 */, +{ "RES 5,B" , 8 , 0 } /* A8 */, +{ "RES 5,C" , 8 , 0 } /* A9 */, +{ "RES 5,D" , 8 , 0 } /* AA */, +{ "RES 5,E" , 8 , 0 } /* AB */, +{ "RES 5,H" , 8 , 0 } /* AC */, +{ "RES 5,L" , 8 , 0 } /* AD */, +{ "RES 5,(HL)" , 15 , 0 } /* AE */, +{ "RES 5,A" , 8 , 0 } /* AF */, +{ "RES 6,B" , 8 , 0 } /* B0 */, +{ "RES 6,C" , 8 , 0 } /* B1 */, +{ "RES 6,D" , 8 , 0 } /* B2 */, +{ "RES 6,E" , 8 , 0 } /* B3 */, +{ "RES 6,H" , 8 , 0 } /* B4 */, +{ "RES 6,L" , 8 , 0 } /* B5 */, +{ "RES 6,(HL)" , 15 , 0 } /* B6 */, +{ "RES 6,A" , 8 , 0 } /* B7 */, +{ "RES 7,B" , 8 , 0 } /* B8 */, +{ "RES 7,C" , 8 , 0 } /* B9 */, +{ "RES 7,D" , 8 , 0 } /* BA */, +{ "RES 7,E" , 8 , 0 } /* BB */, +{ "RES 7,H" , 8 , 0 } /* BC */, +{ "RES 7,L" , 8 , 0 } /* BD */, +{ "RES 7,(HL)" , 15 , 0 } /* BE */, +{ "RES 7,A" , 8 , 0 } /* BF */, +{ "SET 0,B" , 8 , 0 } /* C0 */, +{ "SET 0,C" , 8 , 0 } /* C1 */, +{ "SET 0,D" , 8 , 0 } /* C2 */, +{ "SET 0,E" , 8 , 0 } /* C3 */, +{ "SET 0,H" , 8 , 0 } /* C4 */, +{ "SET 0,L" , 8 , 0 } /* C5 */, +{ "SET 0,(HL)" , 15 , 0 } /* C6 */, +{ "SET 0,A" , 8 , 0 } /* C7 */, +{ "SET 1,B" , 8 , 0 } /* C8 */, +{ "SET 1,C" , 8 , 0 } /* C9 */, +{ "SET 1,D" , 8 , 0 } /* CA */, +{ "SET 1,E" , 8 , 0 } /* CB */, +{ "SET 1,H" , 8 , 0 } /* CC */, +{ "SET 1,L" , 8 , 0 } /* CD */, +{ "SET 1,(HL)" , 15 , 0 } /* CE */, +{ "SET 1,A" , 8 , 0 } /* CF */, +{ "SET 2,B" , 8 , 0 } /* D0 */, +{ "SET 2,C" , 8 , 0 } /* D1 */, +{ "SET 2,D" , 8 , 0 } /* D2 */, +{ "SET 2,E" , 8 , 0 } /* D3 */, +{ "SET 2,H" , 8 , 0 } /* D4 */, +{ "SET 2,L" , 8 , 0 } /* D5 */, +{ "SET 2,(HL)" , 15 , 0 } /* D6 */, +{ "SET 2,A" , 8 , 0 } /* D7 */, +{ "SET 3,B" , 8 , 0 } /* D8 */, +{ "SET 3,C" , 8 , 0 } /* D9 */, +{ "SET 3,D" , 8 , 0 } /* DA */, +{ "SET 3,E" , 8 , 0 } /* DB */, +{ "SET 3,H" , 8 , 0 } /* DC */, +{ "SET 3,L" , 8 , 0 } /* DD */, +{ "SET 3,(HL)" , 15 , 0 } /* DE */, +{ "SET 3,A" , 8 , 0 } /* DF */, +{ "SET 4,B" , 8 , 0 } /* E0 */, +{ "SET 4,C" , 8 , 0 } /* E1 */, +{ "SET 4,D" , 8 , 0 } /* E2 */, +{ "SET 4,E" , 8 , 0 } /* E3 */, +{ "SET 4,H" , 8 , 0 } /* E4 */, +{ "SET 4,L" , 8 , 0 } /* E5 */, +{ "SET 4,(HL)" , 15 , 0 } /* E6 */, +{ "SET 4,A" , 8 , 0 } /* E7 */, +{ "SET 5,B" , 8 , 0 } /* E8 */, +{ "SET 5,C" , 8 , 0 } /* E9 */, +{ "SET 5,D" , 8 , 0 } /* EA */, +{ "SET 5,E" , 8 , 0 } /* EB */, +{ "SET 5,H" , 8 , 0 } /* EC */, +{ "SET 5,L" , 8 , 0 } /* ED */, +{ "SET 5,(HL)" , 15 , 0 } /* EE */, +{ "SET 5,A" , 8 , 0 } /* EF */, +{ "SET 6,B" , 8 , 0 } /* F0 */, +{ "SET 6,C" , 8 , 0 } /* F1 */, +{ "SET 6,D" , 8 , 0 } /* F2 */, +{ "SET 6,E" , 8 , 0 } /* F3 */, +{ "SET 6,H" , 8 , 0 } /* F4 */, +{ "SET 6,L" , 8 , 0 } /* F5 */, +{ "SET 6,(HL)" , 15 , 0 } /* F6 */, +{ "SET 6,A" , 8 , 0 } /* F7 */, +{ "SET 7,B" , 8 , 0 } /* F8 */, +{ "SET 7,C" , 8 , 0 } /* F9 */, +{ "SET 7,D" , 8 , 0 } /* FA */, +{ "SET 7,E" , 8 , 0 } /* FB */, +{ "SET 7,H" , 8 , 0 } /* FC */, +{ "SET 7,L" , 8 , 0 } /* FD */, +{ "SET 7,(HL)" , 15 , 0 } /* FE */, +{ "SET 7,A" , 8 , 0 } /* FF */ + +}; + + +/**/ +static const z80ex_opc_dasm dasm_ed[0x100] = { +{ NULL , 0 , 0 } /* 00 */, +{ NULL , 0 , 0 } /* 01 */, +{ NULL , 0 , 0 } /* 02 */, +{ NULL , 0 , 0 } /* 03 */, +{ NULL , 0 , 0 } /* 04 */, +{ NULL , 0 , 0 } /* 05 */, +{ NULL , 0 , 0 } /* 06 */, +{ NULL , 0 , 0 } /* 07 */, +{ NULL , 0 , 0 } /* 08 */, +{ NULL , 0 , 0 } /* 09 */, +{ NULL , 0 , 0 } /* 0A */, +{ NULL , 0 , 0 } /* 0B */, +{ NULL , 0 , 0 } /* 0C */, +{ NULL , 0 , 0 } /* 0D */, +{ NULL , 0 , 0 } /* 0E */, +{ NULL , 0 , 0 } /* 0F */, +{ NULL , 0 , 0 } /* 10 */, +{ NULL , 0 , 0 } /* 11 */, +{ NULL , 0 , 0 } /* 12 */, +{ NULL , 0 , 0 } /* 13 */, +{ NULL , 0 , 0 } /* 14 */, +{ NULL , 0 , 0 } /* 15 */, +{ NULL , 0 , 0 } /* 16 */, +{ NULL , 0 , 0 } /* 17 */, +{ NULL , 0 , 0 } /* 18 */, +{ NULL , 0 , 0 } /* 19 */, +{ NULL , 0 , 0 } /* 1A */, +{ NULL , 0 , 0 } /* 1B */, +{ NULL , 0 , 0 } /* 1C */, +{ NULL , 0 , 0 } /* 1D */, +{ NULL , 0 , 0 } /* 1E */, +{ NULL , 0 , 0 } /* 1F */, +{ NULL , 0 , 0 } /* 20 */, +{ NULL , 0 , 0 } /* 21 */, +{ NULL , 0 , 0 } /* 22 */, +{ NULL , 0 , 0 } /* 23 */, +{ NULL , 0 , 0 } /* 24 */, +{ NULL , 0 , 0 } /* 25 */, +{ NULL , 0 , 0 } /* 26 */, +{ NULL , 0 , 0 } /* 27 */, +{ NULL , 0 , 0 } /* 28 */, +{ NULL , 0 , 0 } /* 29 */, +{ NULL , 0 , 0 } /* 2A */, +{ NULL , 0 , 0 } /* 2B */, +{ NULL , 0 , 0 } /* 2C */, +{ NULL , 0 , 0 } /* 2D */, +{ NULL , 0 , 0 } /* 2E */, +{ NULL , 0 , 0 } /* 2F */, +{ NULL , 0 , 0 } /* 30 */, +{ NULL , 0 , 0 } /* 31 */, +{ NULL , 0 , 0 } /* 32 */, +{ NULL , 0 , 0 } /* 33 */, +{ NULL , 0 , 0 } /* 34 */, +{ NULL , 0 , 0 } /* 35 */, +{ NULL , 0 , 0 } /* 36 */, +{ NULL , 0 , 0 } /* 37 */, +{ NULL , 0 , 0 } /* 38 */, +{ NULL , 0 , 0 } /* 39 */, +{ NULL , 0 , 0 } /* 3A */, +{ NULL , 0 , 0 } /* 3B */, +{ NULL , 0 , 0 } /* 3C */, +{ NULL , 0 , 0 } /* 3D */, +{ NULL , 0 , 0 } /* 3E */, +{ NULL , 0 , 0 } /* 3F */, +{ "IN B,(C)" , 12 , 0 } /* 40 */, +{ "OUT (C),B" , 12 , 0 } /* 41 */, +{ "SBC HL,BC" , 15 , 0 } /* 42 */, +{ "LD (@),BC" , 20 , 0 } /* 43 */, +{ "NEG" , 8 , 0 } /* 44 */, +{ "RETN" , 14 , 0 } /* 45 */, +{ "IM 0" , 8 , 0 } /* 46 */, +{ "LD I,A" , 9 , 0 } /* 47 */, +{ "IN C,(C)" , 12 , 0 } /* 48 */, +{ "OUT (C),C" , 12 , 0 } /* 49 */, +{ "ADC HL,BC" , 15 , 0 } /* 4A */, +{ "LD BC,(@)" , 20 , 0 } /* 4B */, +{ "NEG" , 8 , 0 } /* 4C */, +{ "RETI" , 14 , 0 } /* 4D */, +{ "IM 0" , 8 , 0 } /* 4E */, +{ "LD_R_A" , 9 , 0 } /* 4F */, +{ "IN D,(C)" , 12 , 0 } /* 50 */, +{ "OUT (C),D" , 12 , 0 } /* 51 */, +{ "SBC HL,DE" , 15 , 0 } /* 52 */, +{ "LD (@),DE" , 20 , 0 } /* 53 */, +{ "NEG" , 8 , 0 } /* 54 */, +{ "RETN" , 14 , 0 } /* 55 */, +{ "IM 1" , 8 , 0 } /* 56 */, +{ "LD_A_I" , 9 , 0 } /* 57 */, +{ "IN E,(C)" , 12 , 0 } /* 58 */, +{ "OUT (C),E" , 12 , 0 } /* 59 */, +{ "ADC HL,DE" , 15 , 0 } /* 5A */, +{ "LD DE,(@)" , 20 , 0 } /* 5B */, +{ "NEG" , 8 , 0 } /* 5C */, +{ "RETI" , 14 , 0 } /* 5D */, +{ "IM 2" , 8 , 0 } /* 5E */, +{ "LD_A_R" , 9 , 0 } /* 5F */, +{ "IN H,(C)" , 12 , 0 } /* 60 */, +{ "OUT (C),H" , 12 , 0 } /* 61 */, +{ "SBC HL,HL" , 15 , 0 } /* 62 */, +{ "LD (@),HL" , 20 , 0 } /* 63 */, +{ "NEG" , 8 , 0 } /* 64 */, +{ "RETN" , 14 , 0 } /* 65 */, +{ "IM 0" , 8 , 0 } /* 66 */, +{ "RRD" , 18 , 0 } /* 67 */, +{ "IN L,(C)" , 12 , 0 } /* 68 */, +{ "OUT (C),L" , 12 , 0 } /* 69 */, +{ "ADC HL,HL" , 15 , 0 } /* 6A */, +{ "LD HL,(@)" , 20 , 0 } /* 6B */, +{ "NEG" , 8 , 0 } /* 6C */, +{ "RETI" , 14 , 0 } /* 6D */, +{ "IM 0" , 8 , 0 } /* 6E */, +{ "RLD" , 18 , 0 } /* 6F */, +{ "IN_F (C)" , 12 , 0 } /* 70 */, +{ "OUT (C),0" , 12 , 0 } /* 71 */, +{ "SBC HL,SP" , 15 , 0 } /* 72 */, +{ "LD (@),SP" , 20 , 0 } /* 73 */, +{ "NEG" , 8 , 0 } /* 74 */, +{ "RETN" , 14 , 0 } /* 75 */, +{ "IM 1" , 8 , 0 } /* 76 */, +{ NULL , 0 , 0 } /* 77 */, +{ "IN A,(C)" , 12 , 0 } /* 78 */, +{ "OUT (C),A" , 12 , 0 } /* 79 */, +{ "ADC HL,SP" , 15 , 0 } /* 7A */, +{ "LD SP,(@)" , 20 , 0 } /* 7B */, +{ "NEG" , 8 , 0 } /* 7C */, +{ "RETI" , 14 , 0 } /* 7D */, +{ "IM 2" , 8 , 0 } /* 7E */, +{ NULL , 0 , 0 } /* 7F */, +{ NULL , 0 , 0 } /* 80 */, +{ NULL , 0 , 0 } /* 81 */, +{ NULL , 0 , 0 } /* 82 */, +{ NULL , 0 , 0 } /* 83 */, +{ NULL , 0 , 0 } /* 84 */, +{ NULL , 0 , 0 } /* 85 */, +{ NULL , 0 , 0 } /* 86 */, +{ NULL , 0 , 0 } /* 87 */, +{ NULL , 0 , 0 } /* 88 */, +{ NULL , 0 , 0 } /* 89 */, +{ NULL , 0 , 0 } /* 8A */, +{ NULL , 0 , 0 } /* 8B */, +{ NULL , 0 , 0 } /* 8C */, +{ NULL , 0 , 0 } /* 8D */, +{ NULL , 0 , 0 } /* 8E */, +{ NULL , 0 , 0 } /* 8F */, +{ NULL , 0 , 0 } /* 90 */, +{ NULL , 0 , 0 } /* 91 */, +{ NULL , 0 , 0 } /* 92 */, +{ NULL , 0 , 0 } /* 93 */, +{ NULL , 0 , 0 } /* 94 */, +{ NULL , 0 , 0 } /* 95 */, +{ NULL , 0 , 0 } /* 96 */, +{ NULL , 0 , 0 } /* 97 */, +{ NULL , 0 , 0 } /* 98 */, +{ NULL , 0 , 0 } /* 99 */, +{ NULL , 0 , 0 } /* 9A */, +{ NULL , 0 , 0 } /* 9B */, +{ NULL , 0 , 0 } /* 9C */, +{ NULL , 0 , 0 } /* 9D */, +{ NULL , 0 , 0 } /* 9E */, +{ NULL , 0 , 0 } /* 9F */, +{ "LDI" , 16 , 0 } /* A0 */, +{ "CPI" , 16 , 0 } /* A1 */, +{ "INI" , 16 , 0 } /* A2 */, +{ "OUTI" , 16 , 0 } /* A3 */, +{ NULL , 0 , 0 } /* A4 */, +{ NULL , 0 , 0 } /* A5 */, +{ NULL , 0 , 0 } /* A6 */, +{ NULL , 0 , 0 } /* A7 */, +{ "LDD" , 16 , 0 } /* A8 */, +{ "CPD" , 16 , 0 } /* A9 */, +{ "IND" , 16 , 0 } /* AA */, +{ "OUTD" , 16 , 0 } /* AB */, +{ NULL , 0 , 0 } /* AC */, +{ NULL , 0 , 0 } /* AD */, +{ NULL , 0 , 0 } /* AE */, +{ NULL , 0 , 0 } /* AF */, +{ "LDIR" , 16 , 21 } /* B0 */, +{ "CPIR" , 16 , 21 } /* B1 */, +{ "INIR" , 16 , 21 } /* B2 */, +{ "OTIR" , 16 , 21 } /* B3 */, +{ NULL , 0 , 0 } /* B4 */, +{ NULL , 0 , 0 } /* B5 */, +{ NULL , 0 , 0 } /* B6 */, +{ NULL , 0 , 0 } /* B7 */, +{ "LDDR" , 16 , 21 } /* B8 */, +{ "CPDR" , 16 , 21 } /* B9 */, +{ "INDR" , 16 , 21 } /* BA */, +{ "OTDR" , 16 , 21 } /* BB */, +{ NULL , 0 , 0 } /* BC */, +{ NULL , 0 , 0 } /* BD */, +{ NULL , 0 , 0 } /* BE */, +{ NULL , 0 , 0 } /* BF */, +{ NULL , 0 , 0 } /* C0 */, +{ NULL , 0 , 0 } /* C1 */, +{ NULL , 0 , 0 } /* C2 */, +{ NULL , 0 , 0 } /* C3 */, +{ NULL , 0 , 0 } /* C4 */, +{ NULL , 0 , 0 } /* C5 */, +{ NULL , 0 , 0 } /* C6 */, +{ NULL , 0 , 0 } /* C7 */, +{ NULL , 0 , 0 } /* C8 */, +{ NULL , 0 , 0 } /* C9 */, +{ NULL , 0 , 0 } /* CA */, +{ NULL , 0 , 0 } /* CB */, +{ NULL , 0 , 0 } /* CC */, +{ NULL , 0 , 0 } /* CD */, +{ NULL , 0 , 0 } /* CE */, +{ NULL , 0 , 0 } /* CF */, +{ NULL , 0 , 0 } /* D0 */, +{ NULL , 0 , 0 } /* D1 */, +{ NULL , 0 , 0 } /* D2 */, +{ NULL , 0 , 0 } /* D3 */, +{ NULL , 0 , 0 } /* D4 */, +{ NULL , 0 , 0 } /* D5 */, +{ NULL , 0 , 0 } /* D6 */, +{ NULL , 0 , 0 } /* D7 */, +{ NULL , 0 , 0 } /* D8 */, +{ NULL , 0 , 0 } /* D9 */, +{ NULL , 0 , 0 } /* DA */, +{ NULL , 0 , 0 } /* DB */, +{ NULL , 0 , 0 } /* DC */, +{ NULL , 0 , 0 } /* DD */, +{ NULL , 0 , 0 } /* DE */, +{ NULL , 0 , 0 } /* DF */, +{ NULL , 0 , 0 } /* E0 */, +{ NULL , 0 , 0 } /* E1 */, +{ NULL , 0 , 0 } /* E2 */, +{ NULL , 0 , 0 } /* E3 */, +{ NULL , 0 , 0 } /* E4 */, +{ NULL , 0 , 0 } /* E5 */, +{ NULL , 0 , 0 } /* E6 */, +{ NULL , 0 , 0 } /* E7 */, +{ NULL , 0 , 0 } /* E8 */, +{ NULL , 0 , 0 } /* E9 */, +{ NULL , 0 , 0 } /* EA */, +{ NULL , 0 , 0 } /* EB */, +{ NULL , 0 , 0 } /* EC */, +{ NULL , 0 , 0 } /* ED */, +{ NULL , 0 , 0 } /* EE */, +{ NULL , 0 , 0 } /* EF */, +{ NULL , 0 , 0 } /* F0 */, +{ NULL , 0 , 0 } /* F1 */, +{ NULL , 0 , 0 } /* F2 */, +{ NULL , 0 , 0 } /* F3 */, +{ NULL , 0 , 0 } /* F4 */, +{ NULL , 0 , 0 } /* F5 */, +{ NULL , 0 , 0 } /* F6 */, +{ NULL , 0 , 0 } /* F7 */, +{ NULL , 0 , 0 } /* F8 */, +{ NULL , 0 , 0 } /* F9 */, +{ NULL , 0 , 0 } /* FA */, +{ NULL , 0 , 0 } /* FB */, +{ NULL , 0 , 0 } /* FC */, +{ NULL , 0 , 0 } /* FD */, +{ NULL , 0 , 0 } /* FE */, +{ NULL , 0 , 0 } /* FF */ + +}; + + +/**/ +static const z80ex_opc_dasm dasm_dd[0x100] = { +{ NULL , 0 , 0 } /* 00 */, +{ NULL , 0 , 0 } /* 01 */, +{ NULL , 0 , 0 } /* 02 */, +{ NULL , 0 , 0 } /* 03 */, +{ NULL , 0 , 0 } /* 04 */, +{ NULL , 0 , 0 } /* 05 */, +{ NULL , 0 , 0 } /* 06 */, +{ NULL , 0 , 0 } /* 07 */, +{ NULL , 0 , 0 } /* 08 */, +{ "ADD IX,BC" , 15 , 0 } /* 09 */, +{ NULL , 0 , 0 } /* 0A */, +{ NULL , 0 , 0 } /* 0B */, +{ NULL , 0 , 0 } /* 0C */, +{ NULL , 0 , 0 } /* 0D */, +{ NULL , 0 , 0 } /* 0E */, +{ NULL , 0 , 0 } /* 0F */, +{ NULL , 0 , 0 } /* 10 */, +{ NULL , 0 , 0 } /* 11 */, +{ NULL , 0 , 0 } /* 12 */, +{ NULL , 0 , 0 } /* 13 */, +{ NULL , 0 , 0 } /* 14 */, +{ NULL , 0 , 0 } /* 15 */, +{ NULL , 0 , 0 } /* 16 */, +{ NULL , 0 , 0 } /* 17 */, +{ NULL , 0 , 0 } /* 18 */, +{ "ADD IX,DE" , 15 , 0 } /* 19 */, +{ NULL , 0 , 0 } /* 1A */, +{ NULL , 0 , 0 } /* 1B */, +{ NULL , 0 , 0 } /* 1C */, +{ NULL , 0 , 0 } /* 1D */, +{ NULL , 0 , 0 } /* 1E */, +{ NULL , 0 , 0 } /* 1F */, +{ NULL , 0 , 0 } /* 20 */, +{ "LD IX,@" , 14 , 0 } /* 21 */, +{ "LD (@),IX" , 20 , 0 } /* 22 */, +{ "INC IX" , 10 , 0 } /* 23 */, +{ "INC IXH" , 8 , 0 } /* 24 */, +{ "DEC IXH" , 8 , 0 } /* 25 */, +{ "LD IXH,#" , 11 , 0 } /* 26 */, +{ NULL , 0 , 0 } /* 27 */, +{ NULL , 0 , 0 } /* 28 */, +{ "ADD IX,IX" , 15 , 0 } /* 29 */, +{ "LD IX,(@)" , 20 , 0 } /* 2A */, +{ "DEC IX" , 10 , 0 } /* 2B */, +{ "INC IXL" , 8 , 0 } /* 2C */, +{ "DEC IXL" , 8 , 0 } /* 2D */, +{ "LD IXL,#" , 11 , 0 } /* 2E */, +{ NULL , 0 , 0 } /* 2F */, +{ NULL , 0 , 0 } /* 30 */, +{ NULL , 0 , 0 } /* 31 */, +{ NULL , 0 , 0 } /* 32 */, +{ NULL , 0 , 0 } /* 33 */, +{ "INC (IX+$)" , 23 , 0 } /* 34 */, +{ "DEC (IX+$)" , 23 , 0 } /* 35 */, +{ "LD (IX+$),#" , 19 , 0 } /* 36 */, +{ NULL , 0 , 0 } /* 37 */, +{ NULL , 0 , 0 } /* 38 */, +{ "ADD IX,SP" , 15 , 0 } /* 39 */, +{ NULL , 0 , 0 } /* 3A */, +{ NULL , 0 , 0 } /* 3B */, +{ NULL , 0 , 0 } /* 3C */, +{ NULL , 0 , 0 } /* 3D */, +{ NULL , 0 , 0 } /* 3E */, +{ NULL , 0 , 0 } /* 3F */, +{ NULL , 0 , 0 } /* 40 */, +{ NULL , 0 , 0 } /* 41 */, +{ NULL , 0 , 0 } /* 42 */, +{ NULL , 0 , 0 } /* 43 */, +{ "LD B,IXH" , 8 , 0 } /* 44 */, +{ "LD B,IXL" , 8 , 0 } /* 45 */, +{ "LD B,(IX+$)" , 19 , 0 } /* 46 */, +{ NULL , 0 , 0 } /* 47 */, +{ NULL , 0 , 0 } /* 48 */, +{ NULL , 0 , 0 } /* 49 */, +{ NULL , 0 , 0 } /* 4A */, +{ NULL , 0 , 0 } /* 4B */, +{ "LD C,IXH" , 8 , 0 } /* 4C */, +{ "LD C,IXL" , 8 , 0 } /* 4D */, +{ "LD C,(IX+$)" , 19 , 0 } /* 4E */, +{ NULL , 0 , 0 } /* 4F */, +{ NULL , 0 , 0 } /* 50 */, +{ NULL , 0 , 0 } /* 51 */, +{ NULL , 0 , 0 } /* 52 */, +{ NULL , 0 , 0 } /* 53 */, +{ "LD D,IXH" , 8 , 0 } /* 54 */, +{ "LD D,IXL" , 8 , 0 } /* 55 */, +{ "LD D,(IX+$)" , 19 , 0 } /* 56 */, +{ NULL , 0 , 0 } /* 57 */, +{ NULL , 0 , 0 } /* 58 */, +{ NULL , 0 , 0 } /* 59 */, +{ NULL , 0 , 0 } /* 5A */, +{ NULL , 0 , 0 } /* 5B */, +{ "LD E,IXH" , 8 , 0 } /* 5C */, +{ "LD E,IXL" , 8 , 0 } /* 5D */, +{ "LD E,(IX+$)" , 19 , 0 } /* 5E */, +{ NULL , 0 , 0 } /* 5F */, +{ "LD IXH,B" , 8 , 0 } /* 60 */, +{ "LD IXH,C" , 8 , 0 } /* 61 */, +{ "LD IXH,D" , 8 , 0 } /* 62 */, +{ "LD IXH,E" , 8 , 0 } /* 63 */, +{ "LD IXH,IXH" , 8 , 0 } /* 64 */, +{ "LD IXH,IXL" , 8 , 0 } /* 65 */, +{ "LD H,(IX+$)" , 19 , 0 } /* 66 */, +{ "LD IXH,A" , 8 , 0 } /* 67 */, +{ "LD IXL,B" , 8 , 0 } /* 68 */, +{ "LD IXL,C" , 8 , 0 } /* 69 */, +{ "LD IXL,D" , 8 , 0 } /* 6A */, +{ "LD IXL,E" , 8 , 0 } /* 6B */, +{ "LD IXL,IXH" , 8 , 0 } /* 6C */, +{ "LD IXL,IXL" , 8 , 0 } /* 6D */, +{ "LD L,(IX+$)" , 19 , 0 } /* 6E */, +{ "LD IXL,A" , 8 , 0 } /* 6F */, +{ "LD (IX+$),B" , 19 , 0 } /* 70 */, +{ "LD (IX+$),C" , 19 , 0 } /* 71 */, +{ "LD (IX+$),D" , 19 , 0 } /* 72 */, +{ "LD (IX+$),E" , 19 , 0 } /* 73 */, +{ "LD (IX+$),H" , 19 , 0 } /* 74 */, +{ "LD (IX+$),L" , 19 , 0 } /* 75 */, +{ NULL , 0 , 0 } /* 76 */, +{ "LD (IX+$),A" , 19 , 0 } /* 77 */, +{ NULL , 0 , 0 } /* 78 */, +{ NULL , 0 , 0 } /* 79 */, +{ NULL , 0 , 0 } /* 7A */, +{ NULL , 0 , 0 } /* 7B */, +{ "LD A,IXH" , 8 , 0 } /* 7C */, +{ "LD A,IXL" , 8 , 0 } /* 7D */, +{ "LD A,(IX+$)" , 19 , 0 } /* 7E */, +{ NULL , 0 , 0 } /* 7F */, +{ NULL , 0 , 0 } /* 80 */, +{ NULL , 0 , 0 } /* 81 */, +{ NULL , 0 , 0 } /* 82 */, +{ NULL , 0 , 0 } /* 83 */, +{ "ADD A,IXH" , 8 , 0 } /* 84 */, +{ "ADD A,IXL" , 8 , 0 } /* 85 */, +{ "ADD A,(IX+$)" , 19 , 0 } /* 86 */, +{ NULL , 0 , 0 } /* 87 */, +{ NULL , 0 , 0 } /* 88 */, +{ NULL , 0 , 0 } /* 89 */, +{ NULL , 0 , 0 } /* 8A */, +{ NULL , 0 , 0 } /* 8B */, +{ "ADC A,IXH" , 8 , 0 } /* 8C */, +{ "ADC A,IXL" , 8 , 0 } /* 8D */, +{ "ADC A,(IX+$)" , 19 , 0 } /* 8E */, +{ NULL , 0 , 0 } /* 8F */, +{ NULL , 0 , 0 } /* 90 */, +{ NULL , 0 , 0 } /* 91 */, +{ NULL , 0 , 0 } /* 92 */, +{ NULL , 0 , 0 } /* 93 */, +{ "SUB IXH" , 8 , 0 } /* 94 */, +{ "SUB IXL" , 8 , 0 } /* 95 */, +{ "SUB (IX+$)" , 19 , 0 } /* 96 */, +{ NULL , 0 , 0 } /* 97 */, +{ NULL , 0 , 0 } /* 98 */, +{ NULL , 0 , 0 } /* 99 */, +{ NULL , 0 , 0 } /* 9A */, +{ NULL , 0 , 0 } /* 9B */, +{ "SBC A,IXH" , 8 , 0 } /* 9C */, +{ "SBC A,IXL" , 8 , 0 } /* 9D */, +{ "SBC A,(IX+$)" , 19 , 0 } /* 9E */, +{ NULL , 0 , 0 } /* 9F */, +{ NULL , 0 , 0 } /* A0 */, +{ NULL , 0 , 0 } /* A1 */, +{ NULL , 0 , 0 } /* A2 */, +{ NULL , 0 , 0 } /* A3 */, +{ "AND IXH" , 8 , 0 } /* A4 */, +{ "AND IXL" , 8 , 0 } /* A5 */, +{ "AND (IX+$)" , 19 , 0 } /* A6 */, +{ NULL , 0 , 0 } /* A7 */, +{ NULL , 0 , 0 } /* A8 */, +{ NULL , 0 , 0 } /* A9 */, +{ NULL , 0 , 0 } /* AA */, +{ NULL , 0 , 0 } /* AB */, +{ "XOR IXH" , 8 , 0 } /* AC */, +{ "XOR IXL" , 8 , 0 } /* AD */, +{ "XOR (IX+$)" , 19 , 0 } /* AE */, +{ NULL , 0 , 0 } /* AF */, +{ NULL , 0 , 0 } /* B0 */, +{ NULL , 0 , 0 } /* B1 */, +{ NULL , 0 , 0 } /* B2 */, +{ NULL , 0 , 0 } /* B3 */, +{ "OR IXH" , 8 , 0 } /* B4 */, +{ "OR IXL" , 8 , 0 } /* B5 */, +{ "OR (IX+$)" , 19 , 0 } /* B6 */, +{ NULL , 0 , 0 } /* B7 */, +{ NULL , 0 , 0 } /* B8 */, +{ NULL , 0 , 0 } /* B9 */, +{ NULL , 0 , 0 } /* BA */, +{ NULL , 0 , 0 } /* BB */, +{ "CP IXH" , 8 , 0 } /* BC */, +{ "CP IXL" , 8 , 0 } /* BD */, +{ "CP (IX+$)" , 19 , 0 } /* BE */, +{ NULL , 0 , 0 } /* BF */, +{ NULL , 0 , 0 } /* C0 */, +{ NULL , 0 , 0 } /* C1 */, +{ NULL , 0 , 0 } /* C2 */, +{ NULL , 0 , 0 } /* C3 */, +{ NULL , 0 , 0 } /* C4 */, +{ NULL , 0 , 0 } /* C5 */, +{ NULL , 0 , 0 } /* C6 */, +{ NULL , 0 , 0 } /* C7 */, +{ NULL , 0 , 0 } /* C8 */, +{ NULL , 0 , 0 } /* C9 */, +{ NULL , 0 , 0 } /* CA */, +{ "shift CB" , 0 , 0 } /* CB */, +{ NULL , 0 , 0 } /* CC */, +{ NULL , 0 , 0 } /* CD */, +{ NULL , 0 , 0 } /* CE */, +{ NULL , 0 , 0 } /* CF */, +{ NULL , 0 , 0 } /* D0 */, +{ NULL , 0 , 0 } /* D1 */, +{ NULL , 0 , 0 } /* D2 */, +{ NULL , 0 , 0 } /* D3 */, +{ NULL , 0 , 0 } /* D4 */, +{ NULL , 0 , 0 } /* D5 */, +{ NULL , 0 , 0 } /* D6 */, +{ NULL , 0 , 0 } /* D7 */, +{ NULL , 0 , 0 } /* D8 */, +{ NULL , 0 , 0 } /* D9 */, +{ NULL , 0 , 0 } /* DA */, +{ NULL , 0 , 0 } /* DB */, +{ NULL , 0 , 0 } /* DC */, +{ "ignore" , 4 , 0 } /* DD */, +{ NULL , 0 , 0 } /* DE */, +{ NULL , 0 , 0 } /* DF */, +{ NULL , 0 , 0 } /* E0 */, +{ "POP IX" , 14 , 0 } /* E1 */, +{ NULL , 0 , 0 } /* E2 */, +{ "EX (SP),IX" , 23 , 0 } /* E3 */, +{ NULL , 0 , 0 } /* E4 */, +{ "PUSH IX" , 15 , 0 } /* E5 */, +{ NULL , 0 , 0 } /* E6 */, +{ NULL , 0 , 0 } /* E7 */, +{ NULL , 0 , 0 } /* E8 */, +{ "JP IX" , 8 , 0 } /* E9 */, +{ NULL , 0 , 0 } /* EA */, +{ NULL , 0 , 0 } /* EB */, +{ NULL , 0 , 0 } /* EC */, +{ NULL , 4 , 0 } /* ED */, +{ NULL , 0 , 0 } /* EE */, +{ NULL , 0 , 0 } /* EF */, +{ NULL , 0 , 0 } /* F0 */, +{ NULL , 0 , 0 } /* F1 */, +{ NULL , 0 , 0 } /* F2 */, +{ NULL , 0 , 0 } /* F3 */, +{ NULL , 0 , 0 } /* F4 */, +{ NULL , 0 , 0 } /* F5 */, +{ NULL , 0 , 0 } /* F6 */, +{ NULL , 0 , 0 } /* F7 */, +{ NULL , 0 , 0 } /* F8 */, +{ "LD SP,IX" , 10 , 0 } /* F9 */, +{ NULL , 0 , 0 } /* FA */, +{ NULL , 0 , 0 } /* FB */, +{ NULL , 0 , 0 } /* FC */, +{ "ignore" , 4 , 0 } /* FD */, +{ NULL , 0 , 0 } /* FE */, +{ NULL , 0 , 0 } /* FF */ + +}; + + +/**/ +static const z80ex_opc_dasm dasm_fd[0x100] = { +{ NULL , 0 , 0 } /* 00 */, +{ NULL , 0 , 0 } /* 01 */, +{ NULL , 0 , 0 } /* 02 */, +{ NULL , 0 , 0 } /* 03 */, +{ NULL , 0 , 0 } /* 04 */, +{ NULL , 0 , 0 } /* 05 */, +{ NULL , 0 , 0 } /* 06 */, +{ NULL , 0 , 0 } /* 07 */, +{ NULL , 0 , 0 } /* 08 */, +{ "ADD IY,BC" , 15 , 0 } /* 09 */, +{ NULL , 0 , 0 } /* 0A */, +{ NULL , 0 , 0 } /* 0B */, +{ NULL , 0 , 0 } /* 0C */, +{ NULL , 0 , 0 } /* 0D */, +{ NULL , 0 , 0 } /* 0E */, +{ NULL , 0 , 0 } /* 0F */, +{ NULL , 0 , 0 } /* 10 */, +{ NULL , 0 , 0 } /* 11 */, +{ NULL , 0 , 0 } /* 12 */, +{ NULL , 0 , 0 } /* 13 */, +{ NULL , 0 , 0 } /* 14 */, +{ NULL , 0 , 0 } /* 15 */, +{ NULL , 0 , 0 } /* 16 */, +{ NULL , 0 , 0 } /* 17 */, +{ NULL , 0 , 0 } /* 18 */, +{ "ADD IY,DE" , 15 , 0 } /* 19 */, +{ NULL , 0 , 0 } /* 1A */, +{ NULL , 0 , 0 } /* 1B */, +{ NULL , 0 , 0 } /* 1C */, +{ NULL , 0 , 0 } /* 1D */, +{ NULL , 0 , 0 } /* 1E */, +{ NULL , 0 , 0 } /* 1F */, +{ NULL , 0 , 0 } /* 20 */, +{ "LD IY,@" , 14 , 0 } /* 21 */, +{ "LD (@),IY" , 20 , 0 } /* 22 */, +{ "INC IY" , 10 , 0 } /* 23 */, +{ "INC IYH" , 8 , 0 } /* 24 */, +{ "DEC IYH" , 8 , 0 } /* 25 */, +{ "LD IYH,#" , 11 , 0 } /* 26 */, +{ NULL , 0 , 0 } /* 27 */, +{ NULL , 0 , 0 } /* 28 */, +{ "ADD IY,IY" , 15 , 0 } /* 29 */, +{ "LD IY,(@)" , 20 , 0 } /* 2A */, +{ "DEC IY" , 10 , 0 } /* 2B */, +{ "INC IYL" , 8 , 0 } /* 2C */, +{ "DEC IYL" , 8 , 0 } /* 2D */, +{ "LD IYL,#" , 11 , 0 } /* 2E */, +{ NULL , 0 , 0 } /* 2F */, +{ NULL , 0 , 0 } /* 30 */, +{ NULL , 0 , 0 } /* 31 */, +{ NULL , 0 , 0 } /* 32 */, +{ NULL , 0 , 0 } /* 33 */, +{ "INC (IY+$)" , 23 , 0 } /* 34 */, +{ "DEC (IY+$)" , 23 , 0 } /* 35 */, +{ "LD (IY+$),#" , 19 , 0 } /* 36 */, +{ NULL , 0 , 0 } /* 37 */, +{ NULL , 0 , 0 } /* 38 */, +{ "ADD IY,SP" , 15 , 0 } /* 39 */, +{ NULL , 0 , 0 } /* 3A */, +{ NULL , 0 , 0 } /* 3B */, +{ NULL , 0 , 0 } /* 3C */, +{ NULL , 0 , 0 } /* 3D */, +{ NULL , 0 , 0 } /* 3E */, +{ NULL , 0 , 0 } /* 3F */, +{ NULL , 0 , 0 } /* 40 */, +{ NULL , 0 , 0 } /* 41 */, +{ NULL , 0 , 0 } /* 42 */, +{ NULL , 0 , 0 } /* 43 */, +{ "LD B,IYH" , 8 , 0 } /* 44 */, +{ "LD B,IYL" , 8 , 0 } /* 45 */, +{ "LD B,(IY+$)" , 19 , 0 } /* 46 */, +{ NULL , 0 , 0 } /* 47 */, +{ NULL , 0 , 0 } /* 48 */, +{ NULL , 0 , 0 } /* 49 */, +{ NULL , 0 , 0 } /* 4A */, +{ NULL , 0 , 0 } /* 4B */, +{ "LD C,IYH" , 8 , 0 } /* 4C */, +{ "LD C,IYL" , 8 , 0 } /* 4D */, +{ "LD C,(IY+$)" , 19 , 0 } /* 4E */, +{ NULL , 0 , 0 } /* 4F */, +{ NULL , 0 , 0 } /* 50 */, +{ NULL , 0 , 0 } /* 51 */, +{ NULL , 0 , 0 } /* 52 */, +{ NULL , 0 , 0 } /* 53 */, +{ "LD D,IYH" , 8 , 0 } /* 54 */, +{ "LD D,IYL" , 8 , 0 } /* 55 */, +{ "LD D,(IY+$)" , 19 , 0 } /* 56 */, +{ NULL , 0 , 0 } /* 57 */, +{ NULL , 0 , 0 } /* 58 */, +{ NULL , 0 , 0 } /* 59 */, +{ NULL , 0 , 0 } /* 5A */, +{ NULL , 0 , 0 } /* 5B */, +{ "LD E,IYH" , 8 , 0 } /* 5C */, +{ "LD E,IYL" , 8 , 0 } /* 5D */, +{ "LD E,(IY+$)" , 19 , 0 } /* 5E */, +{ NULL , 0 , 0 } /* 5F */, +{ "LD IYH,B" , 8 , 0 } /* 60 */, +{ "LD IYH,C" , 8 , 0 } /* 61 */, +{ "LD IYH,D" , 8 , 0 } /* 62 */, +{ "LD IYH,E" , 8 , 0 } /* 63 */, +{ "LD IYH,IYH" , 8 , 0 } /* 64 */, +{ "LD IYH,IYL" , 8 , 0 } /* 65 */, +{ "LD H,(IY+$)" , 19 , 0 } /* 66 */, +{ "LD IYH,A" , 8 , 0 } /* 67 */, +{ "LD IYL,B" , 8 , 0 } /* 68 */, +{ "LD IYL,C" , 8 , 0 } /* 69 */, +{ "LD IYL,D" , 8 , 0 } /* 6A */, +{ "LD IYL,E" , 8 , 0 } /* 6B */, +{ "LD IYL,IYH" , 8 , 0 } /* 6C */, +{ "LD IYL,IYL" , 8 , 0 } /* 6D */, +{ "LD L,(IY+$)" , 19 , 0 } /* 6E */, +{ "LD IYL,A" , 8 , 0 } /* 6F */, +{ "LD (IY+$),B" , 19 , 0 } /* 70 */, +{ "LD (IY+$),C" , 19 , 0 } /* 71 */, +{ "LD (IY+$),D" , 19 , 0 } /* 72 */, +{ "LD (IY+$),E" , 19 , 0 } /* 73 */, +{ "LD (IY+$),H" , 19 , 0 } /* 74 */, +{ "LD (IY+$),L" , 19 , 0 } /* 75 */, +{ NULL , 0 , 0 } /* 76 */, +{ "LD (IY+$),A" , 19 , 0 } /* 77 */, +{ NULL , 0 , 0 } /* 78 */, +{ NULL , 0 , 0 } /* 79 */, +{ NULL , 0 , 0 } /* 7A */, +{ NULL , 0 , 0 } /* 7B */, +{ "LD A,IYH" , 8 , 0 } /* 7C */, +{ "LD A,IYL" , 8 , 0 } /* 7D */, +{ "LD A,(IY+$)" , 19 , 0 } /* 7E */, +{ NULL , 0 , 0 } /* 7F */, +{ NULL , 0 , 0 } /* 80 */, +{ NULL , 0 , 0 } /* 81 */, +{ NULL , 0 , 0 } /* 82 */, +{ NULL , 0 , 0 } /* 83 */, +{ "ADD A,IYH" , 8 , 0 } /* 84 */, +{ "ADD A,IYL" , 8 , 0 } /* 85 */, +{ "ADD A,(IY+$)" , 19 , 0 } /* 86 */, +{ NULL , 0 , 0 } /* 87 */, +{ NULL , 0 , 0 } /* 88 */, +{ NULL , 0 , 0 } /* 89 */, +{ NULL , 0 , 0 } /* 8A */, +{ NULL , 0 , 0 } /* 8B */, +{ "ADC A,IYH" , 8 , 0 } /* 8C */, +{ "ADC A,IYL" , 8 , 0 } /* 8D */, +{ "ADC A,(IY+$)" , 19 , 0 } /* 8E */, +{ NULL , 0 , 0 } /* 8F */, +{ NULL , 0 , 0 } /* 90 */, +{ NULL , 0 , 0 } /* 91 */, +{ NULL , 0 , 0 } /* 92 */, +{ NULL , 0 , 0 } /* 93 */, +{ "SUB IYH" , 8 , 0 } /* 94 */, +{ "SUB IYL" , 8 , 0 } /* 95 */, +{ "SUB (IY+$)" , 19 , 0 } /* 96 */, +{ NULL , 0 , 0 } /* 97 */, +{ NULL , 0 , 0 } /* 98 */, +{ NULL , 0 , 0 } /* 99 */, +{ NULL , 0 , 0 } /* 9A */, +{ NULL , 0 , 0 } /* 9B */, +{ "SBC A,IYH" , 8 , 0 } /* 9C */, +{ "SBC A,IYL" , 8 , 0 } /* 9D */, +{ "SBC A,(IY+$)" , 19 , 0 } /* 9E */, +{ NULL , 0 , 0 } /* 9F */, +{ NULL , 0 , 0 } /* A0 */, +{ NULL , 0 , 0 } /* A1 */, +{ NULL , 0 , 0 } /* A2 */, +{ NULL , 0 , 0 } /* A3 */, +{ "AND IYH" , 8 , 0 } /* A4 */, +{ "AND IYL" , 8 , 0 } /* A5 */, +{ "AND (IY+$)" , 19 , 0 } /* A6 */, +{ NULL , 0 , 0 } /* A7 */, +{ NULL , 0 , 0 } /* A8 */, +{ NULL , 0 , 0 } /* A9 */, +{ NULL , 0 , 0 } /* AA */, +{ NULL , 0 , 0 } /* AB */, +{ "XOR IYH" , 8 , 0 } /* AC */, +{ "XOR IYL" , 8 , 0 } /* AD */, +{ "XOR (IY+$)" , 19 , 0 } /* AE */, +{ NULL , 0 , 0 } /* AF */, +{ NULL , 0 , 0 } /* B0 */, +{ NULL , 0 , 0 } /* B1 */, +{ NULL , 0 , 0 } /* B2 */, +{ NULL , 0 , 0 } /* B3 */, +{ "OR IYH" , 8 , 0 } /* B4 */, +{ "OR IYL" , 8 , 0 } /* B5 */, +{ "OR (IY+$)" , 19 , 0 } /* B6 */, +{ NULL , 0 , 0 } /* B7 */, +{ NULL , 0 , 0 } /* B8 */, +{ NULL , 0 , 0 } /* B9 */, +{ NULL , 0 , 0 } /* BA */, +{ NULL , 0 , 0 } /* BB */, +{ "CP IYH" , 8 , 0 } /* BC */, +{ "CP IYL" , 8 , 0 } /* BD */, +{ "CP (IY+$)" , 19 , 0 } /* BE */, +{ NULL , 0 , 0 } /* BF */, +{ NULL , 0 , 0 } /* C0 */, +{ NULL , 0 , 0 } /* C1 */, +{ NULL , 0 , 0 } /* C2 */, +{ NULL , 0 , 0 } /* C3 */, +{ NULL , 0 , 0 } /* C4 */, +{ NULL , 0 , 0 } /* C5 */, +{ NULL , 0 , 0 } /* C6 */, +{ NULL , 0 , 0 } /* C7 */, +{ NULL , 0 , 0 } /* C8 */, +{ NULL , 0 , 0 } /* C9 */, +{ NULL , 0 , 0 } /* CA */, +{ "shift CB" , 0 , 0 } /* CB */, +{ NULL , 0 , 0 } /* CC */, +{ NULL , 0 , 0 } /* CD */, +{ NULL , 0 , 0 } /* CE */, +{ NULL , 0 , 0 } /* CF */, +{ NULL , 0 , 0 } /* D0 */, +{ NULL , 0 , 0 } /* D1 */, +{ NULL , 0 , 0 } /* D2 */, +{ NULL , 0 , 0 } /* D3 */, +{ NULL , 0 , 0 } /* D4 */, +{ NULL , 0 , 0 } /* D5 */, +{ NULL , 0 , 0 } /* D6 */, +{ NULL , 0 , 0 } /* D7 */, +{ NULL , 0 , 0 } /* D8 */, +{ NULL , 0 , 0 } /* D9 */, +{ NULL , 0 , 0 } /* DA */, +{ NULL , 0 , 0 } /* DB */, +{ NULL , 0 , 0 } /* DC */, +{ "ignore" , 4 , 0 } /* DD */, +{ NULL , 0 , 0 } /* DE */, +{ NULL , 0 , 0 } /* DF */, +{ NULL , 0 , 0 } /* E0 */, +{ "POP IY" , 14 , 0 } /* E1 */, +{ NULL , 0 , 0 } /* E2 */, +{ "EX (SP),IY" , 23 , 0 } /* E3 */, +{ NULL , 0 , 0 } /* E4 */, +{ "PUSH IY" , 15 , 0 } /* E5 */, +{ NULL , 0 , 0 } /* E6 */, +{ NULL , 0 , 0 } /* E7 */, +{ NULL , 0 , 0 } /* E8 */, +{ "JP IY" , 8 , 0 } /* E9 */, +{ NULL , 0 , 0 } /* EA */, +{ NULL , 0 , 0 } /* EB */, +{ NULL , 0 , 0 } /* EC */, +{ NULL , 4 , 0 } /* ED */, +{ NULL , 0 , 0 } /* EE */, +{ NULL , 0 , 0 } /* EF */, +{ NULL , 0 , 0 } /* F0 */, +{ NULL , 0 , 0 } /* F1 */, +{ NULL , 0 , 0 } /* F2 */, +{ NULL , 0 , 0 } /* F3 */, +{ NULL , 0 , 0 } /* F4 */, +{ NULL , 0 , 0 } /* F5 */, +{ NULL , 0 , 0 } /* F6 */, +{ NULL , 0 , 0 } /* F7 */, +{ NULL , 0 , 0 } /* F8 */, +{ "LD SP,IY" , 10 , 0 } /* F9 */, +{ NULL , 0 , 0 } /* FA */, +{ NULL , 0 , 0 } /* FB */, +{ NULL , 0 , 0 } /* FC */, +{ "ignore" , 4 , 0 } /* FD */, +{ NULL , 0 , 0 } /* FE */, +{ NULL , 0 , 0 } /* FF */ + +}; + + +/**/ +static const z80ex_opc_dasm dasm_ddcb[0x100] = { +{ "LD B,RLC (IX+$)" , 23 , 0 } /* 00 */, +{ "LD C,RLC (IX+$)" , 23 , 0 } /* 01 */, +{ "LD D,RLC (IX+$)" , 23 , 0 } /* 02 */, +{ "LD E,RLC (IX+$)" , 23 , 0 } /* 03 */, +{ "LD H,RLC (IX+$)" , 23 , 0 } /* 04 */, +{ "LD L,RLC (IX+$)" , 23 , 0 } /* 05 */, +{ "RLC (IX+$)" , 23 , 0 } /* 06 */, +{ "LD A,RLC (IX+$)" , 23 , 0 } /* 07 */, +{ "LD B,RRC (IX+$)" , 23 , 0 } /* 08 */, +{ "LD C,RRC (IX+$)" , 23 , 0 } /* 09 */, +{ "LD D,RRC (IX+$)" , 23 , 0 } /* 0A */, +{ "LD E,RRC (IX+$)" , 23 , 0 } /* 0B */, +{ "LD H,RRC (IX+$)" , 23 , 0 } /* 0C */, +{ "LD L,RRC (IX+$)" , 23 , 0 } /* 0D */, +{ "RRC (IX+$)" , 23 , 0 } /* 0E */, +{ "LD A,RRC (IX+$)" , 23 , 0 } /* 0F */, +{ "LD B,RL (IX+$)" , 23 , 0 } /* 10 */, +{ "LD C,RL (IX+$)" , 23 , 0 } /* 11 */, +{ "LD D,RL (IX+$)" , 23 , 0 } /* 12 */, +{ "LD E,RL (IX+$)" , 23 , 0 } /* 13 */, +{ "LD H,RL (IX+$)" , 23 , 0 } /* 14 */, +{ "LD L,RL (IX+$)" , 23 , 0 } /* 15 */, +{ "RL (IX+$)" , 23 , 0 } /* 16 */, +{ "LD A,RL (IX+$)" , 23 , 0 } /* 17 */, +{ "LD B,RR (IX+$)" , 23 , 0 } /* 18 */, +{ "LD C,RR (IX+$)" , 23 , 0 } /* 19 */, +{ "LD D,RR (IX+$)" , 23 , 0 } /* 1A */, +{ "LD E,RR (IX+$)" , 23 , 0 } /* 1B */, +{ "LD H,RR (IX+$)" , 23 , 0 } /* 1C */, +{ "LD L,RR (IX+$)" , 23 , 0 } /* 1D */, +{ "RR (IX+$)" , 23 , 0 } /* 1E */, +{ "LD A,RR (IX+$)" , 23 , 0 } /* 1F */, +{ "LD B,SLA (IX+$)" , 23 , 0 } /* 20 */, +{ "LD C,SLA (IX+$)" , 23 , 0 } /* 21 */, +{ "LD D,SLA (IX+$)" , 23 , 0 } /* 22 */, +{ "LD E,SLA (IX+$)" , 23 , 0 } /* 23 */, +{ "LD H,SLA (IX+$)" , 23 , 0 } /* 24 */, +{ "LD L,SLA (IX+$)" , 23 , 0 } /* 25 */, +{ "SLA (IX+$)" , 23 , 0 } /* 26 */, +{ "LD A,SLA (IX+$)" , 23 , 0 } /* 27 */, +{ "LD B,SRA (IX+$)" , 23 , 0 } /* 28 */, +{ "LD C,SRA (IX+$)" , 23 , 0 } /* 29 */, +{ "LD D,SRA (IX+$)" , 23 , 0 } /* 2A */, +{ "LD E,SRA (IX+$)" , 23 , 0 } /* 2B */, +{ "LD H,SRA (IX+$)" , 23 , 0 } /* 2C */, +{ "LD L,SRA (IX+$)" , 23 , 0 } /* 2D */, +{ "SRA (IX+$)" , 23 , 0 } /* 2E */, +{ "LD A,SRA (IX+$)" , 23 , 0 } /* 2F */, +{ "LD B,SLL (IX+$)" , 23 , 0 } /* 30 */, +{ "LD C,SLL (IX+$)" , 23 , 0 } /* 31 */, +{ "LD D,SLL (IX+$)" , 23 , 0 } /* 32 */, +{ "LD E,SLL (IX+$)" , 23 , 0 } /* 33 */, +{ "LD H,SLL (IX+$)" , 23 , 0 } /* 34 */, +{ "LD L,SLL (IX+$)" , 23 , 0 } /* 35 */, +{ "SLL (IX+$)" , 23 , 0 } /* 36 */, +{ "LD A,SLL (IX+$)" , 23 , 0 } /* 37 */, +{ "LD B,SRL (IX+$)" , 23 , 0 } /* 38 */, +{ "LD C,SRL (IX+$)" , 23 , 0 } /* 39 */, +{ "LD D,SRL (IX+$)" , 23 , 0 } /* 3A */, +{ "LD E,SRL (IX+$)" , 23 , 0 } /* 3B */, +{ "LD H,SRL (IX+$)" , 23 , 0 } /* 3C */, +{ "LD L,SRL (IX+$)" , 23 , 0 } /* 3D */, +{ "SRL (IX+$)" , 23 , 0 } /* 3E */, +{ "LD A,SRL (IX+$)" , 23 , 0 } /* 3F */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 40 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 41 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 42 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 43 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 44 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 45 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 46 */, +{ "BIT 0,(IX+$)" , 20 , 0 } /* 47 */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 48 */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 49 */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 4A */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 4B */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 4C */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 4D */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 4E */, +{ "BIT 1,(IX+$)" , 20 , 0 } /* 4F */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 50 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 51 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 52 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 53 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 54 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 55 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 56 */, +{ "BIT 2,(IX+$)" , 20 , 0 } /* 57 */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 58 */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 59 */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 5A */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 5B */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 5C */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 5D */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 5E */, +{ "BIT 3,(IX+$)" , 20 , 0 } /* 5F */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 60 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 61 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 62 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 63 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 64 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 65 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 66 */, +{ "BIT 4,(IX+$)" , 20 , 0 } /* 67 */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 68 */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 69 */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 6A */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 6B */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 6C */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 6D */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 6E */, +{ "BIT 5,(IX+$)" , 20 , 0 } /* 6F */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 70 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 71 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 72 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 73 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 74 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 75 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 76 */, +{ "BIT 6,(IX+$)" , 20 , 0 } /* 77 */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 78 */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 79 */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 7A */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 7B */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 7C */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 7D */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 7E */, +{ "BIT 7,(IX+$)" , 20 , 0 } /* 7F */, +{ "LD B,RES 0,(IX+$)" , 23 , 0 } /* 80 */, +{ "LD C,RES 0,(IX+$)" , 23 , 0 } /* 81 */, +{ "LD D,RES 0,(IX+$)" , 23 , 0 } /* 82 */, +{ "LD E,RES 0,(IX+$)" , 23 , 0 } /* 83 */, +{ "LD H,RES 0,(IX+$)" , 23 , 0 } /* 84 */, +{ "LD L,RES 0,(IX+$)" , 23 , 0 } /* 85 */, +{ "RES 0,(IX+$)" , 23 , 0 } /* 86 */, +{ "LD A,RES 0,(IX+$)" , 23 , 0 } /* 87 */, +{ "LD B,RES 1,(IX+$)" , 23 , 0 } /* 88 */, +{ "LD C,RES 1,(IX+$)" , 23 , 0 } /* 89 */, +{ "LD D,RES 1,(IX+$)" , 23 , 0 } /* 8A */, +{ "LD E,RES 1,(IX+$)" , 23 , 0 } /* 8B */, +{ "LD H,RES 1,(IX+$)" , 23 , 0 } /* 8C */, +{ "LD L,RES 1,(IX+$)" , 23 , 0 } /* 8D */, +{ "RES 1,(IX+$)" , 23 , 0 } /* 8E */, +{ "LD A,RES 1,(IX+$)" , 23 , 0 } /* 8F */, +{ "LD B,RES 2,(IX+$)" , 23 , 0 } /* 90 */, +{ "LD C,RES 2,(IX+$)" , 23 , 0 } /* 91 */, +{ "LD D,RES 2,(IX+$)" , 23 , 0 } /* 92 */, +{ "LD E,RES 2,(IX+$)" , 23 , 0 } /* 93 */, +{ "LD H,RES 2,(IX+$)" , 23 , 0 } /* 94 */, +{ "LD L,RES 2,(IX+$)" , 23 , 0 } /* 95 */, +{ "RES 2,(IX+$)" , 23 , 0 } /* 96 */, +{ "LD A,RES 2,(IX+$)" , 23 , 0 } /* 97 */, +{ "LD B,RES 3,(IX+$)" , 23 , 0 } /* 98 */, +{ "LD C,RES 3,(IX+$)" , 23 , 0 } /* 99 */, +{ "LD D,RES 3,(IX+$)" , 23 , 0 } /* 9A */, +{ "LD E,RES 3,(IX+$)" , 23 , 0 } /* 9B */, +{ "LD H,RES 3,(IX+$)" , 23 , 0 } /* 9C */, +{ "LD L,RES 3,(IX+$)" , 23 , 0 } /* 9D */, +{ "RES 3,(IX+$)" , 23 , 0 } /* 9E */, +{ "LD A,RES 3,(IX+$)" , 23 , 0 } /* 9F */, +{ "LD B,RES 4,(IX+$)" , 23 , 0 } /* A0 */, +{ "LD C,RES 4,(IX+$)" , 23 , 0 } /* A1 */, +{ "LD D,RES 4,(IX+$)" , 23 , 0 } /* A2 */, +{ "LD E,RES 4,(IX+$)" , 23 , 0 } /* A3 */, +{ "LD H,RES 4,(IX+$)" , 23 , 0 } /* A4 */, +{ "LD L,RES 4,(IX+$)" , 23 , 0 } /* A5 */, +{ "RES 4,(IX+$)" , 23 , 0 } /* A6 */, +{ "LD A,RES 4,(IX+$)" , 23 , 0 } /* A7 */, +{ "LD B,RES 5,(IX+$)" , 23 , 0 } /* A8 */, +{ "LD C,RES 5,(IX+$)" , 23 , 0 } /* A9 */, +{ "LD D,RES 5,(IX+$)" , 23 , 0 } /* AA */, +{ "LD E,RES 5,(IX+$)" , 23 , 0 } /* AB */, +{ "LD H,RES 5,(IX+$)" , 23 , 0 } /* AC */, +{ "LD L,RES 5,(IX+$)" , 23 , 0 } /* AD */, +{ "RES 5,(IX+$)" , 23 , 0 } /* AE */, +{ "LD A,RES 5,(IX+$)" , 23 , 0 } /* AF */, +{ "LD B,RES 6,(IX+$)" , 23 , 0 } /* B0 */, +{ "LD C,RES 6,(IX+$)" , 23 , 0 } /* B1 */, +{ "LD D,RES 6,(IX+$)" , 23 , 0 } /* B2 */, +{ "LD E,RES 6,(IX+$)" , 23 , 0 } /* B3 */, +{ "LD H,RES 6,(IX+$)" , 23 , 0 } /* B4 */, +{ "LD L,RES 6,(IX+$)" , 23 , 0 } /* B5 */, +{ "RES 6,(IX+$)" , 23 , 0 } /* B6 */, +{ "LD A,RES 6,(IX+$)" , 23 , 0 } /* B7 */, +{ "LD B,RES 7,(IX+$)" , 23 , 0 } /* B8 */, +{ "LD C,RES 7,(IX+$)" , 23 , 0 } /* B9 */, +{ "LD D,RES 7,(IX+$)" , 23 , 0 } /* BA */, +{ "LD E,RES 7,(IX+$)" , 23 , 0 } /* BB */, +{ "LD H,RES 7,(IX+$)" , 23 , 0 } /* BC */, +{ "LD L,RES 7,(IX+$)" , 23 , 0 } /* BD */, +{ "RES 7,(IX+$)" , 23 , 0 } /* BE */, +{ "LD A,RES 7,(IX+$)" , 23 , 0 } /* BF */, +{ "LD B,SET 0,(IX+$)" , 23 , 0 } /* C0 */, +{ "LD C,SET 0,(IX+$)" , 23 , 0 } /* C1 */, +{ "LD D,SET 0,(IX+$)" , 23 , 0 } /* C2 */, +{ "LD E,SET 0,(IX+$)" , 23 , 0 } /* C3 */, +{ "LD H,SET 0,(IX+$)" , 23 , 0 } /* C4 */, +{ "LD L,SET 0,(IX+$)" , 23 , 0 } /* C5 */, +{ "SET 0,(IX+$)" , 23 , 0 } /* C6 */, +{ "LD A,SET 0,(IX+$)" , 23 , 0 } /* C7 */, +{ "LD B,SET 1,(IX+$)" , 23 , 0 } /* C8 */, +{ "LD C,SET 1,(IX+$)" , 23 , 0 } /* C9 */, +{ "LD D,SET 1,(IX+$)" , 23 , 0 } /* CA */, +{ "LD E,SET 1,(IX+$)" , 23 , 0 } /* CB */, +{ "LD H,SET 1,(IX+$)" , 23 , 0 } /* CC */, +{ "LD L,SET 1,(IX+$)" , 23 , 0 } /* CD */, +{ "SET 1,(IX+$)" , 23 , 0 } /* CE */, +{ "LD A,SET 1,(IX+$)" , 23 , 0 } /* CF */, +{ "LD B,SET 2,(IX+$)" , 23 , 0 } /* D0 */, +{ "LD C,SET 2,(IX+$)" , 23 , 0 } /* D1 */, +{ "LD D,SET 2,(IX+$)" , 23 , 0 } /* D2 */, +{ "LD E,SET 2,(IX+$)" , 23 , 0 } /* D3 */, +{ "LD H,SET 2,(IX+$)" , 23 , 0 } /* D4 */, +{ "LD L,SET 2,(IX+$)" , 23 , 0 } /* D5 */, +{ "SET 2,(IX+$)" , 23 , 0 } /* D6 */, +{ "LD A,SET 2,(IX+$)" , 23 , 0 } /* D7 */, +{ "LD B,SET 3,(IX+$)" , 23 , 0 } /* D8 */, +{ "LD C,SET 3,(IX+$)" , 23 , 0 } /* D9 */, +{ "LD D,SET 3,(IX+$)" , 23 , 0 } /* DA */, +{ "LD E,SET 3,(IX+$)" , 23 , 0 } /* DB */, +{ "LD H,SET 3,(IX+$)" , 23 , 0 } /* DC */, +{ "LD L,SET 3,(IX+$)" , 23 , 0 } /* DD */, +{ "SET 3,(IX+$)" , 23 , 0 } /* DE */, +{ "LD A,SET 3,(IX+$)" , 23 , 0 } /* DF */, +{ "LD B,SET 4,(IX+$)" , 23 , 0 } /* E0 */, +{ "LD C,SET 4,(IX+$)" , 23 , 0 } /* E1 */, +{ "LD D,SET 4,(IX+$)" , 23 , 0 } /* E2 */, +{ "LD E,SET 4,(IX+$)" , 23 , 0 } /* E3 */, +{ "LD H,SET 4,(IX+$)" , 23 , 0 } /* E4 */, +{ "LD L,SET 4,(IX+$)" , 23 , 0 } /* E5 */, +{ "SET 4,(IX+$)" , 23 , 0 } /* E6 */, +{ "LD A,SET 4,(IX+$)" , 23 , 0 } /* E7 */, +{ "LD B,SET 5,(IX+$)" , 23 , 0 } /* E8 */, +{ "LD C,SET 5,(IX+$)" , 23 , 0 } /* E9 */, +{ "LD D,SET 5,(IX+$)" , 23 , 0 } /* EA */, +{ "LD E,SET 5,(IX+$)" , 23 , 0 } /* EB */, +{ "LD H,SET 5,(IX+$)" , 23 , 0 } /* EC */, +{ "LD L,SET 5,(IX+$)" , 23 , 0 } /* ED */, +{ "SET 5,(IX+$)" , 23 , 0 } /* EE */, +{ "LD A,SET 5,(IX+$)" , 23 , 0 } /* EF */, +{ "LD B,SET 6,(IX+$)" , 23 , 0 } /* F0 */, +{ "LD C,SET 6,(IX+$)" , 23 , 0 } /* F1 */, +{ "LD D,SET 6,(IX+$)" , 23 , 0 } /* F2 */, +{ "LD E,SET 6,(IX+$)" , 23 , 0 } /* F3 */, +{ "LD H,SET 6,(IX+$)" , 23 , 0 } /* F4 */, +{ "LD L,SET 6,(IX+$)" , 23 , 0 } /* F5 */, +{ "SET 6,(IX+$)" , 23 , 0 } /* F6 */, +{ "LD A,SET 6,(IX+$)" , 23 , 0 } /* F7 */, +{ "LD B,SET 7,(IX+$)" , 23 , 0 } /* F8 */, +{ "LD C,SET 7,(IX+$)" , 23 , 0 } /* F9 */, +{ "LD D,SET 7,(IX+$)" , 23 , 0 } /* FA */, +{ "LD E,SET 7,(IX+$)" , 23 , 0 } /* FB */, +{ "LD H,SET 7,(IX+$)" , 23 , 0 } /* FC */, +{ "LD L,SET 7,(IX+$)" , 23 , 0 } /* FD */, +{ "SET 7,(IX+$)" , 23 , 0 } /* FE */, +{ "LD A,SET 7,(IX+$)" , 23 , 0 } /* FF */ + +}; + + +/**/ +static const z80ex_opc_dasm dasm_fdcb[0x100] = { +{ "LD B,RLC (IY+$)" , 23 , 0 } /* 00 */, +{ "LD C,RLC (IY+$)" , 23 , 0 } /* 01 */, +{ "LD D,RLC (IY+$)" , 23 , 0 } /* 02 */, +{ "LD E,RLC (IY+$)" , 23 , 0 } /* 03 */, +{ "LD H,RLC (IY+$)" , 23 , 0 } /* 04 */, +{ "LD L,RLC (IY+$)" , 23 , 0 } /* 05 */, +{ "RLC (IY+$)" , 23 , 0 } /* 06 */, +{ "LD A,RLC (IY+$)" , 23 , 0 } /* 07 */, +{ "LD B,RRC (IY+$)" , 23 , 0 } /* 08 */, +{ "LD C,RRC (IY+$)" , 23 , 0 } /* 09 */, +{ "LD D,RRC (IY+$)" , 23 , 0 } /* 0A */, +{ "LD E,RRC (IY+$)" , 23 , 0 } /* 0B */, +{ "LD H,RRC (IY+$)" , 23 , 0 } /* 0C */, +{ "LD L,RRC (IY+$)" , 23 , 0 } /* 0D */, +{ "RRC (IY+$)" , 23 , 0 } /* 0E */, +{ "LD A,RRC (IY+$)" , 23 , 0 } /* 0F */, +{ "LD B,RL (IY+$)" , 23 , 0 } /* 10 */, +{ "LD C,RL (IY+$)" , 23 , 0 } /* 11 */, +{ "LD D,RL (IY+$)" , 23 , 0 } /* 12 */, +{ "LD E,RL (IY+$)" , 23 , 0 } /* 13 */, +{ "LD H,RL (IY+$)" , 23 , 0 } /* 14 */, +{ "LD L,RL (IY+$)" , 23 , 0 } /* 15 */, +{ "RL (IY+$)" , 23 , 0 } /* 16 */, +{ "LD A,RL (IY+$)" , 23 , 0 } /* 17 */, +{ "LD B,RR (IY+$)" , 23 , 0 } /* 18 */, +{ "LD C,RR (IY+$)" , 23 , 0 } /* 19 */, +{ "LD D,RR (IY+$)" , 23 , 0 } /* 1A */, +{ "LD E,RR (IY+$)" , 23 , 0 } /* 1B */, +{ "LD H,RR (IY+$)" , 23 , 0 } /* 1C */, +{ "LD L,RR (IY+$)" , 23 , 0 } /* 1D */, +{ "RR (IY+$)" , 23 , 0 } /* 1E */, +{ "LD A,RR (IY+$)" , 23 , 0 } /* 1F */, +{ "LD B,SLA (IY+$)" , 23 , 0 } /* 20 */, +{ "LD C,SLA (IY+$)" , 23 , 0 } /* 21 */, +{ "LD D,SLA (IY+$)" , 23 , 0 } /* 22 */, +{ "LD E,SLA (IY+$)" , 23 , 0 } /* 23 */, +{ "LD H,SLA (IY+$)" , 23 , 0 } /* 24 */, +{ "LD L,SLA (IY+$)" , 23 , 0 } /* 25 */, +{ "SLA (IY+$)" , 23 , 0 } /* 26 */, +{ "LD A,SLA (IY+$)" , 23 , 0 } /* 27 */, +{ "LD B,SRA (IY+$)" , 23 , 0 } /* 28 */, +{ "LD C,SRA (IY+$)" , 23 , 0 } /* 29 */, +{ "LD D,SRA (IY+$)" , 23 , 0 } /* 2A */, +{ "LD E,SRA (IY+$)" , 23 , 0 } /* 2B */, +{ "LD H,SRA (IY+$)" , 23 , 0 } /* 2C */, +{ "LD L,SRA (IY+$)" , 23 , 0 } /* 2D */, +{ "SRA (IY+$)" , 23 , 0 } /* 2E */, +{ "LD A,SRA (IY+$)" , 23 , 0 } /* 2F */, +{ "LD B,SLL (IY+$)" , 23 , 0 } /* 30 */, +{ "LD C,SLL (IY+$)" , 23 , 0 } /* 31 */, +{ "LD D,SLL (IY+$)" , 23 , 0 } /* 32 */, +{ "LD E,SLL (IY+$)" , 23 , 0 } /* 33 */, +{ "LD H,SLL (IY+$)" , 23 , 0 } /* 34 */, +{ "LD L,SLL (IY+$)" , 23 , 0 } /* 35 */, +{ "SLL (IY+$)" , 23 , 0 } /* 36 */, +{ "LD A,SLL (IY+$)" , 23 , 0 } /* 37 */, +{ "LD B,SRL (IY+$)" , 23 , 0 } /* 38 */, +{ "LD C,SRL (IY+$)" , 23 , 0 } /* 39 */, +{ "LD D,SRL (IY+$)" , 23 , 0 } /* 3A */, +{ "LD E,SRL (IY+$)" , 23 , 0 } /* 3B */, +{ "LD H,SRL (IY+$)" , 23 , 0 } /* 3C */, +{ "LD L,SRL (IY+$)" , 23 , 0 } /* 3D */, +{ "SRL (IY+$)" , 23 , 0 } /* 3E */, +{ "LD A,SRL (IY+$)" , 23 , 0 } /* 3F */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 40 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 41 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 42 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 43 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 44 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 45 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 46 */, +{ "BIT 0,(IY+$)" , 20 , 0 } /* 47 */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 48 */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 49 */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 4A */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 4B */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 4C */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 4D */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 4E */, +{ "BIT 1,(IY+$)" , 20 , 0 } /* 4F */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 50 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 51 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 52 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 53 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 54 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 55 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 56 */, +{ "BIT 2,(IY+$)" , 20 , 0 } /* 57 */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 58 */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 59 */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 5A */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 5B */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 5C */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 5D */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 5E */, +{ "BIT 3,(IY+$)" , 20 , 0 } /* 5F */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 60 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 61 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 62 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 63 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 64 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 65 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 66 */, +{ "BIT 4,(IY+$)" , 20 , 0 } /* 67 */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 68 */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 69 */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 6A */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 6B */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 6C */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 6D */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 6E */, +{ "BIT 5,(IY+$)" , 20 , 0 } /* 6F */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 70 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 71 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 72 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 73 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 74 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 75 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 76 */, +{ "BIT 6,(IY+$)" , 20 , 0 } /* 77 */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 78 */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 79 */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 7A */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 7B */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 7C */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 7D */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 7E */, +{ "BIT 7,(IY+$)" , 20 , 0 } /* 7F */, +{ "LD B,RES 0,(IY+$)" , 23 , 0 } /* 80 */, +{ "LD C,RES 0,(IY+$)" , 23 , 0 } /* 81 */, +{ "LD D,RES 0,(IY+$)" , 23 , 0 } /* 82 */, +{ "LD E,RES 0,(IY+$)" , 23 , 0 } /* 83 */, +{ "LD H,RES 0,(IY+$)" , 23 , 0 } /* 84 */, +{ "LD L,RES 0,(IY+$)" , 23 , 0 } /* 85 */, +{ "RES 0,(IY+$)" , 23 , 0 } /* 86 */, +{ "LD A,RES 0,(IY+$)" , 23 , 0 } /* 87 */, +{ "LD B,RES 1,(IY+$)" , 23 , 0 } /* 88 */, +{ "LD C,RES 1,(IY+$)" , 23 , 0 } /* 89 */, +{ "LD D,RES 1,(IY+$)" , 23 , 0 } /* 8A */, +{ "LD E,RES 1,(IY+$)" , 23 , 0 } /* 8B */, +{ "LD H,RES 1,(IY+$)" , 23 , 0 } /* 8C */, +{ "LD L,RES 1,(IY+$)" , 23 , 0 } /* 8D */, +{ "RES 1,(IY+$)" , 23 , 0 } /* 8E */, +{ "LD A,RES 1,(IY+$)" , 23 , 0 } /* 8F */, +{ "LD B,RES 2,(IY+$)" , 23 , 0 } /* 90 */, +{ "LD C,RES 2,(IY+$)" , 23 , 0 } /* 91 */, +{ "LD D,RES 2,(IY+$)" , 23 , 0 } /* 92 */, +{ "LD E,RES 2,(IY+$)" , 23 , 0 } /* 93 */, +{ "LD H,RES 2,(IY+$)" , 23 , 0 } /* 94 */, +{ "LD L,RES 2,(IY+$)" , 23 , 0 } /* 95 */, +{ "RES 2,(IY+$)" , 23 , 0 } /* 96 */, +{ "LD A,RES 2,(IY+$)" , 23 , 0 } /* 97 */, +{ "LD B,RES 3,(IY+$)" , 23 , 0 } /* 98 */, +{ "LD C,RES 3,(IY+$)" , 23 , 0 } /* 99 */, +{ "LD D,RES 3,(IY+$)" , 23 , 0 } /* 9A */, +{ "LD E,RES 3,(IY+$)" , 23 , 0 } /* 9B */, +{ "LD H,RES 3,(IY+$)" , 23 , 0 } /* 9C */, +{ "LD L,RES 3,(IY+$)" , 23 , 0 } /* 9D */, +{ "RES 3,(IY+$)" , 23 , 0 } /* 9E */, +{ "LD A,RES 3,(IY+$)" , 23 , 0 } /* 9F */, +{ "LD B,RES 4,(IY+$)" , 23 , 0 } /* A0 */, +{ "LD C,RES 4,(IY+$)" , 23 , 0 } /* A1 */, +{ "LD D,RES 4,(IY+$)" , 23 , 0 } /* A2 */, +{ "LD E,RES 4,(IY+$)" , 23 , 0 } /* A3 */, +{ "LD H,RES 4,(IY+$)" , 23 , 0 } /* A4 */, +{ "LD L,RES 4,(IY+$)" , 23 , 0 } /* A5 */, +{ "RES 4,(IY+$)" , 23 , 0 } /* A6 */, +{ "LD A,RES 4,(IY+$)" , 23 , 0 } /* A7 */, +{ "LD B,RES 5,(IY+$)" , 23 , 0 } /* A8 */, +{ "LD C,RES 5,(IY+$)" , 23 , 0 } /* A9 */, +{ "LD D,RES 5,(IY+$)" , 23 , 0 } /* AA */, +{ "LD E,RES 5,(IY+$)" , 23 , 0 } /* AB */, +{ "LD H,RES 5,(IY+$)" , 23 , 0 } /* AC */, +{ "LD L,RES 5,(IY+$)" , 23 , 0 } /* AD */, +{ "RES 5,(IY+$)" , 23 , 0 } /* AE */, +{ "LD A,RES 5,(IY+$)" , 23 , 0 } /* AF */, +{ "LD B,RES 6,(IY+$)" , 23 , 0 } /* B0 */, +{ "LD C,RES 6,(IY+$)" , 23 , 0 } /* B1 */, +{ "LD D,RES 6,(IY+$)" , 23 , 0 } /* B2 */, +{ "LD E,RES 6,(IY+$)" , 23 , 0 } /* B3 */, +{ "LD H,RES 6,(IY+$)" , 23 , 0 } /* B4 */, +{ "LD L,RES 6,(IY+$)" , 23 , 0 } /* B5 */, +{ "RES 6,(IY+$)" , 23 , 0 } /* B6 */, +{ "LD A,RES 6,(IY+$)" , 23 , 0 } /* B7 */, +{ "LD B,RES 7,(IY+$)" , 23 , 0 } /* B8 */, +{ "LD C,RES 7,(IY+$)" , 23 , 0 } /* B9 */, +{ "LD D,RES 7,(IY+$)" , 23 , 0 } /* BA */, +{ "LD E,RES 7,(IY+$)" , 23 , 0 } /* BB */, +{ "LD H,RES 7,(IY+$)" , 23 , 0 } /* BC */, +{ "LD L,RES 7,(IY+$)" , 23 , 0 } /* BD */, +{ "RES 7,(IY+$)" , 23 , 0 } /* BE */, +{ "LD A,RES 7,(IY+$)" , 23 , 0 } /* BF */, +{ "LD B,SET 0,(IY+$)" , 23 , 0 } /* C0 */, +{ "LD C,SET 0,(IY+$)" , 23 , 0 } /* C1 */, +{ "LD D,SET 0,(IY+$)" , 23 , 0 } /* C2 */, +{ "LD E,SET 0,(IY+$)" , 23 , 0 } /* C3 */, +{ "LD H,SET 0,(IY+$)" , 23 , 0 } /* C4 */, +{ "LD L,SET 0,(IY+$)" , 23 , 0 } /* C5 */, +{ "SET 0,(IY+$)" , 23 , 0 } /* C6 */, +{ "LD A,SET 0,(IY+$)" , 23 , 0 } /* C7 */, +{ "LD B,SET 1,(IY+$)" , 23 , 0 } /* C8 */, +{ "LD C,SET 1,(IY+$)" , 23 , 0 } /* C9 */, +{ "LD D,SET 1,(IY+$)" , 23 , 0 } /* CA */, +{ "LD E,SET 1,(IY+$)" , 23 , 0 } /* CB */, +{ "LD H,SET 1,(IY+$)" , 23 , 0 } /* CC */, +{ "LD L,SET 1,(IY+$)" , 23 , 0 } /* CD */, +{ "SET 1,(IY+$)" , 23 , 0 } /* CE */, +{ "LD A,SET 1,(IY+$)" , 23 , 0 } /* CF */, +{ "LD B,SET 2,(IY+$)" , 23 , 0 } /* D0 */, +{ "LD C,SET 2,(IY+$)" , 23 , 0 } /* D1 */, +{ "LD D,SET 2,(IY+$)" , 23 , 0 } /* D2 */, +{ "LD E,SET 2,(IY+$)" , 23 , 0 } /* D3 */, +{ "LD H,SET 2,(IY+$)" , 23 , 0 } /* D4 */, +{ "LD L,SET 2,(IY+$)" , 23 , 0 } /* D5 */, +{ "SET 2,(IY+$)" , 23 , 0 } /* D6 */, +{ "LD A,SET 2,(IY+$)" , 23 , 0 } /* D7 */, +{ "LD B,SET 3,(IY+$)" , 23 , 0 } /* D8 */, +{ "LD C,SET 3,(IY+$)" , 23 , 0 } /* D9 */, +{ "LD D,SET 3,(IY+$)" , 23 , 0 } /* DA */, +{ "LD E,SET 3,(IY+$)" , 23 , 0 } /* DB */, +{ "LD H,SET 3,(IY+$)" , 23 , 0 } /* DC */, +{ "LD L,SET 3,(IY+$)" , 23 , 0 } /* DD */, +{ "SET 3,(IY+$)" , 23 , 0 } /* DE */, +{ "LD A,SET 3,(IY+$)" , 23 , 0 } /* DF */, +{ "LD B,SET 4,(IY+$)" , 23 , 0 } /* E0 */, +{ "LD C,SET 4,(IY+$)" , 23 , 0 } /* E1 */, +{ "LD D,SET 4,(IY+$)" , 23 , 0 } /* E2 */, +{ "LD E,SET 4,(IY+$)" , 23 , 0 } /* E3 */, +{ "LD H,SET 4,(IY+$)" , 23 , 0 } /* E4 */, +{ "LD L,SET 4,(IY+$)" , 23 , 0 } /* E5 */, +{ "SET 4,(IY+$)" , 23 , 0 } /* E6 */, +{ "LD A,SET 4,(IY+$)" , 23 , 0 } /* E7 */, +{ "LD B,SET 5,(IY+$)" , 23 , 0 } /* E8 */, +{ "LD C,SET 5,(IY+$)" , 23 , 0 } /* E9 */, +{ "LD D,SET 5,(IY+$)" , 23 , 0 } /* EA */, +{ "LD E,SET 5,(IY+$)" , 23 , 0 } /* EB */, +{ "LD H,SET 5,(IY+$)" , 23 , 0 } /* EC */, +{ "LD L,SET 5,(IY+$)" , 23 , 0 } /* ED */, +{ "SET 5,(IY+$)" , 23 , 0 } /* EE */, +{ "LD A,SET 5,(IY+$)" , 23 , 0 } /* EF */, +{ "LD B,SET 6,(IY+$)" , 23 , 0 } /* F0 */, +{ "LD C,SET 6,(IY+$)" , 23 , 0 } /* F1 */, +{ "LD D,SET 6,(IY+$)" , 23 , 0 } /* F2 */, +{ "LD E,SET 6,(IY+$)" , 23 , 0 } /* F3 */, +{ "LD H,SET 6,(IY+$)" , 23 , 0 } /* F4 */, +{ "LD L,SET 6,(IY+$)" , 23 , 0 } /* F5 */, +{ "SET 6,(IY+$)" , 23 , 0 } /* F6 */, +{ "LD A,SET 6,(IY+$)" , 23 , 0 } /* F7 */, +{ "LD B,SET 7,(IY+$)" , 23 , 0 } /* F8 */, +{ "LD C,SET 7,(IY+$)" , 23 , 0 } /* F9 */, +{ "LD D,SET 7,(IY+$)" , 23 , 0 } /* FA */, +{ "LD E,SET 7,(IY+$)" , 23 , 0 } /* FB */, +{ "LD H,SET 7,(IY+$)" , 23 , 0 } /* FC */, +{ "LD L,SET 7,(IY+$)" , 23 , 0 } /* FD */, +{ "SET 7,(IY+$)" , 23 , 0 } /* FE */, +{ "LD A,SET 7,(IY+$)" , 23 , 0 } /* FF */ + +}; diff --git a/third_party/z80ex/opcodes/opcodes_dd.c b/third_party/z80ex/opcodes/opcodes_dd.c new file mode 100644 index 00000000..7d2786cc --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_dd.c @@ -0,0 +1,871 @@ +/* autogenerated from ./opcodes_ddfd.dat, do not edit */ + +/*ADD IX,BC*/ +static void op_DD_0x09(Z80EX_CONTEXT *cpu) +{ + ADD16(IX,BC); + T_WAIT_UNTIL(11); + return; +} + +/*ADD IX,DE*/ +static void op_DD_0x19(Z80EX_CONTEXT *cpu) +{ + ADD16(IX,DE); + T_WAIT_UNTIL(11); + return; +} + +/*LD IX,@*/ +static void op_DD_0x21(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + LD16(IX,temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*LD (@),IX*/ +static void op_DD_0x22(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,IX, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*INC IX*/ +static void op_DD_0x23(Z80EX_CONTEXT *cpu) +{ + INC16(IX); + T_WAIT_UNTIL(6); + return; +} + +/*INC IXH*/ +static void op_DD_0x24(Z80EX_CONTEXT *cpu) +{ + INC(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*DEC IXH*/ +static void op_DD_0x25(Z80EX_CONTEXT *cpu) +{ + DEC(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXH,#*/ +static void op_DD_0x26(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(IXH,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*ADD IX,IX*/ +static void op_DD_0x29(Z80EX_CONTEXT *cpu) +{ + ADD16(IX,IX); + T_WAIT_UNTIL(11); + return; +} + +/*LD IX,(@)*/ +static void op_DD_0x2a(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(IX,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*DEC IX*/ +static void op_DD_0x2b(Z80EX_CONTEXT *cpu) +{ + DEC16(IX); + T_WAIT_UNTIL(6); + return; +} + +/*INC IXL*/ +static void op_DD_0x2c(Z80EX_CONTEXT *cpu) +{ + INC(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*DEC IXL*/ +static void op_DD_0x2d(Z80EX_CONTEXT *cpu) +{ + DEC(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,#*/ +static void op_DD_0x2e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(IXL,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*INC (IX+$)*/ +static void op_DD_0x34(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + INC(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*DEC (IX+$)*/ +static void op_DD_0x35(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + DEC(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD (IX+$),#*/ +static void op_DD_0x36(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + temp_byte=READ_OP(); + LD(temp_byte,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*ADD IX,SP*/ +static void op_DD_0x39(Z80EX_CONTEXT *cpu) +{ + ADD16(IX,SP); + T_WAIT_UNTIL(11); + return; +} + +/*LD B,IXH*/ +static void op_DD_0x44(Z80EX_CONTEXT *cpu) +{ + LD(B,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,IXL*/ +static void op_DD_0x45(Z80EX_CONTEXT *cpu) +{ + LD(B,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,(IX+$)*/ +static void op_DD_0x46(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(B,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD C,IXH*/ +static void op_DD_0x4c(Z80EX_CONTEXT *cpu) +{ + LD(C,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,IXL*/ +static void op_DD_0x4d(Z80EX_CONTEXT *cpu) +{ + LD(C,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,(IX+$)*/ +static void op_DD_0x4e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(C,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD D,IXH*/ +static void op_DD_0x54(Z80EX_CONTEXT *cpu) +{ + LD(D,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,IXL*/ +static void op_DD_0x55(Z80EX_CONTEXT *cpu) +{ + LD(D,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,(IX+$)*/ +static void op_DD_0x56(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(D,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD E,IXH*/ +static void op_DD_0x5c(Z80EX_CONTEXT *cpu) +{ + LD(E,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,IXL*/ +static void op_DD_0x5d(Z80EX_CONTEXT *cpu) +{ + LD(E,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,(IX+$)*/ +static void op_DD_0x5e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(E,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD IXH,B*/ +static void op_DD_0x60(Z80EX_CONTEXT *cpu) +{ + LD(IXH,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXH,C*/ +static void op_DD_0x61(Z80EX_CONTEXT *cpu) +{ + LD(IXH,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXH,D*/ +static void op_DD_0x62(Z80EX_CONTEXT *cpu) +{ + LD(IXH,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXH,E*/ +static void op_DD_0x63(Z80EX_CONTEXT *cpu) +{ + LD(IXH,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXH,IXH*/ +static void op_DD_0x64(Z80EX_CONTEXT *cpu) +{ + LD(IXH,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXH,IXL*/ +static void op_DD_0x65(Z80EX_CONTEXT *cpu) +{ + LD(IXH,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,(IX+$)*/ +static void op_DD_0x66(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(H,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD IXH,A*/ +static void op_DD_0x67(Z80EX_CONTEXT *cpu) +{ + LD(IXH,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,B*/ +static void op_DD_0x68(Z80EX_CONTEXT *cpu) +{ + LD(IXL,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,C*/ +static void op_DD_0x69(Z80EX_CONTEXT *cpu) +{ + LD(IXL,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,D*/ +static void op_DD_0x6a(Z80EX_CONTEXT *cpu) +{ + LD(IXL,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,E*/ +static void op_DD_0x6b(Z80EX_CONTEXT *cpu) +{ + LD(IXL,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,IXH*/ +static void op_DD_0x6c(Z80EX_CONTEXT *cpu) +{ + LD(IXL,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD IXL,IXL*/ +static void op_DD_0x6d(Z80EX_CONTEXT *cpu) +{ + LD(IXL,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,(IX+$)*/ +static void op_DD_0x6e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(L,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD IXL,A*/ +static void op_DD_0x6f(Z80EX_CONTEXT *cpu) +{ + LD(IXL,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD (IX+$),B*/ +static void op_DD_0x70(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,B); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IX+$),C*/ +static void op_DD_0x71(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,C); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IX+$),D*/ +static void op_DD_0x72(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,D); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IX+$),E*/ +static void op_DD_0x73(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,E); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IX+$),H*/ +static void op_DD_0x74(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,H); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IX+$),L*/ +static void op_DD_0x75(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,L); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IX+$),A*/ +static void op_DD_0x77(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + LD(temp_byte,A); + WRITE_MEM((IX+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD A,IXH*/ +static void op_DD_0x7c(Z80EX_CONTEXT *cpu) +{ + LD(A,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,IXL*/ +static void op_DD_0x7d(Z80EX_CONTEXT *cpu) +{ + LD(A,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,(IX+$)*/ +static void op_DD_0x7e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + LD(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*ADD A,IXH*/ +static void op_DD_0x84(Z80EX_CONTEXT *cpu) +{ + ADD(A,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,IXL*/ +static void op_DD_0x85(Z80EX_CONTEXT *cpu) +{ + ADD(A,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,(IX+$)*/ +static void op_DD_0x86(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + ADD(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*ADC A,IXH*/ +static void op_DD_0x8c(Z80EX_CONTEXT *cpu) +{ + ADC(A,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,IXL*/ +static void op_DD_0x8d(Z80EX_CONTEXT *cpu) +{ + ADC(A,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,(IX+$)*/ +static void op_DD_0x8e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + ADC(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*SUB IXH*/ +static void op_DD_0x94(Z80EX_CONTEXT *cpu) +{ + SUB(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*SUB IXL*/ +static void op_DD_0x95(Z80EX_CONTEXT *cpu) +{ + SUB(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*SUB (IX+$)*/ +static void op_DD_0x96(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SUB(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*SBC A,IXH*/ +static void op_DD_0x9c(Z80EX_CONTEXT *cpu) +{ + SBC(A,IXH); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,IXL*/ +static void op_DD_0x9d(Z80EX_CONTEXT *cpu) +{ + SBC(A,IXL); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,(IX+$)*/ +static void op_DD_0x9e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SBC(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*AND IXH*/ +static void op_DD_0xa4(Z80EX_CONTEXT *cpu) +{ + AND(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*AND IXL*/ +static void op_DD_0xa5(Z80EX_CONTEXT *cpu) +{ + AND(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*AND (IX+$)*/ +static void op_DD_0xa6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + AND(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*XOR IXH*/ +static void op_DD_0xac(Z80EX_CONTEXT *cpu) +{ + XOR(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*XOR IXL*/ +static void op_DD_0xad(Z80EX_CONTEXT *cpu) +{ + XOR(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*XOR (IX+$)*/ +static void op_DD_0xae(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + XOR(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*OR IXH*/ +static void op_DD_0xb4(Z80EX_CONTEXT *cpu) +{ + OR(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*OR IXL*/ +static void op_DD_0xb5(Z80EX_CONTEXT *cpu) +{ + OR(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*OR (IX+$)*/ +static void op_DD_0xb6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + OR(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*CP IXH*/ +static void op_DD_0xbc(Z80EX_CONTEXT *cpu) +{ + CP(IXH); + T_WAIT_UNTIL(4); + return; +} + +/*CP IXL*/ +static void op_DD_0xbd(Z80EX_CONTEXT *cpu) +{ + CP(IXL); + T_WAIT_UNTIL(4); + return; +} + +/*CP (IX+$)*/ +static void op_DD_0xbe(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + CP(temp_byte); + T_WAIT_UNTIL(15); + return; +} + + +/*POP IX*/ +static void op_DD_0xe1(Z80EX_CONTEXT *cpu) +{ + POP(IX, /*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*EX (SP),IX*/ +static void op_DD_0xe3(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_word.b.l,(SP),4); + READ_MEM(temp_word.b.h,(SP+1),7); + EX_MPTR(temp_word.w,IX); + WRITE_MEM((SP),temp_word.b.l,11); + WRITE_MEM((SP+1),temp_word.b.h,14); + T_WAIT_UNTIL(19); + return; +} + +/*PUSH IX*/ +static void op_DD_0xe5(Z80EX_CONTEXT *cpu) +{ + PUSH(IX, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*JP IX*/ +static void op_DD_0xe9(Z80EX_CONTEXT *cpu) +{ + JP_NO_MPTR(IX); + T_WAIT_UNTIL(4); + return; +} + +/*LD SP,IX*/ +static void op_DD_0xf9(Z80EX_CONTEXT *cpu) +{ + LD16(SP,IX); + T_WAIT_UNTIL(6); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_dd[0x100] = { + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_DD_0x09 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_DD_0x19 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_DD_0x21 , op_DD_0x22 , op_DD_0x23 , + op_DD_0x24 , op_DD_0x25 , op_DD_0x26 , NULL , + NULL , op_DD_0x29 , op_DD_0x2a , op_DD_0x2b , + op_DD_0x2c , op_DD_0x2d , op_DD_0x2e , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x34 , op_DD_0x35 , op_DD_0x36 , NULL , + NULL , op_DD_0x39 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x44 , op_DD_0x45 , op_DD_0x46 , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x4c , op_DD_0x4d , op_DD_0x4e , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x54 , op_DD_0x55 , op_DD_0x56 , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x5c , op_DD_0x5d , op_DD_0x5e , NULL , + op_DD_0x60 , op_DD_0x61 , op_DD_0x62 , op_DD_0x63 , + op_DD_0x64 , op_DD_0x65 , op_DD_0x66 , op_DD_0x67 , + op_DD_0x68 , op_DD_0x69 , op_DD_0x6a , op_DD_0x6b , + op_DD_0x6c , op_DD_0x6d , op_DD_0x6e , op_DD_0x6f , + op_DD_0x70 , op_DD_0x71 , op_DD_0x72 , op_DD_0x73 , + op_DD_0x74 , op_DD_0x75 , NULL , op_DD_0x77 , + NULL , NULL , NULL , NULL , + op_DD_0x7c , op_DD_0x7d , op_DD_0x7e , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x84 , op_DD_0x85 , op_DD_0x86 , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x8c , op_DD_0x8d , op_DD_0x8e , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x94 , op_DD_0x95 , op_DD_0x96 , NULL , + NULL , NULL , NULL , NULL , + op_DD_0x9c , op_DD_0x9d , op_DD_0x9e , NULL , + NULL , NULL , NULL , NULL , + op_DD_0xa4 , op_DD_0xa5 , op_DD_0xa6 , NULL , + NULL , NULL , NULL , NULL , + op_DD_0xac , op_DD_0xad , op_DD_0xae , NULL , + NULL , NULL , NULL , NULL , + op_DD_0xb4 , op_DD_0xb5 , op_DD_0xb6 , NULL , + NULL , NULL , NULL , NULL , + op_DD_0xbc , op_DD_0xbd , op_DD_0xbe , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_DD_0xe1 , NULL , op_DD_0xe3 , + NULL , op_DD_0xe5 , NULL , NULL , + NULL , op_DD_0xe9 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_DD_0xf9 , NULL , NULL , + NULL , NULL , NULL , NULL +}; diff --git a/third_party/z80ex/opcodes/opcodes_ddcb.c b/third_party/z80ex/opcodes/opcodes_ddcb.c new file mode 100644 index 00000000..2f0eda77 --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_ddcb.c @@ -0,0 +1,2431 @@ +/* autogenerated from ./opcodes_ddfdcb.dat, do not edit */ + +/*LD B,RLC (IX+$)*/ +static void op_DDCB_0x00(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RLC (IX+$)*/ +static void op_DDCB_0x01(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RLC (IX+$)*/ +static void op_DDCB_0x02(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RLC (IX+$)*/ +static void op_DDCB_0x03(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RLC (IX+$)*/ +static void op_DDCB_0x04(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RLC (IX+$)*/ +static void op_DDCB_0x05(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RLC (IX+$)*/ +static void op_DDCB_0x06(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RLC (IX+$)*/ +static void op_DDCB_0x07(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RLC(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RRC (IX+$)*/ +static void op_DDCB_0x08(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RRC (IX+$)*/ +static void op_DDCB_0x09(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RRC (IX+$)*/ +static void op_DDCB_0x0a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RRC (IX+$)*/ +static void op_DDCB_0x0b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RRC (IX+$)*/ +static void op_DDCB_0x0c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RRC (IX+$)*/ +static void op_DDCB_0x0d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RRC (IX+$)*/ +static void op_DDCB_0x0e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RRC (IX+$)*/ +static void op_DDCB_0x0f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RRC(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RL (IX+$)*/ +static void op_DDCB_0x10(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RL (IX+$)*/ +static void op_DDCB_0x11(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RL (IX+$)*/ +static void op_DDCB_0x12(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RL (IX+$)*/ +static void op_DDCB_0x13(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RL (IX+$)*/ +static void op_DDCB_0x14(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RL (IX+$)*/ +static void op_DDCB_0x15(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RL (IX+$)*/ +static void op_DDCB_0x16(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RL (IX+$)*/ +static void op_DDCB_0x17(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RL(temp_byte); + LD16(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RR (IX+$)*/ +static void op_DDCB_0x18(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RR (IX+$)*/ +static void op_DDCB_0x19(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RR (IX+$)*/ +static void op_DDCB_0x1a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RR (IX+$)*/ +static void op_DDCB_0x1b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RR (IX+$)*/ +static void op_DDCB_0x1c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RR (IX+$)*/ +static void op_DDCB_0x1d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RR (IX+$)*/ +static void op_DDCB_0x1e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RR (IX+$)*/ +static void op_DDCB_0x1f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RR(temp_byte); + LD16(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SLA (IX+$)*/ +static void op_DDCB_0x20(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SLA (IX+$)*/ +static void op_DDCB_0x21(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SLA (IX+$)*/ +static void op_DDCB_0x22(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SLA (IX+$)*/ +static void op_DDCB_0x23(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SLA (IX+$)*/ +static void op_DDCB_0x24(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SLA (IX+$)*/ +static void op_DDCB_0x25(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SLA (IX+$)*/ +static void op_DDCB_0x26(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SLA (IX+$)*/ +static void op_DDCB_0x27(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLA(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SRA (IX+$)*/ +static void op_DDCB_0x28(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SRA (IX+$)*/ +static void op_DDCB_0x29(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SRA (IX+$)*/ +static void op_DDCB_0x2a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SRA (IX+$)*/ +static void op_DDCB_0x2b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SRA (IX+$)*/ +static void op_DDCB_0x2c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SRA (IX+$)*/ +static void op_DDCB_0x2d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SRA (IX+$)*/ +static void op_DDCB_0x2e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SRA (IX+$)*/ +static void op_DDCB_0x2f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRA(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SLL (IX+$)*/ +static void op_DDCB_0x30(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SLL (IX+$)*/ +static void op_DDCB_0x31(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SLL (IX+$)*/ +static void op_DDCB_0x32(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SLL (IX+$)*/ +static void op_DDCB_0x33(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SLL (IX+$)*/ +static void op_DDCB_0x34(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SLL (IX+$)*/ +static void op_DDCB_0x35(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SLL (IX+$)*/ +static void op_DDCB_0x36(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SLL (IX+$)*/ +static void op_DDCB_0x37(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SLL(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SRL (IX+$)*/ +static void op_DDCB_0x38(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SRL (IX+$)*/ +static void op_DDCB_0x39(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SRL (IX+$)*/ +static void op_DDCB_0x3a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SRL (IX+$)*/ +static void op_DDCB_0x3b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SRL (IX+$)*/ +static void op_DDCB_0x3c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SRL (IX+$)*/ +static void op_DDCB_0x3d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SRL (IX+$)*/ +static void op_DDCB_0x3e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SRL (IX+$)*/ +static void op_DDCB_0x3f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SRL(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*BIT 0,(IX+$)*/ +static void op_DDCB_0x47(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(0,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 1,(IX+$)*/ +static void op_DDCB_0x4f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(1,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 2,(IX+$)*/ +static void op_DDCB_0x57(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(2,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 3,(IX+$)*/ +static void op_DDCB_0x5f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(3,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 4,(IX+$)*/ +static void op_DDCB_0x67(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(4,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 5,(IX+$)*/ +static void op_DDCB_0x6f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(5,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 6,(IX+$)*/ +static void op_DDCB_0x77(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(6,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 7,(IX+$)*/ +static void op_DDCB_0x7f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + BIT_MPTR(7,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*LD B,RES 0,(IX+$)*/ +static void op_DDCB_0x80(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 0,(IX+$)*/ +static void op_DDCB_0x81(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 0,(IX+$)*/ +static void op_DDCB_0x82(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 0,(IX+$)*/ +static void op_DDCB_0x83(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 0,(IX+$)*/ +static void op_DDCB_0x84(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 0,(IX+$)*/ +static void op_DDCB_0x85(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 0,(IX+$)*/ +static void op_DDCB_0x86(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 0,(IX+$)*/ +static void op_DDCB_0x87(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(0,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 1,(IX+$)*/ +static void op_DDCB_0x88(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 1,(IX+$)*/ +static void op_DDCB_0x89(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 1,(IX+$)*/ +static void op_DDCB_0x8a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 1,(IX+$)*/ +static void op_DDCB_0x8b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 1,(IX+$)*/ +static void op_DDCB_0x8c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 1,(IX+$)*/ +static void op_DDCB_0x8d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 1,(IX+$)*/ +static void op_DDCB_0x8e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 1,(IX+$)*/ +static void op_DDCB_0x8f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(1,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 2,(IX+$)*/ +static void op_DDCB_0x90(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 2,(IX+$)*/ +static void op_DDCB_0x91(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 2,(IX+$)*/ +static void op_DDCB_0x92(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 2,(IX+$)*/ +static void op_DDCB_0x93(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 2,(IX+$)*/ +static void op_DDCB_0x94(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 2,(IX+$)*/ +static void op_DDCB_0x95(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 2,(IX+$)*/ +static void op_DDCB_0x96(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 2,(IX+$)*/ +static void op_DDCB_0x97(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(2,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 3,(IX+$)*/ +static void op_DDCB_0x98(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 3,(IX+$)*/ +static void op_DDCB_0x99(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 3,(IX+$)*/ +static void op_DDCB_0x9a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 3,(IX+$)*/ +static void op_DDCB_0x9b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 3,(IX+$)*/ +static void op_DDCB_0x9c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 3,(IX+$)*/ +static void op_DDCB_0x9d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 3,(IX+$)*/ +static void op_DDCB_0x9e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 3,(IX+$)*/ +static void op_DDCB_0x9f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(3,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 4,(IX+$)*/ +static void op_DDCB_0xa0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 4,(IX+$)*/ +static void op_DDCB_0xa1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 4,(IX+$)*/ +static void op_DDCB_0xa2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 4,(IX+$)*/ +static void op_DDCB_0xa3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 4,(IX+$)*/ +static void op_DDCB_0xa4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 4,(IX+$)*/ +static void op_DDCB_0xa5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 4,(IX+$)*/ +static void op_DDCB_0xa6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 4,(IX+$)*/ +static void op_DDCB_0xa7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(4,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 5,(IX+$)*/ +static void op_DDCB_0xa8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 5,(IX+$)*/ +static void op_DDCB_0xa9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 5,(IX+$)*/ +static void op_DDCB_0xaa(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 5,(IX+$)*/ +static void op_DDCB_0xab(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 5,(IX+$)*/ +static void op_DDCB_0xac(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 5,(IX+$)*/ +static void op_DDCB_0xad(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 5,(IX+$)*/ +static void op_DDCB_0xae(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 5,(IX+$)*/ +static void op_DDCB_0xaf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(5,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 6,(IX+$)*/ +static void op_DDCB_0xb0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 6,(IX+$)*/ +static void op_DDCB_0xb1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 6,(IX+$)*/ +static void op_DDCB_0xb2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 6,(IX+$)*/ +static void op_DDCB_0xb3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 6,(IX+$)*/ +static void op_DDCB_0xb4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 6,(IX+$)*/ +static void op_DDCB_0xb5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 6,(IX+$)*/ +static void op_DDCB_0xb6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 6,(IX+$)*/ +static void op_DDCB_0xb7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(6,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 7,(IX+$)*/ +static void op_DDCB_0xb8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 7,(IX+$)*/ +static void op_DDCB_0xb9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 7,(IX+$)*/ +static void op_DDCB_0xba(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 7,(IX+$)*/ +static void op_DDCB_0xbb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 7,(IX+$)*/ +static void op_DDCB_0xbc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 7,(IX+$)*/ +static void op_DDCB_0xbd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 7,(IX+$)*/ +static void op_DDCB_0xbe(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 7,(IX+$)*/ +static void op_DDCB_0xbf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + RES(7,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 0,(IX+$)*/ +static void op_DDCB_0xc0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 0,(IX+$)*/ +static void op_DDCB_0xc1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 0,(IX+$)*/ +static void op_DDCB_0xc2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 0,(IX+$)*/ +static void op_DDCB_0xc3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 0,(IX+$)*/ +static void op_DDCB_0xc4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 0,(IX+$)*/ +static void op_DDCB_0xc5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 0,(IX+$)*/ +static void op_DDCB_0xc6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 0,(IX+$)*/ +static void op_DDCB_0xc7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(0,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 1,(IX+$)*/ +static void op_DDCB_0xc8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 1,(IX+$)*/ +static void op_DDCB_0xc9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 1,(IX+$)*/ +static void op_DDCB_0xca(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 1,(IX+$)*/ +static void op_DDCB_0xcb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 1,(IX+$)*/ +static void op_DDCB_0xcc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 1,(IX+$)*/ +static void op_DDCB_0xcd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 1,(IX+$)*/ +static void op_DDCB_0xce(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 1,(IX+$)*/ +static void op_DDCB_0xcf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(1,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 2,(IX+$)*/ +static void op_DDCB_0xd0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 2,(IX+$)*/ +static void op_DDCB_0xd1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 2,(IX+$)*/ +static void op_DDCB_0xd2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 2,(IX+$)*/ +static void op_DDCB_0xd3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 2,(IX+$)*/ +static void op_DDCB_0xd4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 2,(IX+$)*/ +static void op_DDCB_0xd5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 2,(IX+$)*/ +static void op_DDCB_0xd6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 2,(IX+$)*/ +static void op_DDCB_0xd7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(2,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 3,(IX+$)*/ +static void op_DDCB_0xd8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 3,(IX+$)*/ +static void op_DDCB_0xd9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 3,(IX+$)*/ +static void op_DDCB_0xda(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 3,(IX+$)*/ +static void op_DDCB_0xdb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 3,(IX+$)*/ +static void op_DDCB_0xdc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 3,(IX+$)*/ +static void op_DDCB_0xdd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 3,(IX+$)*/ +static void op_DDCB_0xde(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 3,(IX+$)*/ +static void op_DDCB_0xdf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(3,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 4,(IX+$)*/ +static void op_DDCB_0xe0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 4,(IX+$)*/ +static void op_DDCB_0xe1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 4,(IX+$)*/ +static void op_DDCB_0xe2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 4,(IX+$)*/ +static void op_DDCB_0xe3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 4,(IX+$)*/ +static void op_DDCB_0xe4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 4,(IX+$)*/ +static void op_DDCB_0xe5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 4,(IX+$)*/ +static void op_DDCB_0xe6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 4,(IX+$)*/ +static void op_DDCB_0xe7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(4,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 5,(IX+$)*/ +static void op_DDCB_0xe8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 5,(IX+$)*/ +static void op_DDCB_0xe9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 5,(IX+$)*/ +static void op_DDCB_0xea(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 5,(IX+$)*/ +static void op_DDCB_0xeb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 5,(IX+$)*/ +static void op_DDCB_0xec(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 5,(IX+$)*/ +static void op_DDCB_0xed(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 5,(IX+$)*/ +static void op_DDCB_0xee(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 5,(IX+$)*/ +static void op_DDCB_0xef(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(5,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 6,(IX+$)*/ +static void op_DDCB_0xf0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 6,(IX+$)*/ +static void op_DDCB_0xf1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 6,(IX+$)*/ +static void op_DDCB_0xf2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 6,(IX+$)*/ +static void op_DDCB_0xf3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 6,(IX+$)*/ +static void op_DDCB_0xf4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 6,(IX+$)*/ +static void op_DDCB_0xf5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 6,(IX+$)*/ +static void op_DDCB_0xf6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 6,(IX+$)*/ +static void op_DDCB_0xf7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(6,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 7,(IX+$)*/ +static void op_DDCB_0xf8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 7,(IX+$)*/ +static void op_DDCB_0xf9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 7,(IX+$)*/ +static void op_DDCB_0xfa(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 7,(IX+$)*/ +static void op_DDCB_0xfb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 7,(IX+$)*/ +static void op_DDCB_0xfc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 7,(IX+$)*/ +static void op_DDCB_0xfd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 7,(IX+$)*/ +static void op_DDCB_0xfe(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 7,(IX+$)*/ +static void op_DDCB_0xff(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IX+temp_byte_s); + READ_MEM(temp_byte,(IX+temp_byte_s),12); + SET(7,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IX+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_ddcb[0x100] = { + op_DDCB_0x00 , op_DDCB_0x01 , op_DDCB_0x02 , op_DDCB_0x03 , + op_DDCB_0x04 , op_DDCB_0x05 , op_DDCB_0x06 , op_DDCB_0x07 , + op_DDCB_0x08 , op_DDCB_0x09 , op_DDCB_0x0a , op_DDCB_0x0b , + op_DDCB_0x0c , op_DDCB_0x0d , op_DDCB_0x0e , op_DDCB_0x0f , + op_DDCB_0x10 , op_DDCB_0x11 , op_DDCB_0x12 , op_DDCB_0x13 , + op_DDCB_0x14 , op_DDCB_0x15 , op_DDCB_0x16 , op_DDCB_0x17 , + op_DDCB_0x18 , op_DDCB_0x19 , op_DDCB_0x1a , op_DDCB_0x1b , + op_DDCB_0x1c , op_DDCB_0x1d , op_DDCB_0x1e , op_DDCB_0x1f , + op_DDCB_0x20 , op_DDCB_0x21 , op_DDCB_0x22 , op_DDCB_0x23 , + op_DDCB_0x24 , op_DDCB_0x25 , op_DDCB_0x26 , op_DDCB_0x27 , + op_DDCB_0x28 , op_DDCB_0x29 , op_DDCB_0x2a , op_DDCB_0x2b , + op_DDCB_0x2c , op_DDCB_0x2d , op_DDCB_0x2e , op_DDCB_0x2f , + op_DDCB_0x30 , op_DDCB_0x31 , op_DDCB_0x32 , op_DDCB_0x33 , + op_DDCB_0x34 , op_DDCB_0x35 , op_DDCB_0x36 , op_DDCB_0x37 , + op_DDCB_0x38 , op_DDCB_0x39 , op_DDCB_0x3a , op_DDCB_0x3b , + op_DDCB_0x3c , op_DDCB_0x3d , op_DDCB_0x3e , op_DDCB_0x3f , + op_DDCB_0x47 , op_DDCB_0x47 , op_DDCB_0x47 , op_DDCB_0x47 , + op_DDCB_0x47 , op_DDCB_0x47 , op_DDCB_0x47 , op_DDCB_0x47 , + op_DDCB_0x4f , op_DDCB_0x4f , op_DDCB_0x4f , op_DDCB_0x4f , + op_DDCB_0x4f , op_DDCB_0x4f , op_DDCB_0x4f , op_DDCB_0x4f , + op_DDCB_0x57 , op_DDCB_0x57 , op_DDCB_0x57 , op_DDCB_0x57 , + op_DDCB_0x57 , op_DDCB_0x57 , op_DDCB_0x57 , op_DDCB_0x57 , + op_DDCB_0x5f , op_DDCB_0x5f , op_DDCB_0x5f , op_DDCB_0x5f , + op_DDCB_0x5f , op_DDCB_0x5f , op_DDCB_0x5f , op_DDCB_0x5f , + op_DDCB_0x67 , op_DDCB_0x67 , op_DDCB_0x67 , op_DDCB_0x67 , + op_DDCB_0x67 , op_DDCB_0x67 , op_DDCB_0x67 , op_DDCB_0x67 , + op_DDCB_0x6f , op_DDCB_0x6f , op_DDCB_0x6f , op_DDCB_0x6f , + op_DDCB_0x6f , op_DDCB_0x6f , op_DDCB_0x6f , op_DDCB_0x6f , + op_DDCB_0x77 , op_DDCB_0x77 , op_DDCB_0x77 , op_DDCB_0x77 , + op_DDCB_0x77 , op_DDCB_0x77 , op_DDCB_0x77 , op_DDCB_0x77 , + op_DDCB_0x7f , op_DDCB_0x7f , op_DDCB_0x7f , op_DDCB_0x7f , + op_DDCB_0x7f , op_DDCB_0x7f , op_DDCB_0x7f , op_DDCB_0x7f , + op_DDCB_0x80 , op_DDCB_0x81 , op_DDCB_0x82 , op_DDCB_0x83 , + op_DDCB_0x84 , op_DDCB_0x85 , op_DDCB_0x86 , op_DDCB_0x87 , + op_DDCB_0x88 , op_DDCB_0x89 , op_DDCB_0x8a , op_DDCB_0x8b , + op_DDCB_0x8c , op_DDCB_0x8d , op_DDCB_0x8e , op_DDCB_0x8f , + op_DDCB_0x90 , op_DDCB_0x91 , op_DDCB_0x92 , op_DDCB_0x93 , + op_DDCB_0x94 , op_DDCB_0x95 , op_DDCB_0x96 , op_DDCB_0x97 , + op_DDCB_0x98 , op_DDCB_0x99 , op_DDCB_0x9a , op_DDCB_0x9b , + op_DDCB_0x9c , op_DDCB_0x9d , op_DDCB_0x9e , op_DDCB_0x9f , + op_DDCB_0xa0 , op_DDCB_0xa1 , op_DDCB_0xa2 , op_DDCB_0xa3 , + op_DDCB_0xa4 , op_DDCB_0xa5 , op_DDCB_0xa6 , op_DDCB_0xa7 , + op_DDCB_0xa8 , op_DDCB_0xa9 , op_DDCB_0xaa , op_DDCB_0xab , + op_DDCB_0xac , op_DDCB_0xad , op_DDCB_0xae , op_DDCB_0xaf , + op_DDCB_0xb0 , op_DDCB_0xb1 , op_DDCB_0xb2 , op_DDCB_0xb3 , + op_DDCB_0xb4 , op_DDCB_0xb5 , op_DDCB_0xb6 , op_DDCB_0xb7 , + op_DDCB_0xb8 , op_DDCB_0xb9 , op_DDCB_0xba , op_DDCB_0xbb , + op_DDCB_0xbc , op_DDCB_0xbd , op_DDCB_0xbe , op_DDCB_0xbf , + op_DDCB_0xc0 , op_DDCB_0xc1 , op_DDCB_0xc2 , op_DDCB_0xc3 , + op_DDCB_0xc4 , op_DDCB_0xc5 , op_DDCB_0xc6 , op_DDCB_0xc7 , + op_DDCB_0xc8 , op_DDCB_0xc9 , op_DDCB_0xca , op_DDCB_0xcb , + op_DDCB_0xcc , op_DDCB_0xcd , op_DDCB_0xce , op_DDCB_0xcf , + op_DDCB_0xd0 , op_DDCB_0xd1 , op_DDCB_0xd2 , op_DDCB_0xd3 , + op_DDCB_0xd4 , op_DDCB_0xd5 , op_DDCB_0xd6 , op_DDCB_0xd7 , + op_DDCB_0xd8 , op_DDCB_0xd9 , op_DDCB_0xda , op_DDCB_0xdb , + op_DDCB_0xdc , op_DDCB_0xdd , op_DDCB_0xde , op_DDCB_0xdf , + op_DDCB_0xe0 , op_DDCB_0xe1 , op_DDCB_0xe2 , op_DDCB_0xe3 , + op_DDCB_0xe4 , op_DDCB_0xe5 , op_DDCB_0xe6 , op_DDCB_0xe7 , + op_DDCB_0xe8 , op_DDCB_0xe9 , op_DDCB_0xea , op_DDCB_0xeb , + op_DDCB_0xec , op_DDCB_0xed , op_DDCB_0xee , op_DDCB_0xef , + op_DDCB_0xf0 , op_DDCB_0xf1 , op_DDCB_0xf2 , op_DDCB_0xf3 , + op_DDCB_0xf4 , op_DDCB_0xf5 , op_DDCB_0xf6 , op_DDCB_0xf7 , + op_DDCB_0xf8 , op_DDCB_0xf9 , op_DDCB_0xfa , op_DDCB_0xfb , + op_DDCB_0xfc , op_DDCB_0xfd , op_DDCB_0xfe , op_DDCB_0xff +}; diff --git a/third_party/z80ex/opcodes/opcodes_ed.c b/third_party/z80ex/opcodes/opcodes_ed.c new file mode 100644 index 00000000..0c6a9377 --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_ed.c @@ -0,0 +1,719 @@ +/* autogenerated from ./opcodes_ed.dat, do not edit */ + +/*IN B,(C)*/ +static void op_ED_0x40(Z80EX_CONTEXT *cpu) +{ + IN(B,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),B*/ +static void op_ED_0x41(Z80EX_CONTEXT *cpu) +{ + OUT(BC,B, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*SBC HL,BC*/ +static void op_ED_0x42(Z80EX_CONTEXT *cpu) +{ + SBC16(HL,BC); + T_WAIT_UNTIL(11); + return; +} + +/*LD (@),BC*/ +static void op_ED_0x43(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,BC, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x44(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETN*/ +static void op_ED_0x45(Z80EX_CONTEXT *cpu) +{ + RETN(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 0*/ +static void op_ED_0x46(Z80EX_CONTEXT *cpu) +{ + IM_(IM0); + T_WAIT_UNTIL(4); + return; +} + +/*LD I,A*/ +static void op_ED_0x47(Z80EX_CONTEXT *cpu) +{ + LD(I,A); + T_WAIT_UNTIL(5); + return; +} + +/*IN C,(C)*/ +static void op_ED_0x48(Z80EX_CONTEXT *cpu) +{ + IN(C,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),C*/ +static void op_ED_0x49(Z80EX_CONTEXT *cpu) +{ + OUT(BC,C, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*ADC HL,BC*/ +static void op_ED_0x4a(Z80EX_CONTEXT *cpu) +{ + ADC16(HL,BC); + T_WAIT_UNTIL(11); + return; +} + +/*LD BC,(@)*/ +static void op_ED_0x4b(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(BC,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x4c(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETI*/ +static void op_ED_0x4d(Z80EX_CONTEXT *cpu) +{ + RETI(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 0*/ +static void op_ED_0x4e(Z80EX_CONTEXT *cpu) +{ + IM_(IM0); + T_WAIT_UNTIL(4); + return; +} + +/*LD R,A*/ +static void op_ED_0x4f(Z80EX_CONTEXT *cpu) +{ + LD_R_A(); + T_WAIT_UNTIL(5); + return; +} + +/*IN D,(C)*/ +static void op_ED_0x50(Z80EX_CONTEXT *cpu) +{ + IN(D,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),D*/ +static void op_ED_0x51(Z80EX_CONTEXT *cpu) +{ + OUT(BC,D, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*SBC HL,DE*/ +static void op_ED_0x52(Z80EX_CONTEXT *cpu) +{ + SBC16(HL,DE); + T_WAIT_UNTIL(11); + return; +} + +/*LD (@),DE*/ +static void op_ED_0x53(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,DE, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x54(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETN*/ +static void op_ED_0x55(Z80EX_CONTEXT *cpu) +{ + RETN(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 1*/ +static void op_ED_0x56(Z80EX_CONTEXT *cpu) +{ + IM_(IM1); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,I*/ +static void op_ED_0x57(Z80EX_CONTEXT *cpu) +{ + LD_A_I(); + T_WAIT_UNTIL(5); + return; +} + +/*IN E,(C)*/ +static void op_ED_0x58(Z80EX_CONTEXT *cpu) +{ + IN(E,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),E*/ +static void op_ED_0x59(Z80EX_CONTEXT *cpu) +{ + OUT(BC,E, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*ADC HL,DE*/ +static void op_ED_0x5a(Z80EX_CONTEXT *cpu) +{ + ADC16(HL,DE); + T_WAIT_UNTIL(11); + return; +} + +/*LD DE,(@)*/ +static void op_ED_0x5b(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(DE,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x5c(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETI*/ +static void op_ED_0x5d(Z80EX_CONTEXT *cpu) +{ + RETI(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 2*/ +static void op_ED_0x5e(Z80EX_CONTEXT *cpu) +{ + IM_(IM2); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,R*/ +static void op_ED_0x5f(Z80EX_CONTEXT *cpu) +{ + LD_A_R(); + T_WAIT_UNTIL(5); + return; +} + +/*IN H,(C)*/ +static void op_ED_0x60(Z80EX_CONTEXT *cpu) +{ + IN(H,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),H*/ +static void op_ED_0x61(Z80EX_CONTEXT *cpu) +{ + OUT(BC,H, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*SBC HL,HL*/ +static void op_ED_0x62(Z80EX_CONTEXT *cpu) +{ + SBC16(HL,HL); + T_WAIT_UNTIL(11); + return; +} + +/*LD (@),HL*/ +static void op_ED_0x63(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,HL, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x64(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETN*/ +static void op_ED_0x65(Z80EX_CONTEXT *cpu) +{ + RETN(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 0*/ +static void op_ED_0x66(Z80EX_CONTEXT *cpu) +{ + IM_(IM0); + T_WAIT_UNTIL(4); + return; +} + +/*RRD*/ +static void op_ED_0x67(Z80EX_CONTEXT *cpu) +{ + RRD(/*rd*/4, /*wr*/11); + T_WAIT_UNTIL(14); + return; +} + +/*IN L,(C)*/ +static void op_ED_0x68(Z80EX_CONTEXT *cpu) +{ + IN(L,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),L*/ +static void op_ED_0x69(Z80EX_CONTEXT *cpu) +{ + OUT(BC,L, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*ADC HL,HL*/ +static void op_ED_0x6a(Z80EX_CONTEXT *cpu) +{ + ADC16(HL,HL); + T_WAIT_UNTIL(11); + return; +} + +/*LD HL,(@)*/ +static void op_ED_0x6b(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(HL,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x6c(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETI*/ +static void op_ED_0x6d(Z80EX_CONTEXT *cpu) +{ + RETI(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 0*/ +static void op_ED_0x6e(Z80EX_CONTEXT *cpu) +{ + IM_(IM0); + T_WAIT_UNTIL(4); + return; +} + +/*RLD*/ +static void op_ED_0x6f(Z80EX_CONTEXT *cpu) +{ + RLD(/*rd*/4, /*wr*/11); + T_WAIT_UNTIL(14); + return; +} + +/*IN_F (C)*/ +static void op_ED_0x70(Z80EX_CONTEXT *cpu) +{ + IN_F(BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),0*/ +static void op_ED_0x71(Z80EX_CONTEXT *cpu) +{ + OUT(BC,0, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*SBC HL,SP*/ +static void op_ED_0x72(Z80EX_CONTEXT *cpu) +{ + SBC16(HL,SP); + T_WAIT_UNTIL(11); + return; +} + +/*LD (@),SP*/ +static void op_ED_0x73(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,SP, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x74(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETN*/ +static void op_ED_0x75(Z80EX_CONTEXT *cpu) +{ + RETN(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 1*/ +static void op_ED_0x76(Z80EX_CONTEXT *cpu) +{ + IM_(IM1); + T_WAIT_UNTIL(4); + return; +} + +/*IN A,(C)*/ +static void op_ED_0x78(Z80EX_CONTEXT *cpu) +{ + IN(A,BC, /*rd*/5); + T_WAIT_UNTIL(8); + return; +} + +/*OUT (C),A*/ +static void op_ED_0x79(Z80EX_CONTEXT *cpu) +{ + OUT(BC,A, /*wr*/5); + T_WAIT_UNTIL(8); + return; +} + +/*ADC HL,SP*/ +static void op_ED_0x7a(Z80EX_CONTEXT *cpu) +{ + ADC16(HL,SP); + T_WAIT_UNTIL(11); + return; +} + +/*LD SP,(@)*/ +static void op_ED_0x7b(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(SP,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*NEG*/ +static void op_ED_0x7c(Z80EX_CONTEXT *cpu) +{ + NEG(); + T_WAIT_UNTIL(4); + return; +} + +/*RETI*/ +static void op_ED_0x7d(Z80EX_CONTEXT *cpu) +{ + RETI(/*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*IM 2*/ +static void op_ED_0x7e(Z80EX_CONTEXT *cpu) +{ + IM_(IM2); + T_WAIT_UNTIL(4); + return; +} + +/*LDI*/ +static void op_ED_0xa0(Z80EX_CONTEXT *cpu) +{ + LDI(/*rd*/4, /*wr*/7); + T_WAIT_UNTIL(12); + return; +} + +/*CPI*/ +static void op_ED_0xa1(Z80EX_CONTEXT *cpu) +{ + CPI(/*rd*/4); + T_WAIT_UNTIL(12); + return; +} + +/*INI*/ +static void op_ED_0xa2(Z80EX_CONTEXT *cpu) +{ + INI(/*rd*/6, /*wr*/9); + T_WAIT_UNTIL(12); + return; +} + +/*OUTI*/ +static void op_ED_0xa3(Z80EX_CONTEXT *cpu) +{ + OUTI(/*rd*/5, /*wr*/9); + T_WAIT_UNTIL(12); + return; +} + +/*LDD*/ +static void op_ED_0xa8(Z80EX_CONTEXT *cpu) +{ + LDD(/*rd*/4, /*wr*/7); + T_WAIT_UNTIL(12); + return; +} + +/*CPD*/ +static void op_ED_0xa9(Z80EX_CONTEXT *cpu) +{ + CPD(/*rd*/4); + T_WAIT_UNTIL(12); + return; +} + +/*IND*/ +static void op_ED_0xaa(Z80EX_CONTEXT *cpu) +{ + IND(/*rd*/6, /*wr*/9); + T_WAIT_UNTIL(12); + return; +} + +/*OUTD*/ +static void op_ED_0xab(Z80EX_CONTEXT *cpu) +{ + OUTD(/*rd*/5, /*wr*/9); + T_WAIT_UNTIL(12); + return; +} + +/*LDIR*/ +static void op_ED_0xb0(Z80EX_CONTEXT *cpu) +{ + LDIR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/4, /*wr*/7); + return; +} + +/*CPIR*/ +static void op_ED_0xb1(Z80EX_CONTEXT *cpu) +{ + CPIR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/4); + return; +} + +/*INIR*/ +static void op_ED_0xb2(Z80EX_CONTEXT *cpu) +{ + INIR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/6, /*wr*/9); + return; +} + +/*OTIR*/ +static void op_ED_0xb3(Z80EX_CONTEXT *cpu) +{ + OTIR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/5, /*wr*/9); + return; +} + +/*LDDR*/ +static void op_ED_0xb8(Z80EX_CONTEXT *cpu) +{ + LDDR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/4, /*wr*/7); + return; +} + +/*CPDR*/ +static void op_ED_0xb9(Z80EX_CONTEXT *cpu) +{ + CPDR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/4); + return; +} + +/*INDR*/ +static void op_ED_0xba(Z80EX_CONTEXT *cpu) +{ + INDR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/6, /*wr*/9); + return; +} + +/*OTDR*/ +static void op_ED_0xbb(Z80EX_CONTEXT *cpu) +{ + OTDR(/*t:*/ /*t1*/12,/*t2*/17, /*rd*/5, /*wr*/9); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_ed[0x100] = { + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + op_ED_0x40 , op_ED_0x41 , op_ED_0x42 , op_ED_0x43 , + op_ED_0x44 , op_ED_0x45 , op_ED_0x46 , op_ED_0x47 , + op_ED_0x48 , op_ED_0x49 , op_ED_0x4a , op_ED_0x4b , + op_ED_0x4c , op_ED_0x4d , op_ED_0x4e , op_ED_0x4f , + op_ED_0x50 , op_ED_0x51 , op_ED_0x52 , op_ED_0x53 , + op_ED_0x54 , op_ED_0x55 , op_ED_0x56 , op_ED_0x57 , + op_ED_0x58 , op_ED_0x59 , op_ED_0x5a , op_ED_0x5b , + op_ED_0x5c , op_ED_0x5d , op_ED_0x5e , op_ED_0x5f , + op_ED_0x60 , op_ED_0x61 , op_ED_0x62 , op_ED_0x63 , + op_ED_0x64 , op_ED_0x65 , op_ED_0x66 , op_ED_0x67 , + op_ED_0x68 , op_ED_0x69 , op_ED_0x6a , op_ED_0x6b , + op_ED_0x6c , op_ED_0x6d , op_ED_0x6e , op_ED_0x6f , + op_ED_0x70 , op_ED_0x71 , op_ED_0x72 , op_ED_0x73 , + op_ED_0x74 , op_ED_0x75 , op_ED_0x76 , NULL , + op_ED_0x78 , op_ED_0x79 , op_ED_0x7a , op_ED_0x7b , + op_ED_0x7c , op_ED_0x7d , op_ED_0x7e , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + op_ED_0xa0 , op_ED_0xa1 , op_ED_0xa2 , op_ED_0xa3 , + NULL , NULL , NULL , NULL , + op_ED_0xa8 , op_ED_0xa9 , op_ED_0xaa , op_ED_0xab , + NULL , NULL , NULL , NULL , + op_ED_0xb0 , op_ED_0xb1 , op_ED_0xb2 , op_ED_0xb3 , + NULL , NULL , NULL , NULL , + op_ED_0xb8 , op_ED_0xb9 , op_ED_0xba , op_ED_0xbb , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL +}; diff --git a/third_party/z80ex/opcodes/opcodes_fd.c b/third_party/z80ex/opcodes/opcodes_fd.c new file mode 100644 index 00000000..b4496b97 --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_fd.c @@ -0,0 +1,871 @@ +/* autogenerated from ./opcodes_ddfd.dat, do not edit */ + +/*ADD IY,BC*/ +static void op_FD_0x09(Z80EX_CONTEXT *cpu) +{ + ADD16(IY,BC); + T_WAIT_UNTIL(11); + return; +} + +/*ADD IY,DE*/ +static void op_FD_0x19(Z80EX_CONTEXT *cpu) +{ + ADD16(IY,DE); + T_WAIT_UNTIL(11); + return; +} + +/*LD IY,@*/ +static void op_FD_0x21(Z80EX_CONTEXT *cpu) +{ + temp_word.b.l=READ_OP(); + temp_word.b.h=READ_OP(); + LD16(IY,temp_word.w); + T_WAIT_UNTIL(10); + return; +} + +/*LD (@),IY*/ +static void op_FD_0x22(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + LD_RP_TO_ADDR_MPTR_16(temp_word.w,IY, temp_addr.w); + WRITE_MEM(temp_addr.w,temp_word.b.l,10); + WRITE_MEM(temp_addr.w+1,temp_word.b.h,13); + T_WAIT_UNTIL(16); + return; +} + +/*INC IY*/ +static void op_FD_0x23(Z80EX_CONTEXT *cpu) +{ + INC16(IY); + T_WAIT_UNTIL(6); + return; +} + +/*INC IYH*/ +static void op_FD_0x24(Z80EX_CONTEXT *cpu) +{ + INC(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*DEC IYH*/ +static void op_FD_0x25(Z80EX_CONTEXT *cpu) +{ + DEC(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYH,#*/ +static void op_FD_0x26(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(IYH,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*ADD IY,IY*/ +static void op_FD_0x29(Z80EX_CONTEXT *cpu) +{ + ADD16(IY,IY); + T_WAIT_UNTIL(11); + return; +} + +/*LD IY,(@)*/ +static void op_FD_0x2a(Z80EX_CONTEXT *cpu) +{ + temp_addr.b.l=READ_OP(); + temp_addr.b.h=READ_OP(); + READ_MEM(temp_word.b.l,temp_addr.w,10); + READ_MEM(temp_word.b.h,temp_addr.w+1,13); + LD_RP_FROM_ADDR_MPTR_16(IY,temp_word.w, temp_addr.w); + T_WAIT_UNTIL(16); + return; +} + +/*DEC IY*/ +static void op_FD_0x2b(Z80EX_CONTEXT *cpu) +{ + DEC16(IY); + T_WAIT_UNTIL(6); + return; +} + +/*INC IYL*/ +static void op_FD_0x2c(Z80EX_CONTEXT *cpu) +{ + INC(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*DEC IYL*/ +static void op_FD_0x2d(Z80EX_CONTEXT *cpu) +{ + DEC(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,#*/ +static void op_FD_0x2e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + LD(IYL,temp_byte); + T_WAIT_UNTIL(7); + return; +} + +/*INC (IY+$)*/ +static void op_FD_0x34(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + INC(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*DEC (IY+$)*/ +static void op_FD_0x35(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + DEC(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD (IY+$),#*/ +static void op_FD_0x36(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + temp_byte=READ_OP(); + LD(temp_byte,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*ADD IY,SP*/ +static void op_FD_0x39(Z80EX_CONTEXT *cpu) +{ + ADD16(IY,SP); + T_WAIT_UNTIL(11); + return; +} + +/*LD B,IYH*/ +static void op_FD_0x44(Z80EX_CONTEXT *cpu) +{ + LD(B,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,IYL*/ +static void op_FD_0x45(Z80EX_CONTEXT *cpu) +{ + LD(B,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD B,(IY+$)*/ +static void op_FD_0x46(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(B,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD C,IYH*/ +static void op_FD_0x4c(Z80EX_CONTEXT *cpu) +{ + LD(C,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,IYL*/ +static void op_FD_0x4d(Z80EX_CONTEXT *cpu) +{ + LD(C,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD C,(IY+$)*/ +static void op_FD_0x4e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(C,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD D,IYH*/ +static void op_FD_0x54(Z80EX_CONTEXT *cpu) +{ + LD(D,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,IYL*/ +static void op_FD_0x55(Z80EX_CONTEXT *cpu) +{ + LD(D,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD D,(IY+$)*/ +static void op_FD_0x56(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(D,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD E,IYH*/ +static void op_FD_0x5c(Z80EX_CONTEXT *cpu) +{ + LD(E,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,IYL*/ +static void op_FD_0x5d(Z80EX_CONTEXT *cpu) +{ + LD(E,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD E,(IY+$)*/ +static void op_FD_0x5e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(E,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD IYH,B*/ +static void op_FD_0x60(Z80EX_CONTEXT *cpu) +{ + LD(IYH,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYH,C*/ +static void op_FD_0x61(Z80EX_CONTEXT *cpu) +{ + LD(IYH,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYH,D*/ +static void op_FD_0x62(Z80EX_CONTEXT *cpu) +{ + LD(IYH,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYH,E*/ +static void op_FD_0x63(Z80EX_CONTEXT *cpu) +{ + LD(IYH,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYH,IYH*/ +static void op_FD_0x64(Z80EX_CONTEXT *cpu) +{ + LD(IYH,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYH,IYL*/ +static void op_FD_0x65(Z80EX_CONTEXT *cpu) +{ + LD(IYH,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD H,(IY+$)*/ +static void op_FD_0x66(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(H,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD IYH,A*/ +static void op_FD_0x67(Z80EX_CONTEXT *cpu) +{ + LD(IYH,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,B*/ +static void op_FD_0x68(Z80EX_CONTEXT *cpu) +{ + LD(IYL,B); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,C*/ +static void op_FD_0x69(Z80EX_CONTEXT *cpu) +{ + LD(IYL,C); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,D*/ +static void op_FD_0x6a(Z80EX_CONTEXT *cpu) +{ + LD(IYL,D); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,E*/ +static void op_FD_0x6b(Z80EX_CONTEXT *cpu) +{ + LD(IYL,E); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,IYH*/ +static void op_FD_0x6c(Z80EX_CONTEXT *cpu) +{ + LD(IYL,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD IYL,IYL*/ +static void op_FD_0x6d(Z80EX_CONTEXT *cpu) +{ + LD(IYL,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD L,(IY+$)*/ +static void op_FD_0x6e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(L,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*LD IYL,A*/ +static void op_FD_0x6f(Z80EX_CONTEXT *cpu) +{ + LD(IYL,A); + T_WAIT_UNTIL(4); + return; +} + +/*LD (IY+$),B*/ +static void op_FD_0x70(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,B); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IY+$),C*/ +static void op_FD_0x71(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,C); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IY+$),D*/ +static void op_FD_0x72(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,D); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IY+$),E*/ +static void op_FD_0x73(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,E); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IY+$),H*/ +static void op_FD_0x74(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,H); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IY+$),L*/ +static void op_FD_0x75(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,L); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD (IY+$),A*/ +static void op_FD_0x77(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + LD(temp_byte,A); + WRITE_MEM((IY+temp_byte_s),temp_byte,12); + T_WAIT_UNTIL(15); + return; +} + +/*LD A,IYH*/ +static void op_FD_0x7c(Z80EX_CONTEXT *cpu) +{ + LD(A,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,IYL*/ +static void op_FD_0x7d(Z80EX_CONTEXT *cpu) +{ + LD(A,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*LD A,(IY+$)*/ +static void op_FD_0x7e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + LD(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*ADD A,IYH*/ +static void op_FD_0x84(Z80EX_CONTEXT *cpu) +{ + ADD(A,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,IYL*/ +static void op_FD_0x85(Z80EX_CONTEXT *cpu) +{ + ADD(A,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*ADD A,(IY+$)*/ +static void op_FD_0x86(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + ADD(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*ADC A,IYH*/ +static void op_FD_0x8c(Z80EX_CONTEXT *cpu) +{ + ADC(A,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,IYL*/ +static void op_FD_0x8d(Z80EX_CONTEXT *cpu) +{ + ADC(A,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*ADC A,(IY+$)*/ +static void op_FD_0x8e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + ADC(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*SUB IYH*/ +static void op_FD_0x94(Z80EX_CONTEXT *cpu) +{ + SUB(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*SUB IYL*/ +static void op_FD_0x95(Z80EX_CONTEXT *cpu) +{ + SUB(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*SUB (IY+$)*/ +static void op_FD_0x96(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SUB(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*SBC A,IYH*/ +static void op_FD_0x9c(Z80EX_CONTEXT *cpu) +{ + SBC(A,IYH); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,IYL*/ +static void op_FD_0x9d(Z80EX_CONTEXT *cpu) +{ + SBC(A,IYL); + T_WAIT_UNTIL(4); + return; +} + +/*SBC A,(IY+$)*/ +static void op_FD_0x9e(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SBC(A,temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*AND IYH*/ +static void op_FD_0xa4(Z80EX_CONTEXT *cpu) +{ + AND(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*AND IYL*/ +static void op_FD_0xa5(Z80EX_CONTEXT *cpu) +{ + AND(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*AND (IY+$)*/ +static void op_FD_0xa6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + AND(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*XOR IYH*/ +static void op_FD_0xac(Z80EX_CONTEXT *cpu) +{ + XOR(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*XOR IYL*/ +static void op_FD_0xad(Z80EX_CONTEXT *cpu) +{ + XOR(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*XOR (IY+$)*/ +static void op_FD_0xae(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + XOR(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*OR IYH*/ +static void op_FD_0xb4(Z80EX_CONTEXT *cpu) +{ + OR(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*OR IYL*/ +static void op_FD_0xb5(Z80EX_CONTEXT *cpu) +{ + OR(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*OR (IY+$)*/ +static void op_FD_0xb6(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + OR(temp_byte); + T_WAIT_UNTIL(15); + return; +} + +/*CP IYH*/ +static void op_FD_0xbc(Z80EX_CONTEXT *cpu) +{ + CP(IYH); + T_WAIT_UNTIL(4); + return; +} + +/*CP IYL*/ +static void op_FD_0xbd(Z80EX_CONTEXT *cpu) +{ + CP(IYL); + T_WAIT_UNTIL(4); + return; +} + +/*CP (IY+$)*/ +static void op_FD_0xbe(Z80EX_CONTEXT *cpu) +{ + temp_byte=READ_OP(); + temp_byte_s=(temp_byte & 0x80)? -(((~temp_byte) & 0x7f)+1): temp_byte; + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + CP(temp_byte); + T_WAIT_UNTIL(15); + return; +} + + +/*POP IY*/ +static void op_FD_0xe1(Z80EX_CONTEXT *cpu) +{ + POP(IY, /*rd*/4,7); + T_WAIT_UNTIL(10); + return; +} + +/*EX (SP),IY*/ +static void op_FD_0xe3(Z80EX_CONTEXT *cpu) +{ + READ_MEM(temp_word.b.l,(SP),4); + READ_MEM(temp_word.b.h,(SP+1),7); + EX_MPTR(temp_word.w,IY); + WRITE_MEM((SP),temp_word.b.l,11); + WRITE_MEM((SP+1),temp_word.b.h,14); + T_WAIT_UNTIL(19); + return; +} + +/*PUSH IY*/ +static void op_FD_0xe5(Z80EX_CONTEXT *cpu) +{ + PUSH(IY, /*wr*/5,8); + T_WAIT_UNTIL(11); + return; +} + +/*JP IY*/ +static void op_FD_0xe9(Z80EX_CONTEXT *cpu) +{ + JP_NO_MPTR(IY); + T_WAIT_UNTIL(4); + return; +} + +/*LD SP,IY*/ +static void op_FD_0xf9(Z80EX_CONTEXT *cpu) +{ + LD16(SP,IY); + T_WAIT_UNTIL(6); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_fd[0x100] = { + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_FD_0x09 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_FD_0x19 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_FD_0x21 , op_FD_0x22 , op_FD_0x23 , + op_FD_0x24 , op_FD_0x25 , op_FD_0x26 , NULL , + NULL , op_FD_0x29 , op_FD_0x2a , op_FD_0x2b , + op_FD_0x2c , op_FD_0x2d , op_FD_0x2e , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x34 , op_FD_0x35 , op_FD_0x36 , NULL , + NULL , op_FD_0x39 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x44 , op_FD_0x45 , op_FD_0x46 , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x4c , op_FD_0x4d , op_FD_0x4e , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x54 , op_FD_0x55 , op_FD_0x56 , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x5c , op_FD_0x5d , op_FD_0x5e , NULL , + op_FD_0x60 , op_FD_0x61 , op_FD_0x62 , op_FD_0x63 , + op_FD_0x64 , op_FD_0x65 , op_FD_0x66 , op_FD_0x67 , + op_FD_0x68 , op_FD_0x69 , op_FD_0x6a , op_FD_0x6b , + op_FD_0x6c , op_FD_0x6d , op_FD_0x6e , op_FD_0x6f , + op_FD_0x70 , op_FD_0x71 , op_FD_0x72 , op_FD_0x73 , + op_FD_0x74 , op_FD_0x75 , NULL , op_FD_0x77 , + NULL , NULL , NULL , NULL , + op_FD_0x7c , op_FD_0x7d , op_FD_0x7e , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x84 , op_FD_0x85 , op_FD_0x86 , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x8c , op_FD_0x8d , op_FD_0x8e , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x94 , op_FD_0x95 , op_FD_0x96 , NULL , + NULL , NULL , NULL , NULL , + op_FD_0x9c , op_FD_0x9d , op_FD_0x9e , NULL , + NULL , NULL , NULL , NULL , + op_FD_0xa4 , op_FD_0xa5 , op_FD_0xa6 , NULL , + NULL , NULL , NULL , NULL , + op_FD_0xac , op_FD_0xad , op_FD_0xae , NULL , + NULL , NULL , NULL , NULL , + op_FD_0xb4 , op_FD_0xb5 , op_FD_0xb6 , NULL , + NULL , NULL , NULL , NULL , + op_FD_0xbc , op_FD_0xbd , op_FD_0xbe , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_FD_0xe1 , NULL , op_FD_0xe3 , + NULL , op_FD_0xe5 , NULL , NULL , + NULL , op_FD_0xe9 , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , NULL , NULL , NULL , + NULL , op_FD_0xf9 , NULL , NULL , + NULL , NULL , NULL , NULL +}; diff --git a/third_party/z80ex/opcodes/opcodes_fdcb.c b/third_party/z80ex/opcodes/opcodes_fdcb.c new file mode 100644 index 00000000..1228dd19 --- /dev/null +++ b/third_party/z80ex/opcodes/opcodes_fdcb.c @@ -0,0 +1,2431 @@ +/* autogenerated from ./opcodes_ddfdcb.dat, do not edit */ + +/*LD B,RLC (IY+$)*/ +static void op_FDCB_0x00(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RLC (IY+$)*/ +static void op_FDCB_0x01(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RLC (IY+$)*/ +static void op_FDCB_0x02(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RLC (IY+$)*/ +static void op_FDCB_0x03(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RLC (IY+$)*/ +static void op_FDCB_0x04(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RLC (IY+$)*/ +static void op_FDCB_0x05(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RLC (IY+$)*/ +static void op_FDCB_0x06(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RLC (IY+$)*/ +static void op_FDCB_0x07(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RLC(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RRC (IY+$)*/ +static void op_FDCB_0x08(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RRC (IY+$)*/ +static void op_FDCB_0x09(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RRC (IY+$)*/ +static void op_FDCB_0x0a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RRC (IY+$)*/ +static void op_FDCB_0x0b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RRC (IY+$)*/ +static void op_FDCB_0x0c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RRC (IY+$)*/ +static void op_FDCB_0x0d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RRC (IY+$)*/ +static void op_FDCB_0x0e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RRC (IY+$)*/ +static void op_FDCB_0x0f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RRC(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RL (IY+$)*/ +static void op_FDCB_0x10(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RL (IY+$)*/ +static void op_FDCB_0x11(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RL (IY+$)*/ +static void op_FDCB_0x12(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RL (IY+$)*/ +static void op_FDCB_0x13(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RL (IY+$)*/ +static void op_FDCB_0x14(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RL (IY+$)*/ +static void op_FDCB_0x15(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RL (IY+$)*/ +static void op_FDCB_0x16(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RL (IY+$)*/ +static void op_FDCB_0x17(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RL(temp_byte); + LD16(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RR (IY+$)*/ +static void op_FDCB_0x18(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RR (IY+$)*/ +static void op_FDCB_0x19(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RR (IY+$)*/ +static void op_FDCB_0x1a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RR (IY+$)*/ +static void op_FDCB_0x1b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RR (IY+$)*/ +static void op_FDCB_0x1c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RR (IY+$)*/ +static void op_FDCB_0x1d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RR (IY+$)*/ +static void op_FDCB_0x1e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RR (IY+$)*/ +static void op_FDCB_0x1f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RR(temp_byte); + LD16(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SLA (IY+$)*/ +static void op_FDCB_0x20(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SLA (IY+$)*/ +static void op_FDCB_0x21(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SLA (IY+$)*/ +static void op_FDCB_0x22(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SLA (IY+$)*/ +static void op_FDCB_0x23(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SLA (IY+$)*/ +static void op_FDCB_0x24(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SLA (IY+$)*/ +static void op_FDCB_0x25(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SLA (IY+$)*/ +static void op_FDCB_0x26(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SLA (IY+$)*/ +static void op_FDCB_0x27(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLA(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SRA (IY+$)*/ +static void op_FDCB_0x28(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SRA (IY+$)*/ +static void op_FDCB_0x29(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SRA (IY+$)*/ +static void op_FDCB_0x2a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SRA (IY+$)*/ +static void op_FDCB_0x2b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SRA (IY+$)*/ +static void op_FDCB_0x2c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SRA (IY+$)*/ +static void op_FDCB_0x2d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SRA (IY+$)*/ +static void op_FDCB_0x2e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SRA (IY+$)*/ +static void op_FDCB_0x2f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRA(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SLL (IY+$)*/ +static void op_FDCB_0x30(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SLL (IY+$)*/ +static void op_FDCB_0x31(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SLL (IY+$)*/ +static void op_FDCB_0x32(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SLL (IY+$)*/ +static void op_FDCB_0x33(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SLL (IY+$)*/ +static void op_FDCB_0x34(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SLL (IY+$)*/ +static void op_FDCB_0x35(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SLL (IY+$)*/ +static void op_FDCB_0x36(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SLL (IY+$)*/ +static void op_FDCB_0x37(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SLL(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SRL (IY+$)*/ +static void op_FDCB_0x38(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SRL (IY+$)*/ +static void op_FDCB_0x39(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SRL (IY+$)*/ +static void op_FDCB_0x3a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SRL (IY+$)*/ +static void op_FDCB_0x3b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SRL (IY+$)*/ +static void op_FDCB_0x3c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SRL (IY+$)*/ +static void op_FDCB_0x3d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SRL (IY+$)*/ +static void op_FDCB_0x3e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SRL (IY+$)*/ +static void op_FDCB_0x3f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SRL(temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*BIT 0,(IY+$)*/ +static void op_FDCB_0x47(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(0,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 1,(IY+$)*/ +static void op_FDCB_0x4f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(1,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 2,(IY+$)*/ +static void op_FDCB_0x57(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(2,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 3,(IY+$)*/ +static void op_FDCB_0x5f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(3,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 4,(IY+$)*/ +static void op_FDCB_0x67(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(4,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 5,(IY+$)*/ +static void op_FDCB_0x6f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(5,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 6,(IY+$)*/ +static void op_FDCB_0x77(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(6,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*BIT 7,(IY+$)*/ +static void op_FDCB_0x7f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + BIT_MPTR(7,temp_byte); + T_WAIT_UNTIL(16); + return; +} + +/*LD B,RES 0,(IY+$)*/ +static void op_FDCB_0x80(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 0,(IY+$)*/ +static void op_FDCB_0x81(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 0,(IY+$)*/ +static void op_FDCB_0x82(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 0,(IY+$)*/ +static void op_FDCB_0x83(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 0,(IY+$)*/ +static void op_FDCB_0x84(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 0,(IY+$)*/ +static void op_FDCB_0x85(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 0,(IY+$)*/ +static void op_FDCB_0x86(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 0,(IY+$)*/ +static void op_FDCB_0x87(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(0,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 1,(IY+$)*/ +static void op_FDCB_0x88(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 1,(IY+$)*/ +static void op_FDCB_0x89(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 1,(IY+$)*/ +static void op_FDCB_0x8a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 1,(IY+$)*/ +static void op_FDCB_0x8b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 1,(IY+$)*/ +static void op_FDCB_0x8c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 1,(IY+$)*/ +static void op_FDCB_0x8d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 1,(IY+$)*/ +static void op_FDCB_0x8e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 1,(IY+$)*/ +static void op_FDCB_0x8f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(1,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 2,(IY+$)*/ +static void op_FDCB_0x90(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 2,(IY+$)*/ +static void op_FDCB_0x91(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 2,(IY+$)*/ +static void op_FDCB_0x92(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 2,(IY+$)*/ +static void op_FDCB_0x93(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 2,(IY+$)*/ +static void op_FDCB_0x94(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 2,(IY+$)*/ +static void op_FDCB_0x95(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 2,(IY+$)*/ +static void op_FDCB_0x96(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 2,(IY+$)*/ +static void op_FDCB_0x97(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(2,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 3,(IY+$)*/ +static void op_FDCB_0x98(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 3,(IY+$)*/ +static void op_FDCB_0x99(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 3,(IY+$)*/ +static void op_FDCB_0x9a(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 3,(IY+$)*/ +static void op_FDCB_0x9b(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 3,(IY+$)*/ +static void op_FDCB_0x9c(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 3,(IY+$)*/ +static void op_FDCB_0x9d(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 3,(IY+$)*/ +static void op_FDCB_0x9e(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 3,(IY+$)*/ +static void op_FDCB_0x9f(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(3,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 4,(IY+$)*/ +static void op_FDCB_0xa0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 4,(IY+$)*/ +static void op_FDCB_0xa1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 4,(IY+$)*/ +static void op_FDCB_0xa2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 4,(IY+$)*/ +static void op_FDCB_0xa3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 4,(IY+$)*/ +static void op_FDCB_0xa4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 4,(IY+$)*/ +static void op_FDCB_0xa5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 4,(IY+$)*/ +static void op_FDCB_0xa6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 4,(IY+$)*/ +static void op_FDCB_0xa7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(4,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 5,(IY+$)*/ +static void op_FDCB_0xa8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 5,(IY+$)*/ +static void op_FDCB_0xa9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 5,(IY+$)*/ +static void op_FDCB_0xaa(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 5,(IY+$)*/ +static void op_FDCB_0xab(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 5,(IY+$)*/ +static void op_FDCB_0xac(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 5,(IY+$)*/ +static void op_FDCB_0xad(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 5,(IY+$)*/ +static void op_FDCB_0xae(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 5,(IY+$)*/ +static void op_FDCB_0xaf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(5,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 6,(IY+$)*/ +static void op_FDCB_0xb0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 6,(IY+$)*/ +static void op_FDCB_0xb1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 6,(IY+$)*/ +static void op_FDCB_0xb2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 6,(IY+$)*/ +static void op_FDCB_0xb3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 6,(IY+$)*/ +static void op_FDCB_0xb4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 6,(IY+$)*/ +static void op_FDCB_0xb5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 6,(IY+$)*/ +static void op_FDCB_0xb6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 6,(IY+$)*/ +static void op_FDCB_0xb7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(6,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,RES 7,(IY+$)*/ +static void op_FDCB_0xb8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,RES 7,(IY+$)*/ +static void op_FDCB_0xb9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,RES 7,(IY+$)*/ +static void op_FDCB_0xba(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,RES 7,(IY+$)*/ +static void op_FDCB_0xbb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,RES 7,(IY+$)*/ +static void op_FDCB_0xbc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,RES 7,(IY+$)*/ +static void op_FDCB_0xbd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*RES 7,(IY+$)*/ +static void op_FDCB_0xbe(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,RES 7,(IY+$)*/ +static void op_FDCB_0xbf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + RES(7,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 0,(IY+$)*/ +static void op_FDCB_0xc0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 0,(IY+$)*/ +static void op_FDCB_0xc1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 0,(IY+$)*/ +static void op_FDCB_0xc2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 0,(IY+$)*/ +static void op_FDCB_0xc3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 0,(IY+$)*/ +static void op_FDCB_0xc4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 0,(IY+$)*/ +static void op_FDCB_0xc5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 0,(IY+$)*/ +static void op_FDCB_0xc6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 0,(IY+$)*/ +static void op_FDCB_0xc7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(0,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 1,(IY+$)*/ +static void op_FDCB_0xc8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 1,(IY+$)*/ +static void op_FDCB_0xc9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 1,(IY+$)*/ +static void op_FDCB_0xca(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 1,(IY+$)*/ +static void op_FDCB_0xcb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 1,(IY+$)*/ +static void op_FDCB_0xcc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 1,(IY+$)*/ +static void op_FDCB_0xcd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 1,(IY+$)*/ +static void op_FDCB_0xce(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 1,(IY+$)*/ +static void op_FDCB_0xcf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(1,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 2,(IY+$)*/ +static void op_FDCB_0xd0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 2,(IY+$)*/ +static void op_FDCB_0xd1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 2,(IY+$)*/ +static void op_FDCB_0xd2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 2,(IY+$)*/ +static void op_FDCB_0xd3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 2,(IY+$)*/ +static void op_FDCB_0xd4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 2,(IY+$)*/ +static void op_FDCB_0xd5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 2,(IY+$)*/ +static void op_FDCB_0xd6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 2,(IY+$)*/ +static void op_FDCB_0xd7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(2,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 3,(IY+$)*/ +static void op_FDCB_0xd8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 3,(IY+$)*/ +static void op_FDCB_0xd9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 3,(IY+$)*/ +static void op_FDCB_0xda(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 3,(IY+$)*/ +static void op_FDCB_0xdb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 3,(IY+$)*/ +static void op_FDCB_0xdc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 3,(IY+$)*/ +static void op_FDCB_0xdd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 3,(IY+$)*/ +static void op_FDCB_0xde(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 3,(IY+$)*/ +static void op_FDCB_0xdf(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(3,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 4,(IY+$)*/ +static void op_FDCB_0xe0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 4,(IY+$)*/ +static void op_FDCB_0xe1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 4,(IY+$)*/ +static void op_FDCB_0xe2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 4,(IY+$)*/ +static void op_FDCB_0xe3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 4,(IY+$)*/ +static void op_FDCB_0xe4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 4,(IY+$)*/ +static void op_FDCB_0xe5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 4,(IY+$)*/ +static void op_FDCB_0xe6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 4,(IY+$)*/ +static void op_FDCB_0xe7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(4,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 5,(IY+$)*/ +static void op_FDCB_0xe8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 5,(IY+$)*/ +static void op_FDCB_0xe9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 5,(IY+$)*/ +static void op_FDCB_0xea(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 5,(IY+$)*/ +static void op_FDCB_0xeb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 5,(IY+$)*/ +static void op_FDCB_0xec(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 5,(IY+$)*/ +static void op_FDCB_0xed(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 5,(IY+$)*/ +static void op_FDCB_0xee(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 5,(IY+$)*/ +static void op_FDCB_0xef(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(5,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 6,(IY+$)*/ +static void op_FDCB_0xf0(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 6,(IY+$)*/ +static void op_FDCB_0xf1(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 6,(IY+$)*/ +static void op_FDCB_0xf2(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 6,(IY+$)*/ +static void op_FDCB_0xf3(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 6,(IY+$)*/ +static void op_FDCB_0xf4(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 6,(IY+$)*/ +static void op_FDCB_0xf5(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 6,(IY+$)*/ +static void op_FDCB_0xf6(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 6,(IY+$)*/ +static void op_FDCB_0xf7(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(6,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD B,SET 7,(IY+$)*/ +static void op_FDCB_0xf8(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(B,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD C,SET 7,(IY+$)*/ +static void op_FDCB_0xf9(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(C,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD D,SET 7,(IY+$)*/ +static void op_FDCB_0xfa(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(D,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD E,SET 7,(IY+$)*/ +static void op_FDCB_0xfb(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(E,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD H,SET 7,(IY+$)*/ +static void op_FDCB_0xfc(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(H,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD L,SET 7,(IY+$)*/ +static void op_FDCB_0xfd(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(L,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*SET 7,(IY+$)*/ +static void op_FDCB_0xfe(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + +/*LD A,SET 7,(IY+$)*/ +static void op_FDCB_0xff(Z80EX_CONTEXT *cpu) +{ + MEMPTR=(IY+temp_byte_s); + READ_MEM(temp_byte,(IY+temp_byte_s),12); + SET(7,temp_byte); + LD(A,temp_byte); + WRITE_MEM((IY+temp_byte_s),temp_byte,16); + T_WAIT_UNTIL(19); + return; +} + + + +/**/ +static const z80ex_opcode_fn opcodes_fdcb[0x100] = { + op_FDCB_0x00 , op_FDCB_0x01 , op_FDCB_0x02 , op_FDCB_0x03 , + op_FDCB_0x04 , op_FDCB_0x05 , op_FDCB_0x06 , op_FDCB_0x07 , + op_FDCB_0x08 , op_FDCB_0x09 , op_FDCB_0x0a , op_FDCB_0x0b , + op_FDCB_0x0c , op_FDCB_0x0d , op_FDCB_0x0e , op_FDCB_0x0f , + op_FDCB_0x10 , op_FDCB_0x11 , op_FDCB_0x12 , op_FDCB_0x13 , + op_FDCB_0x14 , op_FDCB_0x15 , op_FDCB_0x16 , op_FDCB_0x17 , + op_FDCB_0x18 , op_FDCB_0x19 , op_FDCB_0x1a , op_FDCB_0x1b , + op_FDCB_0x1c , op_FDCB_0x1d , op_FDCB_0x1e , op_FDCB_0x1f , + op_FDCB_0x20 , op_FDCB_0x21 , op_FDCB_0x22 , op_FDCB_0x23 , + op_FDCB_0x24 , op_FDCB_0x25 , op_FDCB_0x26 , op_FDCB_0x27 , + op_FDCB_0x28 , op_FDCB_0x29 , op_FDCB_0x2a , op_FDCB_0x2b , + op_FDCB_0x2c , op_FDCB_0x2d , op_FDCB_0x2e , op_FDCB_0x2f , + op_FDCB_0x30 , op_FDCB_0x31 , op_FDCB_0x32 , op_FDCB_0x33 , + op_FDCB_0x34 , op_FDCB_0x35 , op_FDCB_0x36 , op_FDCB_0x37 , + op_FDCB_0x38 , op_FDCB_0x39 , op_FDCB_0x3a , op_FDCB_0x3b , + op_FDCB_0x3c , op_FDCB_0x3d , op_FDCB_0x3e , op_FDCB_0x3f , + op_FDCB_0x47 , op_FDCB_0x47 , op_FDCB_0x47 , op_FDCB_0x47 , + op_FDCB_0x47 , op_FDCB_0x47 , op_FDCB_0x47 , op_FDCB_0x47 , + op_FDCB_0x4f , op_FDCB_0x4f , op_FDCB_0x4f , op_FDCB_0x4f , + op_FDCB_0x4f , op_FDCB_0x4f , op_FDCB_0x4f , op_FDCB_0x4f , + op_FDCB_0x57 , op_FDCB_0x57 , op_FDCB_0x57 , op_FDCB_0x57 , + op_FDCB_0x57 , op_FDCB_0x57 , op_FDCB_0x57 , op_FDCB_0x57 , + op_FDCB_0x5f , op_FDCB_0x5f , op_FDCB_0x5f , op_FDCB_0x5f , + op_FDCB_0x5f , op_FDCB_0x5f , op_FDCB_0x5f , op_FDCB_0x5f , + op_FDCB_0x67 , op_FDCB_0x67 , op_FDCB_0x67 , op_FDCB_0x67 , + op_FDCB_0x67 , op_FDCB_0x67 , op_FDCB_0x67 , op_FDCB_0x67 , + op_FDCB_0x6f , op_FDCB_0x6f , op_FDCB_0x6f , op_FDCB_0x6f , + op_FDCB_0x6f , op_FDCB_0x6f , op_FDCB_0x6f , op_FDCB_0x6f , + op_FDCB_0x77 , op_FDCB_0x77 , op_FDCB_0x77 , op_FDCB_0x77 , + op_FDCB_0x77 , op_FDCB_0x77 , op_FDCB_0x77 , op_FDCB_0x77 , + op_FDCB_0x7f , op_FDCB_0x7f , op_FDCB_0x7f , op_FDCB_0x7f , + op_FDCB_0x7f , op_FDCB_0x7f , op_FDCB_0x7f , op_FDCB_0x7f , + op_FDCB_0x80 , op_FDCB_0x81 , op_FDCB_0x82 , op_FDCB_0x83 , + op_FDCB_0x84 , op_FDCB_0x85 , op_FDCB_0x86 , op_FDCB_0x87 , + op_FDCB_0x88 , op_FDCB_0x89 , op_FDCB_0x8a , op_FDCB_0x8b , + op_FDCB_0x8c , op_FDCB_0x8d , op_FDCB_0x8e , op_FDCB_0x8f , + op_FDCB_0x90 , op_FDCB_0x91 , op_FDCB_0x92 , op_FDCB_0x93 , + op_FDCB_0x94 , op_FDCB_0x95 , op_FDCB_0x96 , op_FDCB_0x97 , + op_FDCB_0x98 , op_FDCB_0x99 , op_FDCB_0x9a , op_FDCB_0x9b , + op_FDCB_0x9c , op_FDCB_0x9d , op_FDCB_0x9e , op_FDCB_0x9f , + op_FDCB_0xa0 , op_FDCB_0xa1 , op_FDCB_0xa2 , op_FDCB_0xa3 , + op_FDCB_0xa4 , op_FDCB_0xa5 , op_FDCB_0xa6 , op_FDCB_0xa7 , + op_FDCB_0xa8 , op_FDCB_0xa9 , op_FDCB_0xaa , op_FDCB_0xab , + op_FDCB_0xac , op_FDCB_0xad , op_FDCB_0xae , op_FDCB_0xaf , + op_FDCB_0xb0 , op_FDCB_0xb1 , op_FDCB_0xb2 , op_FDCB_0xb3 , + op_FDCB_0xb4 , op_FDCB_0xb5 , op_FDCB_0xb6 , op_FDCB_0xb7 , + op_FDCB_0xb8 , op_FDCB_0xb9 , op_FDCB_0xba , op_FDCB_0xbb , + op_FDCB_0xbc , op_FDCB_0xbd , op_FDCB_0xbe , op_FDCB_0xbf , + op_FDCB_0xc0 , op_FDCB_0xc1 , op_FDCB_0xc2 , op_FDCB_0xc3 , + op_FDCB_0xc4 , op_FDCB_0xc5 , op_FDCB_0xc6 , op_FDCB_0xc7 , + op_FDCB_0xc8 , op_FDCB_0xc9 , op_FDCB_0xca , op_FDCB_0xcb , + op_FDCB_0xcc , op_FDCB_0xcd , op_FDCB_0xce , op_FDCB_0xcf , + op_FDCB_0xd0 , op_FDCB_0xd1 , op_FDCB_0xd2 , op_FDCB_0xd3 , + op_FDCB_0xd4 , op_FDCB_0xd5 , op_FDCB_0xd6 , op_FDCB_0xd7 , + op_FDCB_0xd8 , op_FDCB_0xd9 , op_FDCB_0xda , op_FDCB_0xdb , + op_FDCB_0xdc , op_FDCB_0xdd , op_FDCB_0xde , op_FDCB_0xdf , + op_FDCB_0xe0 , op_FDCB_0xe1 , op_FDCB_0xe2 , op_FDCB_0xe3 , + op_FDCB_0xe4 , op_FDCB_0xe5 , op_FDCB_0xe6 , op_FDCB_0xe7 , + op_FDCB_0xe8 , op_FDCB_0xe9 , op_FDCB_0xea , op_FDCB_0xeb , + op_FDCB_0xec , op_FDCB_0xed , op_FDCB_0xee , op_FDCB_0xef , + op_FDCB_0xf0 , op_FDCB_0xf1 , op_FDCB_0xf2 , op_FDCB_0xf3 , + op_FDCB_0xf4 , op_FDCB_0xf5 , op_FDCB_0xf6 , op_FDCB_0xf7 , + op_FDCB_0xf8 , op_FDCB_0xf9 , op_FDCB_0xfa , op_FDCB_0xfb , + op_FDCB_0xfc , op_FDCB_0xfd , op_FDCB_0xfe , op_FDCB_0xff +}; diff --git a/third_party/z80ex/ptables.c b/third_party/z80ex/ptables.c new file mode 100644 index 00000000..f81e1301 --- /dev/null +++ b/third_party/z80ex/ptables.c @@ -0,0 +1,656 @@ +/* Whether a half carry occured or not can be determined by looking at +the 3rd bit of the two arguments and the result; these are hashed +into this table in the form r12, where r is the 3rd bit of the +result, 1 is the 3rd bit of the 1st argument and 2 is the +third bit of the 2nd argument; the tables differ for add and subtract +operations */ +static const Z80EX_BYTE halfcarry_add_table[] = +{ + 0, FLAG_H, FLAG_H, FLAG_H, 0, 0, 0, FLAG_H +}; +static const Z80EX_BYTE halfcarry_sub_table[] = +{ + 0, 0, FLAG_H, 0, FLAG_H, 0, FLAG_H, FLAG_H +}; + +/* Similarly, overflow can be determined by looking at the 7th bits; again +the hash into this table is r12 */ +static const Z80EX_BYTE overflow_add_table[] = +{ + 0, 0, 0, FLAG_V, FLAG_V, 0, 0, 0 +}; +static const Z80EX_BYTE overflow_sub_table[] = +{ + 0, FLAG_V, 0, 0, 0, 0, FLAG_V, 0 +}; + +/* The S, Z, 5 and 3 bits of the index */ +static const Z80EX_BYTE sz53_table[0x100] = +{ + 0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 + ,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 + ,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28 + ,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 + ,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 + ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 + ,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08 + ,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 + ,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28 + ,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20 + ,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28 + ,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 + ,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88 + ,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 + ,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88 + ,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0 + ,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8 + ,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0 + ,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8 + ,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 + ,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88 + ,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80 + ,0x88,0x88,0x88,0x88,0x88,0x88,0x88,0x88 + ,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0 + ,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8 + ,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0 + ,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8,0xa8 + +}; + +/* The parity of the lookup value */ +static const Z80EX_BYTE parity_table[0x100] = +{ + 0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + +}; + +/* OR the above two tables together */ +static const Z80EX_BYTE sz53p_table[0x100] = +{ + 0x44,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x08,0x0c,0x0c,0x08,0x0c,0x08,0x08,0x0c + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x0c,0x08,0x08,0x0c,0x08,0x0c,0x0c,0x08 + ,0x20,0x24,0x24,0x20,0x24,0x20,0x20,0x24 + ,0x2c,0x28,0x28,0x2c,0x28,0x2c,0x2c,0x28 + ,0x24,0x20,0x20,0x24,0x20,0x24,0x24,0x20 + ,0x28,0x2c,0x2c,0x28,0x2c,0x28,0x28,0x2c + ,0x00,0x04,0x04,0x00,0x04,0x00,0x00,0x04 + ,0x0c,0x08,0x08,0x0c,0x08,0x0c,0x0c,0x08 + ,0x04,0x00,0x00,0x04,0x00,0x04,0x04,0x00 + ,0x08,0x0c,0x0c,0x08,0x0c,0x08,0x08,0x0c + ,0x24,0x20,0x20,0x24,0x20,0x24,0x24,0x20 + ,0x28,0x2c,0x2c,0x28,0x2c,0x28,0x28,0x2c + ,0x20,0x24,0x24,0x20,0x24,0x20,0x20,0x24 + ,0x2c,0x28,0x28,0x2c,0x28,0x2c,0x2c,0x28 + ,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84 + ,0x8c,0x88,0x88,0x8c,0x88,0x8c,0x8c,0x88 + ,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80 + ,0x88,0x8c,0x8c,0x88,0x8c,0x88,0x88,0x8c + ,0xa4,0xa0,0xa0,0xa4,0xa0,0xa4,0xa4,0xa0 + ,0xa8,0xac,0xac,0xa8,0xac,0xa8,0xa8,0xac + ,0xa0,0xa4,0xa4,0xa0,0xa4,0xa0,0xa0,0xa4 + ,0xac,0xa8,0xa8,0xac,0xa8,0xac,0xac,0xa8 + ,0x84,0x80,0x80,0x84,0x80,0x84,0x84,0x80 + ,0x88,0x8c,0x8c,0x88,0x8c,0x88,0x88,0x8c + ,0x80,0x84,0x84,0x80,0x84,0x80,0x80,0x84 + ,0x8c,0x88,0x88,0x8c,0x88,0x8c,0x8c,0x88 + ,0xa0,0xa4,0xa4,0xa0,0xa4,0xa0,0xa0,0xa4 + ,0xac,0xa8,0xa8,0xac,0xa8,0xac,0xac,0xa8 + ,0xa4,0xa0,0xa0,0xa4,0xa0,0xa4,0xa4,0xa0 + ,0xa8,0xac,0xac,0xa8,0xac,0xa8,0xa8,0xac + +}; + +/*table for daa, contains af*/ +static const Z80EX_BYTE daatab[0x1000] = +{ + 0x44,0x00,0x00,0x01,0x00,0x02,0x04,0x03 + ,0x00,0x04,0x04,0x05,0x04,0x06,0x00,0x07 + ,0x08,0x08,0x0c,0x09,0x10,0x10,0x14,0x11 + ,0x14,0x12,0x10,0x13,0x14,0x14,0x10,0x15 + ,0x00,0x10,0x04,0x11,0x04,0x12,0x00,0x13 + ,0x04,0x14,0x00,0x15,0x00,0x16,0x04,0x17 + ,0x0c,0x18,0x08,0x19,0x30,0x20,0x34,0x21 + ,0x34,0x22,0x30,0x23,0x34,0x24,0x30,0x25 + ,0x20,0x20,0x24,0x21,0x24,0x22,0x20,0x23 + ,0x24,0x24,0x20,0x25,0x20,0x26,0x24,0x27 + ,0x2c,0x28,0x28,0x29,0x34,0x30,0x30,0x31 + ,0x30,0x32,0x34,0x33,0x30,0x34,0x34,0x35 + ,0x24,0x30,0x20,0x31,0x20,0x32,0x24,0x33 + ,0x20,0x34,0x24,0x35,0x24,0x36,0x20,0x37 + ,0x28,0x38,0x2c,0x39,0x10,0x40,0x14,0x41 + ,0x14,0x42,0x10,0x43,0x14,0x44,0x10,0x45 + ,0x00,0x40,0x04,0x41,0x04,0x42,0x00,0x43 + ,0x04,0x44,0x00,0x45,0x00,0x46,0x04,0x47 + ,0x0c,0x48,0x08,0x49,0x14,0x50,0x10,0x51 + ,0x10,0x52,0x14,0x53,0x10,0x54,0x14,0x55 + ,0x04,0x50,0x00,0x51,0x00,0x52,0x04,0x53 + ,0x00,0x54,0x04,0x55,0x04,0x56,0x00,0x57 + ,0x08,0x58,0x0c,0x59,0x34,0x60,0x30,0x61 + ,0x30,0x62,0x34,0x63,0x30,0x64,0x34,0x65 + ,0x24,0x60,0x20,0x61,0x20,0x62,0x24,0x63 + ,0x20,0x64,0x24,0x65,0x24,0x66,0x20,0x67 + ,0x28,0x68,0x2c,0x69,0x30,0x70,0x34,0x71 + ,0x34,0x72,0x30,0x73,0x34,0x74,0x30,0x75 + ,0x20,0x70,0x24,0x71,0x24,0x72,0x20,0x73 + ,0x24,0x74,0x20,0x75,0x20,0x76,0x24,0x77 + ,0x2c,0x78,0x28,0x79,0x90,0x80,0x94,0x81 + ,0x94,0x82,0x90,0x83,0x94,0x84,0x90,0x85 + ,0x80,0x80,0x84,0x81,0x84,0x82,0x80,0x83 + ,0x84,0x84,0x80,0x85,0x80,0x86,0x84,0x87 + ,0x8c,0x88,0x88,0x89,0x94,0x90,0x90,0x91 + ,0x90,0x92,0x94,0x93,0x90,0x94,0x94,0x95 + ,0x84,0x90,0x80,0x91,0x80,0x92,0x84,0x93 + ,0x80,0x94,0x84,0x95,0x84,0x96,0x80,0x97 + ,0x88,0x98,0x8c,0x99,0x55,0x00,0x11,0x01 + ,0x11,0x02,0x15,0x03,0x11,0x04,0x15,0x05 + ,0x45,0x00,0x01,0x01,0x01,0x02,0x05,0x03 + ,0x01,0x04,0x05,0x05,0x05,0x06,0x01,0x07 + ,0x09,0x08,0x0d,0x09,0x11,0x10,0x15,0x11 + ,0x15,0x12,0x11,0x13,0x15,0x14,0x11,0x15 + ,0x01,0x10,0x05,0x11,0x05,0x12,0x01,0x13 + ,0x05,0x14,0x01,0x15,0x01,0x16,0x05,0x17 + ,0x0d,0x18,0x09,0x19,0x31,0x20,0x35,0x21 + ,0x35,0x22,0x31,0x23,0x35,0x24,0x31,0x25 + ,0x21,0x20,0x25,0x21,0x25,0x22,0x21,0x23 + ,0x25,0x24,0x21,0x25,0x21,0x26,0x25,0x27 + ,0x2d,0x28,0x29,0x29,0x35,0x30,0x31,0x31 + ,0x31,0x32,0x35,0x33,0x31,0x34,0x35,0x35 + ,0x25,0x30,0x21,0x31,0x21,0x32,0x25,0x33 + ,0x21,0x34,0x25,0x35,0x25,0x36,0x21,0x37 + ,0x29,0x38,0x2d,0x39,0x11,0x40,0x15,0x41 + ,0x15,0x42,0x11,0x43,0x15,0x44,0x11,0x45 + ,0x01,0x40,0x05,0x41,0x05,0x42,0x01,0x43 + ,0x05,0x44,0x01,0x45,0x01,0x46,0x05,0x47 + ,0x0d,0x48,0x09,0x49,0x15,0x50,0x11,0x51 + ,0x11,0x52,0x15,0x53,0x11,0x54,0x15,0x55 + ,0x05,0x50,0x01,0x51,0x01,0x52,0x05,0x53 + ,0x01,0x54,0x05,0x55,0x05,0x56,0x01,0x57 + ,0x09,0x58,0x0d,0x59,0x35,0x60,0x31,0x61 + ,0x31,0x62,0x35,0x63,0x31,0x64,0x35,0x65 + ,0x25,0x60,0x21,0x61,0x21,0x62,0x25,0x63 + ,0x21,0x64,0x25,0x65,0x25,0x66,0x21,0x67 + ,0x29,0x68,0x2d,0x69,0x31,0x70,0x35,0x71 + ,0x35,0x72,0x31,0x73,0x35,0x74,0x31,0x75 + ,0x21,0x70,0x25,0x71,0x25,0x72,0x21,0x73 + ,0x25,0x74,0x21,0x75,0x21,0x76,0x25,0x77 + ,0x2d,0x78,0x29,0x79,0x91,0x80,0x95,0x81 + ,0x95,0x82,0x91,0x83,0x95,0x84,0x91,0x85 + ,0x81,0x80,0x85,0x81,0x85,0x82,0x81,0x83 + ,0x85,0x84,0x81,0x85,0x81,0x86,0x85,0x87 + ,0x8d,0x88,0x89,0x89,0x95,0x90,0x91,0x91 + ,0x91,0x92,0x95,0x93,0x91,0x94,0x95,0x95 + ,0x85,0x90,0x81,0x91,0x81,0x92,0x85,0x93 + ,0x81,0x94,0x85,0x95,0x85,0x96,0x81,0x97 + ,0x89,0x98,0x8d,0x99,0xb5,0xa0,0xb1,0xa1 + ,0xb1,0xa2,0xb5,0xa3,0xb1,0xa4,0xb5,0xa5 + ,0xa5,0xa0,0xa1,0xa1,0xa1,0xa2,0xa5,0xa3 + ,0xa1,0xa4,0xa5,0xa5,0xa5,0xa6,0xa1,0xa7 + ,0xa9,0xa8,0xad,0xa9,0xb1,0xb0,0xb5,0xb1 + ,0xb5,0xb2,0xb1,0xb3,0xb5,0xb4,0xb1,0xb5 + ,0xa1,0xb0,0xa5,0xb1,0xa5,0xb2,0xa1,0xb3 + ,0xa5,0xb4,0xa1,0xb5,0xa1,0xb6,0xa5,0xb7 + ,0xad,0xb8,0xa9,0xb9,0x95,0xc0,0x91,0xc1 + ,0x91,0xc2,0x95,0xc3,0x91,0xc4,0x95,0xc5 + ,0x85,0xc0,0x81,0xc1,0x81,0xc2,0x85,0xc3 + ,0x81,0xc4,0x85,0xc5,0x85,0xc6,0x81,0xc7 + ,0x89,0xc8,0x8d,0xc9,0x91,0xd0,0x95,0xd1 + ,0x95,0xd2,0x91,0xd3,0x95,0xd4,0x91,0xd5 + ,0x81,0xd0,0x85,0xd1,0x85,0xd2,0x81,0xd3 + ,0x85,0xd4,0x81,0xd5,0x81,0xd6,0x85,0xd7 + ,0x8d,0xd8,0x89,0xd9,0xb1,0xe0,0xb5,0xe1 + ,0xb5,0xe2,0xb1,0xe3,0xb5,0xe4,0xb1,0xe5 + ,0xa1,0xe0,0xa5,0xe1,0xa5,0xe2,0xa1,0xe3 + ,0xa5,0xe4,0xa1,0xe5,0xa1,0xe6,0xa5,0xe7 + ,0xad,0xe8,0xa9,0xe9,0xb5,0xf0,0xb1,0xf1 + ,0xb1,0xf2,0xb5,0xf3,0xb1,0xf4,0xb5,0xf5 + ,0xa5,0xf0,0xa1,0xf1,0xa1,0xf2,0xa5,0xf3 + ,0xa1,0xf4,0xa5,0xf5,0xa5,0xf6,0xa1,0xf7 + ,0xa9,0xf8,0xad,0xf9,0x55,0x00,0x11,0x01 + ,0x11,0x02,0x15,0x03,0x11,0x04,0x15,0x05 + ,0x45,0x00,0x01,0x01,0x01,0x02,0x05,0x03 + ,0x01,0x04,0x05,0x05,0x05,0x06,0x01,0x07 + ,0x09,0x08,0x0d,0x09,0x11,0x10,0x15,0x11 + ,0x15,0x12,0x11,0x13,0x15,0x14,0x11,0x15 + ,0x01,0x10,0x05,0x11,0x05,0x12,0x01,0x13 + ,0x05,0x14,0x01,0x15,0x01,0x16,0x05,0x17 + ,0x0d,0x18,0x09,0x19,0x31,0x20,0x35,0x21 + ,0x35,0x22,0x31,0x23,0x35,0x24,0x31,0x25 + ,0x21,0x20,0x25,0x21,0x25,0x22,0x21,0x23 + ,0x25,0x24,0x21,0x25,0x21,0x26,0x25,0x27 + ,0x2d,0x28,0x29,0x29,0x35,0x30,0x31,0x31 + ,0x31,0x32,0x35,0x33,0x31,0x34,0x35,0x35 + ,0x25,0x30,0x21,0x31,0x21,0x32,0x25,0x33 + ,0x21,0x34,0x25,0x35,0x25,0x36,0x21,0x37 + ,0x29,0x38,0x2d,0x39,0x11,0x40,0x15,0x41 + ,0x15,0x42,0x11,0x43,0x15,0x44,0x11,0x45 + ,0x01,0x40,0x05,0x41,0x05,0x42,0x01,0x43 + ,0x05,0x44,0x01,0x45,0x01,0x46,0x05,0x47 + ,0x0d,0x48,0x09,0x49,0x15,0x50,0x11,0x51 + ,0x11,0x52,0x15,0x53,0x11,0x54,0x15,0x55 + ,0x05,0x50,0x01,0x51,0x01,0x52,0x05,0x53 + ,0x01,0x54,0x05,0x55,0x05,0x56,0x01,0x57 + ,0x09,0x58,0x0d,0x59,0x35,0x60,0x31,0x61 + ,0x31,0x62,0x35,0x63,0x31,0x64,0x35,0x65 + ,0x46,0x00,0x02,0x01,0x02,0x02,0x06,0x03 + ,0x02,0x04,0x06,0x05,0x06,0x06,0x02,0x07 + ,0x0a,0x08,0x0e,0x09,0x02,0x04,0x06,0x05 + ,0x06,0x06,0x02,0x07,0x0a,0x08,0x0e,0x09 + ,0x02,0x10,0x06,0x11,0x06,0x12,0x02,0x13 + ,0x06,0x14,0x02,0x15,0x02,0x16,0x06,0x17 + ,0x0e,0x18,0x0a,0x19,0x06,0x14,0x02,0x15 + ,0x02,0x16,0x06,0x17,0x0e,0x18,0x0a,0x19 + ,0x22,0x20,0x26,0x21,0x26,0x22,0x22,0x23 + ,0x26,0x24,0x22,0x25,0x22,0x26,0x26,0x27 + ,0x2e,0x28,0x2a,0x29,0x26,0x24,0x22,0x25 + ,0x22,0x26,0x26,0x27,0x2e,0x28,0x2a,0x29 + ,0x26,0x30,0x22,0x31,0x22,0x32,0x26,0x33 + ,0x22,0x34,0x26,0x35,0x26,0x36,0x22,0x37 + ,0x2a,0x38,0x2e,0x39,0x22,0x34,0x26,0x35 + ,0x26,0x36,0x22,0x37,0x2a,0x38,0x2e,0x39 + ,0x02,0x40,0x06,0x41,0x06,0x42,0x02,0x43 + ,0x06,0x44,0x02,0x45,0x02,0x46,0x06,0x47 + ,0x0e,0x48,0x0a,0x49,0x06,0x44,0x02,0x45 + ,0x02,0x46,0x06,0x47,0x0e,0x48,0x0a,0x49 + ,0x06,0x50,0x02,0x51,0x02,0x52,0x06,0x53 + ,0x02,0x54,0x06,0x55,0x06,0x56,0x02,0x57 + ,0x0a,0x58,0x0e,0x59,0x02,0x54,0x06,0x55 + ,0x06,0x56,0x02,0x57,0x0a,0x58,0x0e,0x59 + ,0x26,0x60,0x22,0x61,0x22,0x62,0x26,0x63 + ,0x22,0x64,0x26,0x65,0x26,0x66,0x22,0x67 + ,0x2a,0x68,0x2e,0x69,0x22,0x64,0x26,0x65 + ,0x26,0x66,0x22,0x67,0x2a,0x68,0x2e,0x69 + ,0x22,0x70,0x26,0x71,0x26,0x72,0x22,0x73 + ,0x26,0x74,0x22,0x75,0x22,0x76,0x26,0x77 + ,0x2e,0x78,0x2a,0x79,0x26,0x74,0x22,0x75 + ,0x22,0x76,0x26,0x77,0x2e,0x78,0x2a,0x79 + ,0x82,0x80,0x86,0x81,0x86,0x82,0x82,0x83 + ,0x86,0x84,0x82,0x85,0x82,0x86,0x86,0x87 + ,0x8e,0x88,0x8a,0x89,0x86,0x84,0x82,0x85 + ,0x82,0x86,0x86,0x87,0x8e,0x88,0x8a,0x89 + ,0x86,0x90,0x82,0x91,0x82,0x92,0x86,0x93 + ,0x82,0x94,0x86,0x95,0x86,0x96,0x82,0x97 + ,0x8a,0x98,0x8e,0x99,0x23,0x34,0x27,0x35 + ,0x27,0x36,0x23,0x37,0x2b,0x38,0x2f,0x39 + ,0x03,0x40,0x07,0x41,0x07,0x42,0x03,0x43 + ,0x07,0x44,0x03,0x45,0x03,0x46,0x07,0x47 + ,0x0f,0x48,0x0b,0x49,0x07,0x44,0x03,0x45 + ,0x03,0x46,0x07,0x47,0x0f,0x48,0x0b,0x49 + ,0x07,0x50,0x03,0x51,0x03,0x52,0x07,0x53 + ,0x03,0x54,0x07,0x55,0x07,0x56,0x03,0x57 + ,0x0b,0x58,0x0f,0x59,0x03,0x54,0x07,0x55 + ,0x07,0x56,0x03,0x57,0x0b,0x58,0x0f,0x59 + ,0x27,0x60,0x23,0x61,0x23,0x62,0x27,0x63 + ,0x23,0x64,0x27,0x65,0x27,0x66,0x23,0x67 + ,0x2b,0x68,0x2f,0x69,0x23,0x64,0x27,0x65 + ,0x27,0x66,0x23,0x67,0x2b,0x68,0x2f,0x69 + ,0x23,0x70,0x27,0x71,0x27,0x72,0x23,0x73 + ,0x27,0x74,0x23,0x75,0x23,0x76,0x27,0x77 + ,0x2f,0x78,0x2b,0x79,0x27,0x74,0x23,0x75 + ,0x23,0x76,0x27,0x77,0x2f,0x78,0x2b,0x79 + ,0x83,0x80,0x87,0x81,0x87,0x82,0x83,0x83 + ,0x87,0x84,0x83,0x85,0x83,0x86,0x87,0x87 + ,0x8f,0x88,0x8b,0x89,0x87,0x84,0x83,0x85 + ,0x83,0x86,0x87,0x87,0x8f,0x88,0x8b,0x89 + ,0x87,0x90,0x83,0x91,0x83,0x92,0x87,0x93 + ,0x83,0x94,0x87,0x95,0x87,0x96,0x83,0x97 + ,0x8b,0x98,0x8f,0x99,0x83,0x94,0x87,0x95 + ,0x87,0x96,0x83,0x97,0x8b,0x98,0x8f,0x99 + ,0xa7,0xa0,0xa3,0xa1,0xa3,0xa2,0xa7,0xa3 + ,0xa3,0xa4,0xa7,0xa5,0xa7,0xa6,0xa3,0xa7 + ,0xab,0xa8,0xaf,0xa9,0xa3,0xa4,0xa7,0xa5 + ,0xa7,0xa6,0xa3,0xa7,0xab,0xa8,0xaf,0xa9 + ,0xa3,0xb0,0xa7,0xb1,0xa7,0xb2,0xa3,0xb3 + ,0xa7,0xb4,0xa3,0xb5,0xa3,0xb6,0xa7,0xb7 + ,0xaf,0xb8,0xab,0xb9,0xa7,0xb4,0xa3,0xb5 + ,0xa3,0xb6,0xa7,0xb7,0xaf,0xb8,0xab,0xb9 + ,0x87,0xc0,0x83,0xc1,0x83,0xc2,0x87,0xc3 + ,0x83,0xc4,0x87,0xc5,0x87,0xc6,0x83,0xc7 + ,0x8b,0xc8,0x8f,0xc9,0x83,0xc4,0x87,0xc5 + ,0x87,0xc6,0x83,0xc7,0x8b,0xc8,0x8f,0xc9 + ,0x83,0xd0,0x87,0xd1,0x87,0xd2,0x83,0xd3 + ,0x87,0xd4,0x83,0xd5,0x83,0xd6,0x87,0xd7 + ,0x8f,0xd8,0x8b,0xd9,0x87,0xd4,0x83,0xd5 + ,0x83,0xd6,0x87,0xd7,0x8f,0xd8,0x8b,0xd9 + ,0xa3,0xe0,0xa7,0xe1,0xa7,0xe2,0xa3,0xe3 + ,0xa7,0xe4,0xa3,0xe5,0xa3,0xe6,0xa7,0xe7 + ,0xaf,0xe8,0xab,0xe9,0xa7,0xe4,0xa3,0xe5 + ,0xa3,0xe6,0xa7,0xe7,0xaf,0xe8,0xab,0xe9 + ,0xa7,0xf0,0xa3,0xf1,0xa3,0xf2,0xa7,0xf3 + ,0xa3,0xf4,0xa7,0xf5,0xa7,0xf6,0xa3,0xf7 + ,0xab,0xf8,0xaf,0xf9,0xa3,0xf4,0xa7,0xf5 + ,0xa7,0xf6,0xa3,0xf7,0xab,0xf8,0xaf,0xf9 + ,0x47,0x00,0x03,0x01,0x03,0x02,0x07,0x03 + ,0x03,0x04,0x07,0x05,0x07,0x06,0x03,0x07 + ,0x0b,0x08,0x0f,0x09,0x03,0x04,0x07,0x05 + ,0x07,0x06,0x03,0x07,0x0b,0x08,0x0f,0x09 + ,0x03,0x10,0x07,0x11,0x07,0x12,0x03,0x13 + ,0x07,0x14,0x03,0x15,0x03,0x16,0x07,0x17 + ,0x0f,0x18,0x0b,0x19,0x07,0x14,0x03,0x15 + ,0x03,0x16,0x07,0x17,0x0f,0x18,0x0b,0x19 + ,0x23,0x20,0x27,0x21,0x27,0x22,0x23,0x23 + ,0x27,0x24,0x23,0x25,0x23,0x26,0x27,0x27 + ,0x2f,0x28,0x2b,0x29,0x27,0x24,0x23,0x25 + ,0x23,0x26,0x27,0x27,0x2f,0x28,0x2b,0x29 + ,0x27,0x30,0x23,0x31,0x23,0x32,0x27,0x33 + ,0x23,0x34,0x27,0x35,0x27,0x36,0x23,0x37 + ,0x2b,0x38,0x2f,0x39,0x23,0x34,0x27,0x35 + ,0x27,0x36,0x23,0x37,0x2b,0x38,0x2f,0x39 + ,0x03,0x40,0x07,0x41,0x07,0x42,0x03,0x43 + ,0x07,0x44,0x03,0x45,0x03,0x46,0x07,0x47 + ,0x0f,0x48,0x0b,0x49,0x07,0x44,0x03,0x45 + ,0x03,0x46,0x07,0x47,0x0f,0x48,0x0b,0x49 + ,0x07,0x50,0x03,0x51,0x03,0x52,0x07,0x53 + ,0x03,0x54,0x07,0x55,0x07,0x56,0x03,0x57 + ,0x0b,0x58,0x0f,0x59,0x03,0x54,0x07,0x55 + ,0x07,0x56,0x03,0x57,0x0b,0x58,0x0f,0x59 + ,0x27,0x60,0x23,0x61,0x23,0x62,0x27,0x63 + ,0x23,0x64,0x27,0x65,0x27,0x66,0x23,0x67 + ,0x2b,0x68,0x2f,0x69,0x23,0x64,0x27,0x65 + ,0x27,0x66,0x23,0x67,0x2b,0x68,0x2f,0x69 + ,0x23,0x70,0x27,0x71,0x27,0x72,0x23,0x73 + ,0x27,0x74,0x23,0x75,0x23,0x76,0x27,0x77 + ,0x2f,0x78,0x2b,0x79,0x27,0x74,0x23,0x75 + ,0x23,0x76,0x27,0x77,0x2f,0x78,0x2b,0x79 + ,0x83,0x80,0x87,0x81,0x87,0x82,0x83,0x83 + ,0x87,0x84,0x83,0x85,0x83,0x86,0x87,0x87 + ,0x8f,0x88,0x8b,0x89,0x87,0x84,0x83,0x85 + ,0x83,0x86,0x87,0x87,0x8f,0x88,0x8b,0x89 + ,0x87,0x90,0x83,0x91,0x83,0x92,0x87,0x93 + ,0x83,0x94,0x87,0x95,0x87,0x96,0x83,0x97 + ,0x8b,0x98,0x8f,0x99,0x83,0x94,0x87,0x95 + ,0x87,0x96,0x83,0x97,0x8b,0x98,0x8f,0x99 + ,0x04,0x06,0x00,0x07,0x08,0x08,0x0c,0x09 + ,0x0c,0x0a,0x08,0x0b,0x0c,0x0c,0x08,0x0d + ,0x08,0x0e,0x0c,0x0f,0x10,0x10,0x14,0x11 + ,0x14,0x12,0x10,0x13,0x14,0x14,0x10,0x15 + ,0x00,0x16,0x04,0x17,0x0c,0x18,0x08,0x19 + ,0x08,0x1a,0x0c,0x1b,0x08,0x1c,0x0c,0x1d + ,0x0c,0x1e,0x08,0x1f,0x30,0x20,0x34,0x21 + ,0x34,0x22,0x30,0x23,0x34,0x24,0x30,0x25 + ,0x20,0x26,0x24,0x27,0x2c,0x28,0x28,0x29 + ,0x28,0x2a,0x2c,0x2b,0x28,0x2c,0x2c,0x2d + ,0x2c,0x2e,0x28,0x2f,0x34,0x30,0x30,0x31 + ,0x30,0x32,0x34,0x33,0x30,0x34,0x34,0x35 + ,0x24,0x36,0x20,0x37,0x28,0x38,0x2c,0x39 + ,0x2c,0x3a,0x28,0x3b,0x2c,0x3c,0x28,0x3d + ,0x28,0x3e,0x2c,0x3f,0x10,0x40,0x14,0x41 + ,0x14,0x42,0x10,0x43,0x14,0x44,0x10,0x45 + ,0x00,0x46,0x04,0x47,0x0c,0x48,0x08,0x49 + ,0x08,0x4a,0x0c,0x4b,0x08,0x4c,0x0c,0x4d + ,0x0c,0x4e,0x08,0x4f,0x14,0x50,0x10,0x51 + ,0x10,0x52,0x14,0x53,0x10,0x54,0x14,0x55 + ,0x04,0x56,0x00,0x57,0x08,0x58,0x0c,0x59 + ,0x0c,0x5a,0x08,0x5b,0x0c,0x5c,0x08,0x5d + ,0x08,0x5e,0x0c,0x5f,0x34,0x60,0x30,0x61 + ,0x30,0x62,0x34,0x63,0x30,0x64,0x34,0x65 + ,0x24,0x66,0x20,0x67,0x28,0x68,0x2c,0x69 + ,0x2c,0x6a,0x28,0x6b,0x2c,0x6c,0x28,0x6d + ,0x28,0x6e,0x2c,0x6f,0x30,0x70,0x34,0x71 + ,0x34,0x72,0x30,0x73,0x34,0x74,0x30,0x75 + ,0x20,0x76,0x24,0x77,0x2c,0x78,0x28,0x79 + ,0x28,0x7a,0x2c,0x7b,0x28,0x7c,0x2c,0x7d + ,0x2c,0x7e,0x28,0x7f,0x90,0x80,0x94,0x81 + ,0x94,0x82,0x90,0x83,0x94,0x84,0x90,0x85 + ,0x80,0x86,0x84,0x87,0x8c,0x88,0x88,0x89 + ,0x88,0x8a,0x8c,0x8b,0x88,0x8c,0x8c,0x8d + ,0x8c,0x8e,0x88,0x8f,0x94,0x90,0x90,0x91 + ,0x90,0x92,0x94,0x93,0x90,0x94,0x94,0x95 + ,0x84,0x96,0x80,0x97,0x88,0x98,0x8c,0x99 + ,0x8c,0x9a,0x88,0x9b,0x8c,0x9c,0x88,0x9d + ,0x88,0x9e,0x8c,0x9f,0x55,0x00,0x11,0x01 + ,0x11,0x02,0x15,0x03,0x11,0x04,0x15,0x05 + ,0x05,0x06,0x01,0x07,0x09,0x08,0x0d,0x09 + ,0x0d,0x0a,0x09,0x0b,0x0d,0x0c,0x09,0x0d + ,0x09,0x0e,0x0d,0x0f,0x11,0x10,0x15,0x11 + ,0x15,0x12,0x11,0x13,0x15,0x14,0x11,0x15 + ,0x01,0x16,0x05,0x17,0x0d,0x18,0x09,0x19 + ,0x09,0x1a,0x0d,0x1b,0x09,0x1c,0x0d,0x1d + ,0x0d,0x1e,0x09,0x1f,0x31,0x20,0x35,0x21 + ,0x35,0x22,0x31,0x23,0x35,0x24,0x31,0x25 + ,0x21,0x26,0x25,0x27,0x2d,0x28,0x29,0x29 + ,0x29,0x2a,0x2d,0x2b,0x29,0x2c,0x2d,0x2d + ,0x2d,0x2e,0x29,0x2f,0x35,0x30,0x31,0x31 + ,0x31,0x32,0x35,0x33,0x31,0x34,0x35,0x35 + ,0x25,0x36,0x21,0x37,0x29,0x38,0x2d,0x39 + ,0x2d,0x3a,0x29,0x3b,0x2d,0x3c,0x29,0x3d + ,0x29,0x3e,0x2d,0x3f,0x11,0x40,0x15,0x41 + ,0x15,0x42,0x11,0x43,0x15,0x44,0x11,0x45 + ,0x01,0x46,0x05,0x47,0x0d,0x48,0x09,0x49 + ,0x09,0x4a,0x0d,0x4b,0x09,0x4c,0x0d,0x4d + ,0x0d,0x4e,0x09,0x4f,0x15,0x50,0x11,0x51 + ,0x11,0x52,0x15,0x53,0x11,0x54,0x15,0x55 + ,0x05,0x56,0x01,0x57,0x09,0x58,0x0d,0x59 + ,0x0d,0x5a,0x09,0x5b,0x0d,0x5c,0x09,0x5d + ,0x09,0x5e,0x0d,0x5f,0x35,0x60,0x31,0x61 + ,0x31,0x62,0x35,0x63,0x31,0x64,0x35,0x65 + ,0x25,0x66,0x21,0x67,0x29,0x68,0x2d,0x69 + ,0x2d,0x6a,0x29,0x6b,0x2d,0x6c,0x29,0x6d + ,0x29,0x6e,0x2d,0x6f,0x31,0x70,0x35,0x71 + ,0x35,0x72,0x31,0x73,0x35,0x74,0x31,0x75 + ,0x21,0x76,0x25,0x77,0x2d,0x78,0x29,0x79 + ,0x29,0x7a,0x2d,0x7b,0x29,0x7c,0x2d,0x7d + ,0x2d,0x7e,0x29,0x7f,0x91,0x80,0x95,0x81 + ,0x95,0x82,0x91,0x83,0x95,0x84,0x91,0x85 + ,0x81,0x86,0x85,0x87,0x8d,0x88,0x89,0x89 + ,0x89,0x8a,0x8d,0x8b,0x89,0x8c,0x8d,0x8d + ,0x8d,0x8e,0x89,0x8f,0x95,0x90,0x91,0x91 + ,0x91,0x92,0x95,0x93,0x91,0x94,0x95,0x95 + ,0x85,0x96,0x81,0x97,0x89,0x98,0x8d,0x99 + ,0x8d,0x9a,0x89,0x9b,0x8d,0x9c,0x89,0x9d + ,0x89,0x9e,0x8d,0x9f,0xb5,0xa0,0xb1,0xa1 + ,0xb1,0xa2,0xb5,0xa3,0xb1,0xa4,0xb5,0xa5 + ,0xa5,0xa6,0xa1,0xa7,0xa9,0xa8,0xad,0xa9 + ,0xad,0xaa,0xa9,0xab,0xad,0xac,0xa9,0xad + ,0xa9,0xae,0xad,0xaf,0xb1,0xb0,0xb5,0xb1 + ,0xb5,0xb2,0xb1,0xb3,0xb5,0xb4,0xb1,0xb5 + ,0xa1,0xb6,0xa5,0xb7,0xad,0xb8,0xa9,0xb9 + ,0xa9,0xba,0xad,0xbb,0xa9,0xbc,0xad,0xbd + ,0xad,0xbe,0xa9,0xbf,0x95,0xc0,0x91,0xc1 + ,0x91,0xc2,0x95,0xc3,0x91,0xc4,0x95,0xc5 + ,0x85,0xc6,0x81,0xc7,0x89,0xc8,0x8d,0xc9 + ,0x8d,0xca,0x89,0xcb,0x8d,0xcc,0x89,0xcd + ,0x89,0xce,0x8d,0xcf,0x91,0xd0,0x95,0xd1 + ,0x95,0xd2,0x91,0xd3,0x95,0xd4,0x91,0xd5 + ,0x81,0xd6,0x85,0xd7,0x8d,0xd8,0x89,0xd9 + ,0x89,0xda,0x8d,0xdb,0x89,0xdc,0x8d,0xdd + ,0x8d,0xde,0x89,0xdf,0xb1,0xe0,0xb5,0xe1 + ,0xb5,0xe2,0xb1,0xe3,0xb5,0xe4,0xb1,0xe5 + ,0xa1,0xe6,0xa5,0xe7,0xad,0xe8,0xa9,0xe9 + ,0xa9,0xea,0xad,0xeb,0xa9,0xec,0xad,0xed + ,0xad,0xee,0xa9,0xef,0xb5,0xf0,0xb1,0xf1 + ,0xb1,0xf2,0xb5,0xf3,0xb1,0xf4,0xb5,0xf5 + ,0xa5,0xf6,0xa1,0xf7,0xa9,0xf8,0xad,0xf9 + ,0xad,0xfa,0xa9,0xfb,0xad,0xfc,0xa9,0xfd + ,0xa9,0xfe,0xad,0xff,0x55,0x00,0x11,0x01 + ,0x11,0x02,0x15,0x03,0x11,0x04,0x15,0x05 + ,0x05,0x06,0x01,0x07,0x09,0x08,0x0d,0x09 + ,0x0d,0x0a,0x09,0x0b,0x0d,0x0c,0x09,0x0d + ,0x09,0x0e,0x0d,0x0f,0x11,0x10,0x15,0x11 + ,0x15,0x12,0x11,0x13,0x15,0x14,0x11,0x15 + ,0x01,0x16,0x05,0x17,0x0d,0x18,0x09,0x19 + ,0x09,0x1a,0x0d,0x1b,0x09,0x1c,0x0d,0x1d + ,0x0d,0x1e,0x09,0x1f,0x31,0x20,0x35,0x21 + ,0x35,0x22,0x31,0x23,0x35,0x24,0x31,0x25 + ,0x21,0x26,0x25,0x27,0x2d,0x28,0x29,0x29 + ,0x29,0x2a,0x2d,0x2b,0x29,0x2c,0x2d,0x2d + ,0x2d,0x2e,0x29,0x2f,0x35,0x30,0x31,0x31 + ,0x31,0x32,0x35,0x33,0x31,0x34,0x35,0x35 + ,0x25,0x36,0x21,0x37,0x29,0x38,0x2d,0x39 + ,0x2d,0x3a,0x29,0x3b,0x2d,0x3c,0x29,0x3d + ,0x29,0x3e,0x2d,0x3f,0x11,0x40,0x15,0x41 + ,0x15,0x42,0x11,0x43,0x15,0x44,0x11,0x45 + ,0x01,0x46,0x05,0x47,0x0d,0x48,0x09,0x49 + ,0x09,0x4a,0x0d,0x4b,0x09,0x4c,0x0d,0x4d + ,0x0d,0x4e,0x09,0x4f,0x15,0x50,0x11,0x51 + ,0x11,0x52,0x15,0x53,0x11,0x54,0x15,0x55 + ,0x05,0x56,0x01,0x57,0x09,0x58,0x0d,0x59 + ,0x0d,0x5a,0x09,0x5b,0x0d,0x5c,0x09,0x5d + ,0x09,0x5e,0x0d,0x5f,0x35,0x60,0x31,0x61 + ,0x31,0x62,0x35,0x63,0x31,0x64,0x35,0x65 + ,0xbe,0xfa,0xba,0xfb,0xbe,0xfc,0xba,0xfd + ,0xba,0xfe,0xbe,0xff,0x46,0x00,0x02,0x01 + ,0x02,0x02,0x06,0x03,0x02,0x04,0x06,0x05 + ,0x06,0x06,0x02,0x07,0x0a,0x08,0x0e,0x09 + ,0x1e,0x0a,0x1a,0x0b,0x1e,0x0c,0x1a,0x0d + ,0x1a,0x0e,0x1e,0x0f,0x02,0x10,0x06,0x11 + ,0x06,0x12,0x02,0x13,0x06,0x14,0x02,0x15 + ,0x02,0x16,0x06,0x17,0x0e,0x18,0x0a,0x19 + ,0x1a,0x1a,0x1e,0x1b,0x1a,0x1c,0x1e,0x1d + ,0x1e,0x1e,0x1a,0x1f,0x22,0x20,0x26,0x21 + ,0x26,0x22,0x22,0x23,0x26,0x24,0x22,0x25 + ,0x22,0x26,0x26,0x27,0x2e,0x28,0x2a,0x29 + ,0x3a,0x2a,0x3e,0x2b,0x3a,0x2c,0x3e,0x2d + ,0x3e,0x2e,0x3a,0x2f,0x26,0x30,0x22,0x31 + ,0x22,0x32,0x26,0x33,0x22,0x34,0x26,0x35 + ,0x26,0x36,0x22,0x37,0x2a,0x38,0x2e,0x39 + ,0x3e,0x3a,0x3a,0x3b,0x3e,0x3c,0x3a,0x3d + ,0x3a,0x3e,0x3e,0x3f,0x02,0x40,0x06,0x41 + ,0x06,0x42,0x02,0x43,0x06,0x44,0x02,0x45 + ,0x02,0x46,0x06,0x47,0x0e,0x48,0x0a,0x49 + ,0x1a,0x4a,0x1e,0x4b,0x1a,0x4c,0x1e,0x4d + ,0x1e,0x4e,0x1a,0x4f,0x06,0x50,0x02,0x51 + ,0x02,0x52,0x06,0x53,0x02,0x54,0x06,0x55 + ,0x06,0x56,0x02,0x57,0x0a,0x58,0x0e,0x59 + ,0x1e,0x5a,0x1a,0x5b,0x1e,0x5c,0x1a,0x5d + ,0x1a,0x5e,0x1e,0x5f,0x26,0x60,0x22,0x61 + ,0x22,0x62,0x26,0x63,0x22,0x64,0x26,0x65 + ,0x26,0x66,0x22,0x67,0x2a,0x68,0x2e,0x69 + ,0x3e,0x6a,0x3a,0x6b,0x3e,0x6c,0x3a,0x6d + ,0x3a,0x6e,0x3e,0x6f,0x22,0x70,0x26,0x71 + ,0x26,0x72,0x22,0x73,0x26,0x74,0x22,0x75 + ,0x22,0x76,0x26,0x77,0x2e,0x78,0x2a,0x79 + ,0x3a,0x7a,0x3e,0x7b,0x3a,0x7c,0x3e,0x7d + ,0x3e,0x7e,0x3a,0x7f,0x82,0x80,0x86,0x81 + ,0x86,0x82,0x82,0x83,0x86,0x84,0x82,0x85 + ,0x82,0x86,0x86,0x87,0x8e,0x88,0x8a,0x89 + ,0x9a,0x8a,0x9e,0x8b,0x9a,0x8c,0x9e,0x8d + ,0x9e,0x8e,0x9a,0x8f,0x86,0x90,0x82,0x91 + ,0x82,0x92,0x86,0x93,0x23,0x34,0x27,0x35 + ,0x27,0x36,0x23,0x37,0x2b,0x38,0x2f,0x39 + ,0x3f,0x3a,0x3b,0x3b,0x3f,0x3c,0x3b,0x3d + ,0x3b,0x3e,0x3f,0x3f,0x03,0x40,0x07,0x41 + ,0x07,0x42,0x03,0x43,0x07,0x44,0x03,0x45 + ,0x03,0x46,0x07,0x47,0x0f,0x48,0x0b,0x49 + ,0x1b,0x4a,0x1f,0x4b,0x1b,0x4c,0x1f,0x4d + ,0x1f,0x4e,0x1b,0x4f,0x07,0x50,0x03,0x51 + ,0x03,0x52,0x07,0x53,0x03,0x54,0x07,0x55 + ,0x07,0x56,0x03,0x57,0x0b,0x58,0x0f,0x59 + ,0x1f,0x5a,0x1b,0x5b,0x1f,0x5c,0x1b,0x5d + ,0x1b,0x5e,0x1f,0x5f,0x27,0x60,0x23,0x61 + ,0x23,0x62,0x27,0x63,0x23,0x64,0x27,0x65 + ,0x27,0x66,0x23,0x67,0x2b,0x68,0x2f,0x69 + ,0x3f,0x6a,0x3b,0x6b,0x3f,0x6c,0x3b,0x6d + ,0x3b,0x6e,0x3f,0x6f,0x23,0x70,0x27,0x71 + ,0x27,0x72,0x23,0x73,0x27,0x74,0x23,0x75 + ,0x23,0x76,0x27,0x77,0x2f,0x78,0x2b,0x79 + ,0x3b,0x7a,0x3f,0x7b,0x3b,0x7c,0x3f,0x7d + ,0x3f,0x7e,0x3b,0x7f,0x83,0x80,0x87,0x81 + ,0x87,0x82,0x83,0x83,0x87,0x84,0x83,0x85 + ,0x83,0x86,0x87,0x87,0x8f,0x88,0x8b,0x89 + ,0x9b,0x8a,0x9f,0x8b,0x9b,0x8c,0x9f,0x8d + ,0x9f,0x8e,0x9b,0x8f,0x87,0x90,0x83,0x91 + ,0x83,0x92,0x87,0x93,0x83,0x94,0x87,0x95 + ,0x87,0x96,0x83,0x97,0x8b,0x98,0x8f,0x99 + ,0x9f,0x9a,0x9b,0x9b,0x9f,0x9c,0x9b,0x9d + ,0x9b,0x9e,0x9f,0x9f,0xa7,0xa0,0xa3,0xa1 + ,0xa3,0xa2,0xa7,0xa3,0xa3,0xa4,0xa7,0xa5 + ,0xa7,0xa6,0xa3,0xa7,0xab,0xa8,0xaf,0xa9 + ,0xbf,0xaa,0xbb,0xab,0xbf,0xac,0xbb,0xad + ,0xbb,0xae,0xbf,0xaf,0xa3,0xb0,0xa7,0xb1 + ,0xa7,0xb2,0xa3,0xb3,0xa7,0xb4,0xa3,0xb5 + ,0xa3,0xb6,0xa7,0xb7,0xaf,0xb8,0xab,0xb9 + ,0xbb,0xba,0xbf,0xbb,0xbb,0xbc,0xbf,0xbd + ,0xbf,0xbe,0xbb,0xbf,0x87,0xc0,0x83,0xc1 + ,0x83,0xc2,0x87,0xc3,0x83,0xc4,0x87,0xc5 + ,0x87,0xc6,0x83,0xc7,0x8b,0xc8,0x8f,0xc9 + ,0x9f,0xca,0x9b,0xcb,0x9f,0xcc,0x9b,0xcd + ,0x9b,0xce,0x9f,0xcf,0x83,0xd0,0x87,0xd1 + ,0x87,0xd2,0x83,0xd3,0x87,0xd4,0x83,0xd5 + ,0x83,0xd6,0x87,0xd7,0x8f,0xd8,0x8b,0xd9 + ,0x9b,0xda,0x9f,0xdb,0x9b,0xdc,0x9f,0xdd + ,0x9f,0xde,0x9b,0xdf,0xa3,0xe0,0xa7,0xe1 + ,0xa7,0xe2,0xa3,0xe3,0xa7,0xe4,0xa3,0xe5 + ,0xa3,0xe6,0xa7,0xe7,0xaf,0xe8,0xab,0xe9 + ,0xbb,0xea,0xbf,0xeb,0xbb,0xec,0xbf,0xed + ,0xbf,0xee,0xbb,0xef,0xa7,0xf0,0xa3,0xf1 + ,0xa3,0xf2,0xa7,0xf3,0xa3,0xf4,0xa7,0xf5 + ,0xa7,0xf6,0xa3,0xf7,0xab,0xf8,0xaf,0xf9 + ,0xbf,0xfa,0xbb,0xfb,0xbf,0xfc,0xbb,0xfd + ,0xbb,0xfe,0xbf,0xff,0x47,0x00,0x03,0x01 + ,0x03,0x02,0x07,0x03,0x03,0x04,0x07,0x05 + ,0x07,0x06,0x03,0x07,0x0b,0x08,0x0f,0x09 + ,0x1f,0x0a,0x1b,0x0b,0x1f,0x0c,0x1b,0x0d + ,0x1b,0x0e,0x1f,0x0f,0x03,0x10,0x07,0x11 + ,0x07,0x12,0x03,0x13,0x07,0x14,0x03,0x15 + ,0x03,0x16,0x07,0x17,0x0f,0x18,0x0b,0x19 + ,0x1b,0x1a,0x1f,0x1b,0x1b,0x1c,0x1f,0x1d + ,0x1f,0x1e,0x1b,0x1f,0x23,0x20,0x27,0x21 + ,0x27,0x22,0x23,0x23,0x27,0x24,0x23,0x25 + ,0x23,0x26,0x27,0x27,0x2f,0x28,0x2b,0x29 + ,0x3b,0x2a,0x3f,0x2b,0x3b,0x2c,0x3f,0x2d + ,0x3f,0x2e,0x3b,0x2f,0x27,0x30,0x23,0x31 + ,0x23,0x32,0x27,0x33,0x23,0x34,0x27,0x35 + ,0x27,0x36,0x23,0x37,0x2b,0x38,0x2f,0x39 + ,0x3f,0x3a,0x3b,0x3b,0x3f,0x3c,0x3b,0x3d + ,0x3b,0x3e,0x3f,0x3f,0x03,0x40,0x07,0x41 + ,0x07,0x42,0x03,0x43,0x07,0x44,0x03,0x45 + ,0x03,0x46,0x07,0x47,0x0f,0x48,0x0b,0x49 + ,0x1b,0x4a,0x1f,0x4b,0x1b,0x4c,0x1f,0x4d + ,0x1f,0x4e,0x1b,0x4f,0x07,0x50,0x03,0x51 + ,0x03,0x52,0x07,0x53,0x03,0x54,0x07,0x55 + ,0x07,0x56,0x03,0x57,0x0b,0x58,0x0f,0x59 + ,0x1f,0x5a,0x1b,0x5b,0x1f,0x5c,0x1b,0x5d + ,0x1b,0x5e,0x1f,0x5f,0x27,0x60,0x23,0x61 + ,0x23,0x62,0x27,0x63,0x23,0x64,0x27,0x65 + ,0x27,0x66,0x23,0x67,0x2b,0x68,0x2f,0x69 + ,0x3f,0x6a,0x3b,0x6b,0x3f,0x6c,0x3b,0x6d + ,0x3b,0x6e,0x3f,0x6f,0x23,0x70,0x27,0x71 + ,0x27,0x72,0x23,0x73,0x27,0x74,0x23,0x75 + ,0x23,0x76,0x27,0x77,0x2f,0x78,0x2b,0x79 + ,0x3b,0x7a,0x3f,0x7b,0x3b,0x7c,0x3f,0x7d + ,0x3f,0x7e,0x3b,0x7f,0x83,0x80,0x87,0x81 + ,0x87,0x82,0x83,0x83,0x87,0x84,0x83,0x85 + ,0x83,0x86,0x87,0x87,0x8f,0x88,0x8b,0x89 + ,0x9b,0x8a,0x9f,0x8b,0x9b,0x8c,0x9f,0x8d + ,0x9f,0x8e,0x9b,0x8f,0x87,0x90,0x83,0x91 + ,0x83,0x92,0x87,0x93,0x83,0x94,0x87,0x95 + ,0x87,0x96,0x83,0x97,0x8b,0x98,0x8f,0x99 +}; diff --git a/third_party/z80ex/typedefs.h b/third_party/z80ex/typedefs.h new file mode 100644 index 00000000..45ba944b --- /dev/null +++ b/third_party/z80ex/typedefs.h @@ -0,0 +1,80 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#ifndef _Z80_TYPEDEFS_H_INCLUDED +#define _Z80_TYPEDEFS_H_INCLUDED + +struct _z80_cpu_context; +typedef struct _z80_cpu_context Z80EX_CONTEXT; + +#define __Z80EX_SELF_INCLUDE +#include "z80ex.h" + +/* Union allowing a register pair to be accessed as bytes or as a word */ +typedef union { +#ifdef WORDS_BIG_ENDIAN + struct { Z80EX_BYTE h,l; } b; +#else + struct { Z80EX_BYTE l,h; } b; +#endif + Z80EX_WORD w; +} regpair; + +typedef +enum {IM0=0,IM1=1,IM2=2} IM_MODE; + +struct _z80_cpu_context { + regpair af,bc,de,hl; + regpair af_,bc_,de_,hl_; + regpair ix,iy; + Z80EX_BYTE i; + Z80EX_WORD r; + Z80EX_BYTE r7; /* The high bit of the R register */ + regpair sp,pc; + Z80EX_BYTE iff1, iff2; /*interrupt flip-flops*/ + regpair memptr; /*undocumented internal register*/ + IM_MODE im; + int halted; + + unsigned long tstate; /*t-state clock of current/last step*/ + unsigned char op_tstate; /*clean (without WAITs and such) t-state of currently executing instruction*/ + + int noint_once; /*disable interrupts before next opcode?*/ + int reset_PV_on_int; /*reset P/V flag on interrupt? (for LD A,R / LD A,I)*/ + int doing_opcode; /*is there an opcode currently executing?*/ + char int_vector_req; /*opcode must be fetched from IO device? (int vector read)*/ + Z80EX_BYTE prefix; + + /*callbacks*/ + z80ex_tstate_cb tstate_cb; + void *tstate_cb_user_data; + z80ex_pread_cb pread_cb; + void *pread_cb_user_data; + z80ex_pwrite_cb pwrite_cb; + void *pwrite_cb_user_data; + z80ex_mread_cb mread_cb; + void *mread_cb_user_data; + z80ex_mwrite_cb mwrite_cb; + void *mwrite_cb_user_data; + z80ex_intread_cb intread_cb; + void *intread_cb_user_data; + z80ex_reti_cb reti_cb; + void *reti_cb_user_data; + + /*other stuff*/ + regpair tmpword; + regpair tmpaddr; + Z80EX_BYTE tmpbyte; + Z80EX_SIGNED_BYTE tmpbyte_s; +}; + +typedef void (*z80ex_opcode_fn) (Z80EX_CONTEXT *cpu); + +#endif diff --git a/third_party/z80ex/z80ex.c b/third_party/z80ex/z80ex.c new file mode 100644 index 00000000..3cab53e6 --- /dev/null +++ b/third_party/z80ex/z80ex.c @@ -0,0 +1,414 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#include +#include +#include + +#define __Z80EX_SELF_INCLUDE + +#include "typedefs.h" +#include "z80ex.h" +#include "macros.h" + +#define temp_byte cpu->tmpbyte +#define temp_byte_s cpu->tmpbyte_s +#define temp_addr cpu->tmpaddr +#define temp_word cpu->tmpword + +#include "ptables.c" +#include "opcodes/opcodes_base.c" +#include "opcodes/opcodes_dd.c" +#include "opcodes/opcodes_fd.c" +#include "opcodes/opcodes_cb.c" +#include "opcodes/opcodes_ed.c" +#include "opcodes/opcodes_ddcb.c" +#include "opcodes/opcodes_fdcb.c" + +#define DOQUOTE(x) #x +#define TOSTRING(x) DOQUOTE(x) + +static char revision_type[]=TOSTRING(Z80EX_RELEASE_TYPE); +static char ver_str[]=TOSTRING(Z80EX_VERSION_STR); +static Z80EX_VERSION version = {Z80EX_API_REVISION, Z80EX_VERSION_MAJOR, Z80EX_VERSION_MINOR, revision_type, ver_str}; + +LIB_EXPORT Z80EX_VERSION *z80ex_get_version() +{ + return(&version); +} + +/* do one opcode (instruction or prefix) */ +LIB_EXPORT int z80ex_step(Z80EX_CONTEXT *cpu) +{ + Z80EX_BYTE opcode, d; + z80ex_opcode_fn ofn=NULL; + + cpu->doing_opcode=1; + cpu->noint_once=0; + cpu->reset_PV_on_int=0; + cpu->tstate=0; + cpu->op_tstate=0; + + opcode=READ_OP_M1(); /*fetch opcode*/ + if(cpu->int_vector_req) + { + TSTATES(2); /*interrupt eats two extra wait-states*/ + } + R++; /*R increased by one on every first M1 cycle*/ + + T_WAIT_UNTIL(4); /*M1 cycle eats min 4 t-states*/ + + if(!cpu->prefix) opcodes_base[opcode](cpu); + else + { + if((cpu->prefix | 0x20) == 0xFD && ((opcode | 0x20) == 0xFD || opcode == 0xED)) + { + cpu->prefix=opcode; + cpu->noint_once=1; /*interrupts are not accepted immediately after prefix*/ + } + else + { + switch(cpu->prefix) + { + case 0xDD: + case 0xFD: + if(opcode == 0xCB) + { + d=READ_OP(); /*displacement*/ + temp_byte_s=(d & 0x80)? -(((~d) & 0x7f)+1): d; + opcode=READ_OP(); + ofn = (cpu->prefix == 0xDD)? opcodes_ddcb[opcode]: opcodes_fdcb[opcode]; + } + else + { + ofn = (cpu->prefix == 0xDD)? opcodes_dd[opcode]: opcodes_fd[opcode]; + if(ofn == NULL) ofn=opcodes_base[opcode]; /*'mirrored' instructions*/ + } + break; + + case 0xED: + ofn = opcodes_ed[opcode]; + if(ofn == NULL) ofn=opcodes_base[0x00]; + break; + + case 0xCB: + ofn = opcodes_cb[opcode]; + break; + + default: + /*this must'nt happen!*/ + assert(0); + break; + } + + ofn(cpu); + + cpu->prefix=0; + } + } + + cpu->doing_opcode=0; + return(cpu->tstate); +} + +LIB_EXPORT Z80EX_BYTE z80ex_last_op_type(Z80EX_CONTEXT *cpu) +{ + return(cpu->prefix); +} + +LIB_EXPORT void z80ex_reset(Z80EX_CONTEXT *cpu) +{ + PC=0x0000; IFF1=IFF2=0; IM=IM0; + AF=SP=BC=DE=HL=IX=IY=AF_=BC_=DE_=HL_=0xffff; + I=R=R7=0; + cpu->noint_once=0; cpu->reset_PV_on_int=0; cpu->halted=0; + cpu->int_vector_req=0; + cpu->doing_opcode=0; + cpu->tstate=cpu->op_tstate=0; + cpu->prefix=0; +} + +/**/ +LIB_EXPORT Z80EX_CONTEXT *z80ex_create( + z80ex_mread_cb mrcb_fn, void *mrcb_data, + z80ex_mwrite_cb mwcb_fn, void *mwcb_data, + z80ex_pread_cb prcb_fn, void *prcb_data, + z80ex_pwrite_cb pwcb_fn, void *pwcb_data, + z80ex_intread_cb ircb_fn, void *ircb_data +) +{ + Z80EX_CONTEXT *cpu; + + if((cpu=(Z80EX_CONTEXT *)malloc(sizeof(Z80EX_CONTEXT))) == NULL) return(NULL); + memset(cpu,0x00,sizeof(Z80EX_CONTEXT)); + + z80ex_reset(cpu); + + cpu->mread_cb=mrcb_fn; + cpu->mread_cb_user_data=mrcb_data; + cpu->mwrite_cb=mwcb_fn; + cpu->mwrite_cb_user_data=mwcb_data; + cpu->pread_cb=prcb_fn; + cpu->pread_cb_user_data=prcb_data; + cpu->pwrite_cb=pwcb_fn; + cpu->pwrite_cb_user_data=pwcb_data; + cpu->intread_cb=ircb_fn; + cpu->intread_cb_user_data=ircb_data; + + return(cpu); +} + +LIB_EXPORT void z80ex_destroy(Z80EX_CONTEXT *cpu) +{ + free(cpu); +} + +LIB_EXPORT void z80ex_set_tstate_callback(Z80EX_CONTEXT *cpu, z80ex_tstate_cb cb_fn, void *user_data) +{ + cpu->tstate_cb=cb_fn; + cpu->tstate_cb_user_data=user_data; +} + +LIB_EXPORT void z80ex_set_reti_callback(Z80EX_CONTEXT *cpu, z80ex_reti_cb cb_fn, void *user_data) +{ + cpu->reti_cb=cb_fn; + cpu->reti_cb_user_data=user_data; +} + +LIB_EXPORT void z80ex_set_memread_callback(Z80EX_CONTEXT *cpu, z80ex_mread_cb mrcb_fn, void *mrcb_data) +{ + cpu->mread_cb=mrcb_fn; + cpu->mread_cb_user_data=mrcb_data; +} + +LIB_EXPORT void z80ex_set_memwrite_callback(Z80EX_CONTEXT *cpu, z80ex_mwrite_cb mwcb_fn, void *mwcb_data) +{ + cpu->mwrite_cb=mwcb_fn; + cpu->mwrite_cb_user_data=mwcb_data; +} + +LIB_EXPORT void z80ex_set_portread_callback(Z80EX_CONTEXT *cpu, z80ex_pread_cb prcb_fn, void *prcb_data) +{ + cpu->pread_cb=prcb_fn; + cpu->pread_cb_user_data=prcb_data; +} + +LIB_EXPORT void z80ex_set_portwrite_callback(Z80EX_CONTEXT *cpu, z80ex_pwrite_cb pwcb_fn, void *pwcb_data) +{ + cpu->pwrite_cb=pwcb_fn; + cpu->pwrite_cb_user_data=pwcb_data; +} + +LIB_EXPORT void z80ex_set_intread_callback(Z80EX_CONTEXT *cpu, z80ex_intread_cb ircb_fn, void *ircb_data) +{ + cpu->intread_cb=ircb_fn; + cpu->intread_cb_user_data=ircb_data; +} + +/*non-maskable interrupt*/ +LIB_EXPORT int z80ex_nmi(Z80EX_CONTEXT *cpu) +{ + if(cpu->doing_opcode || cpu->noint_once || cpu->prefix) return(0); + + if(cpu->halted) { PC++; cpu->halted = 0; } /*so we met an interrupt... stop waiting*/ + + cpu->doing_opcode=1; + + R++; /*accepting interrupt increases R by one*/ + /*IFF2=IFF1;*/ /*contrary to zilog z80 docs, IFF2 is not modified on NMI. proved by Slava Tretiak aka restorer*/ + IFF1=0; + + TSTATES(5); + + cpu->mwrite_cb(cpu, --SP, cpu->pc.b.h, cpu->mwrite_cb_user_data); /*PUSH PC -- high byte */ + TSTATES(3); + + cpu->mwrite_cb(cpu, --SP, cpu->pc.b.l, cpu->mwrite_cb_user_data); /*PUSH PC -- low byte */ + TSTATES(3); + + PC=0x0066; + MEMPTR=PC; /*FIXME: is that really so?*/ + + cpu->doing_opcode=0; + + return(11); /*NMI always takes 11 t-states*/ +} + +/*maskable interrupt*/ +LIB_EXPORT int z80ex_int(Z80EX_CONTEXT *cpu) +{ + Z80EX_WORD inttemp; + Z80EX_BYTE iv; + unsigned long tt; + + /*If the INT line is low and IFF1 is set, and there's no opcode executing just now, + a maskable interrupt is accepted, whether or not the + last INT routine has finished*/ + if(!IFF1 || cpu->noint_once || cpu->doing_opcode || cpu->prefix) return(0); + + cpu->tstate=0; + cpu->op_tstate=0; + + if(cpu->halted) { PC++; cpu->halted = 0; } /*so we met an interrupt... stop waiting*/ + + /*When an INT is accepted, both IFF1 and IFF2 are cleared, preventing another interrupt from + occurring which would end up as an infinite loop*/ + IFF1=IFF2=0; + + /*original (NMOS) zilog z80 bug:*/ + /*If a LD A,I or LD A,R (which copy IFF2 to the P/V flag) is interrupted, then the P/V flag is reset, even if interrupts were enabled beforehand.*/ + /*(this bug was fixed in CMOS version of z80)*/ + if(cpu->reset_PV_on_int) {F = (F & ~FLAG_P);} + cpu->reset_PV_on_int=0; + + cpu->int_vector_req=1; + cpu->doing_opcode=1; + + switch(IM) + { + case IM0: + /*note: there's no need to do R++ and WAITs here, it'll be handled by z80ex_step*/ + tt=z80ex_step(cpu); + + while(cpu->prefix) /*this is not the end?*/ + { + tt+=z80ex_step(cpu); + } + + cpu->tstate=tt; + break; + + case IM1: + R++; + TSTATES(2); /*two extra wait-states*/ + /*An RST 38h is executed, no matter what value is put on the bus or what + value the I register has. 13 t-states (2 extra + 11 for RST).*/ + opcodes_base[0xff](cpu); /*RST38*/ + break; + + case IM2: + R++; + /*takes 19 clock periods to complete (seven to fetch the + lower eight bits from the interrupting device, six to save the program + counter, and six to obtain the jump address)*/ + iv=READ_OP(); + T_WAIT_UNTIL(7); + inttemp=(0x100*I)+iv; + + PUSH(PC,7,10); + + READ_MEM(PCL,inttemp++,13); READ_MEM(PCH,inttemp,16); + MEMPTR=PC; + T_WAIT_UNTIL(19); + + break; + } + + cpu->doing_opcode=0; + cpu->int_vector_req=0; + + return(cpu->tstate); +} + +LIB_EXPORT void z80ex_w_states(Z80EX_CONTEXT *cpu, unsigned w_states) +{ + TSTATES(w_states); +} + +LIB_EXPORT void z80ex_next_t_state(Z80EX_CONTEXT *cpu) +{ + if(cpu->tstate_cb != NULL) cpu->tstate_cb(cpu, cpu->tstate_cb_user_data); + cpu->tstate++; + cpu->op_tstate++; +} + +LIB_EXPORT Z80EX_WORD z80ex_get_reg(Z80EX_CONTEXT *cpu, Z80_REG_T reg) +{ + switch(reg) + { + case regAF: return(AF); + case regBC: return(BC); + case regDE: return(DE); + case regHL: return(HL); + case regAF_: return(AF_); + case regBC_: return(BC_); + case regDE_: return(DE_); + case regHL_: return(HL_); + case regIX: return(IX); + case regIY: return(IY); + case regPC: return(PC); + case regSP: return(SP); + case regI: return(I); + case regR: return(R); + case regR7: return(R7); + case regIM: return(IM); + case regIFF1: return(IFF1); + case regIFF2: return(IFF2); + } + + return(0); +} + +LIB_EXPORT void z80ex_set_reg(Z80EX_CONTEXT *cpu, Z80_REG_T reg, Z80EX_WORD value) +{ + switch(reg) + { + case regAF: AF=value; return; + case regBC: BC=value; return; + case regDE: DE=value; return; + case regHL: HL=value; return; + case regAF_: AF_=value; return; + case regBC_: BC_=value; return; + case regDE_: DE_=value; return; + case regHL_: HL_=value; return; + case regIX: IX=value; return; + case regIY: IY=value; return; + case regPC: PC=value; return; + case regSP: SP=value; return; + case regI: I=(value & 0xff); return; + case regR: R=(value & 0xff); return; + case regR7: R7=(value & 0xff); return; + case regIM: + switch(value & 0x03) + { + case 0: IM=IM0; return; + case 1: IM=IM1; return; + case 2: IM=IM2; return; + } + case regIFF1: IFF1=(value & 0x01); return; + case regIFF2: IFF2=(value & 0x01); return; + } +} + +LIB_EXPORT int z80ex_op_tstate(Z80EX_CONTEXT *cpu) +{ + return(cpu->tstate); +} + +LIB_EXPORT int z80ex_doing_halt(Z80EX_CONTEXT *cpu) +{ + return(cpu->halted); +} + +/*LIB_EXPORT int z80ex_get_noint_once(Z80EX_CONTEXT *cpu) +{ + return(cpu->noint_once); +}*/ + +LIB_EXPORT int z80ex_int_possible(Z80EX_CONTEXT *cpu) +{ + return((!IFF1 || cpu->noint_once || cpu->doing_opcode || cpu->prefix)? 0 : 1); +} + +LIB_EXPORT int z80ex_nmi_possible(Z80EX_CONTEXT *cpu) +{ + return((cpu->noint_once || cpu->doing_opcode || cpu->prefix)? 0 : 1); +} + diff --git a/third_party/z80ex/z80ex_dasm.c b/third_party/z80ex/z80ex_dasm.c new file mode 100644 index 00000000..a166cc8d --- /dev/null +++ b/third_party/z80ex/z80ex_dasm.c @@ -0,0 +1,189 @@ +/* + * Z80Ex, ZILoG Z80 CPU emulator. + * + * by Pigmaker57 aka boo_boo [pigmaker57@kahoh57.info] + * + * contains some code from the FUSE project (http://fuse-emulator.sourceforge.net) + * Released under GNU GPL v2 + * + */ + +#include +#include +#define __USE_ISOC99 +#include +#include + +#define __Z80EX_SELF_INCLUDE +#include "z80ex_dasm.h" + +#ifdef _MSC_VER +#define snprintf _snprintf +#endif + +typedef struct { + const char *mnemonic; + int t_states; + int t_states2; +} z80ex_opc_dasm; + +#include "opcodes/opcodes_dasm.c" + +static const char *formats[] = { + "#%02X", /*bytes*/ + "#%04X", /*words*/ + "%d" /*WORDS_DEC, BYTES_DEC*/ +}; + +#define STMP_SIZE 100 + +LIB_EXPORT int z80ex_dasm(char *output, int output_size, unsigned flags, int *t_states, int *t_states2, + z80ex_dasm_readbyte_cb readbyte_cb, Z80EX_WORD addr, void *user_data) +{ + Z80EX_BYTE opc=0, next=0, disp_u=0; + Z80EX_SIGNED_BYTE disp; + int have_disp=0; + int out_len=0; + int bytes=0; + const char *bytes_format=formats[0]; + const char *words_format=formats[1]; + const z80ex_opc_dasm *dasm = NULL; + static char stmp[STMP_SIZE]; + + if(flags & WORDS_DEC) words_format = formats[2]; + if(flags & BYTES_DEC) bytes_format = formats[2]; + + *output='\0'; + *t_states=0; + *t_states2=0; + + opc = readbyte_cb(addr++,user_data); + bytes++; + + switch(opc) + { + case 0xDD: + case 0xFD: + next = readbyte_cb(addr++,user_data); + if((next | 0x20) == 0xFD || next == 0xED) + { + strncpy(output,"NOP*",output_size-1); + *t_states=4; + dasm=NULL; + } + else if(next == 0xCB) + { + disp_u = readbyte_cb(addr++,user_data); + next = readbyte_cb(addr++,user_data); + bytes+=3; + + dasm = (opc==0xDD)? &dasm_ddcb[next]: &dasm_fdcb[next]; + have_disp=1; + } + else + { + bytes++; + dasm = (opc==0xDD)? &dasm_dd[next]: &dasm_fd[next]; + if(dasm->mnemonic == NULL) /*mirrored instructions*/ + { + dasm = &dasm_base[next]; + *t_states=4; + *t_states2=4; + } + } + break; + + case 0xED: + next = readbyte_cb(addr++,user_data); + bytes++; + dasm = &dasm_ed[next]; + if(dasm->mnemonic == NULL) + { + strncpy(output,"NOP*",output_size-1); + *t_states=8; + dasm=NULL; + } + break; + + case 0xCB: + next = readbyte_cb(addr++,user_data); + bytes++; + dasm = &dasm_cb[next]; + break; + + default: + dasm = &dasm_base[opc]; + break; + } + + if(dasm!=NULL) + { + const char *mpos; + int arglen; + Z80EX_BYTE hi,lo; + char *outpos=output; + + for(mpos=(dasm->mnemonic); *mpos && out_len < output_size; mpos++) + { + *stmp='\0'; + + switch(*mpos) + { + case '@': + lo=readbyte_cb(addr++,user_data); + hi=readbyte_cb(addr++,user_data); + bytes+=2; + + arglen=snprintf(stmp,STMP_SIZE,words_format,(int)(lo+hi*0x100)); + + break; + + case '$': + case '%': + if(!have_disp) disp_u = readbyte_cb(addr++,user_data); + bytes++; + disp = (disp_u & 0x80)? -(((~disp_u) & 0x7f)+1): disp_u; + + if(*mpos == '$') + arglen=snprintf(stmp,STMP_SIZE,bytes_format,(int)disp); + else + arglen=snprintf(stmp,STMP_SIZE,words_format,(int)((Z80EX_WORD)(addr+disp))); + + break; + + case '#': + lo = readbyte_cb(addr++,user_data); + bytes++; + + arglen=snprintf(stmp,STMP_SIZE,bytes_format,(int)lo); + + break; + + default: + *(outpos++) = *mpos; + out_len++; + arglen=0; + break; + } + + if(arglen) + { + if(out_len+arglen >= output_size) break; + strcpy(outpos,stmp); + out_len+=arglen; + outpos+=arglen; + } + } + + *outpos = '\0'; + + *t_states+=dasm->t_states; + *t_states2+=dasm->t_states2; + } + + if(*t_states == *t_states2) *t_states2=0; + + return(bytes); +} + + From 6f3b09d4cfd302d6c93567ab7e2ebc6778a96c49 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 5 Apr 2024 15:11:08 +0200 Subject: [PATCH 56/69] Make z80ex build. --- third_party/z80ex/build.py | 22 ++++++++++++++++++++++ tools/cpmemu/build.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 third_party/z80ex/build.py diff --git a/third_party/z80ex/build.py b/third_party/z80ex/build.py new file mode 100644 index 00000000..fe79f920 --- /dev/null +++ b/third_party/z80ex/build.py @@ -0,0 +1,22 @@ +from build.c import clibrary + +clibrary( + name="z80ex", + srcs=[ + "./z80ex.c", + "./z80ex_dasm.c", + "./include/z80ex_dasm.h", + "./include/z80ex_common.h", + ], + hdrs={ + "z80ex/z80ex.h": "./include/z80ex.h", + "z80ex/z80ex_dasm.h": "./include/z80ex_dasm.h", + "z80ex_common.h": "./include/z80ex_common.h", + }, + cflags=[ + "-DZ80EX_VERSION_STR=1.1.21", + "-DZ80EX_VERSION_MAJOR=1", + "-DZ80EX_VERSION_MINOR=1", + "-DZ80EX_API_REVISION=21", + ], +) diff --git a/tools/cpmemu/build.py b/tools/cpmemu/build.py index c34232cd..afa4d7eb 100644 --- a/tools/cpmemu/build.py +++ b/tools/cpmemu/build.py @@ -15,5 +15,6 @@ "./biosbdos.c", ".+biosbdosdata", ], - ldflags= ["-lz80ex", "-lz80ex_dasm", "-lreadline"], + ldflags= ["-lreadline"], + deps = ["third_party/z80ex"], ) From fecd13f34971cbb72f89d76d6c29bcce8d145434 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 5 Apr 2024 23:09:59 +0200 Subject: [PATCH 57/69] Add basic nil support as a special-cased constant 0. --- src/cowfe/expressions.coh | 34 ++++++++++++++++++++++------------ src/cowfe/lexer.coh | 2 ++ src/cowfe/parser.y | 6 ++++-- tests/build.py | 1 + tests/null.good | 2 ++ tests/null.test.cow | 6 ++++++ 6 files changed, 37 insertions(+), 14 deletions(-) create mode 100644 tests/null.good create mode 100644 tests/null.test.cow diff --git a/src/cowfe/expressions.coh b/src/cowfe/expressions.coh index feb8a287..be88c8bc 100644 --- a/src/cowfe/expressions.coh +++ b/src/cowfe/expressions.coh @@ -37,12 +37,6 @@ sub ResolveUntypedConstantsForAddOrSub(lhs: [Node], rhs: [Node]) is elseif IsPtr(lhs.type) != 0 then rhs.type := intptr_type; else - print("lhs.type="); - print_hex_i32(lhs.type as intptr as uint32); - print_nl(); - print("rhs.type="); - print_hex_i32(rhs.type as intptr as uint32); - print_nl(); SimpleError("cannot use an untyped constant in this context"); end if; end if; @@ -55,24 +49,40 @@ sub ResolveUntypedConstantsForAddOrSub(lhs: [Node], rhs: [Node]) is end if; end sub; +sub CheckNumber(node: [Node]) is + if IsNum(node.type) == 0 then + SimpleError("number required"); + end if; +end sub; + +sub CheckNumberOrPointer(node: [Node]) is + if (IsNum(node.type) == 0) and (IsPtr(node.type) == 0) then + SimpleError("number or pointer required"); + end if; +end sub; + +sub CheckNilCompatible(withtype: [Node], withouttype: [Node]) is + if withouttype.constant.value == 0 then + CheckNumberOrPointer(withtype); + else + CheckNumber(withtype); + end if; +end sub; + sub ResolveUntypedConstantsSimply(lhs: [Node], rhs: [Node]) is var ltype := lhs.type; var rtype := rhs.type; if (ltype != (0 as [Type])) and (rtype == (0 as [Type])) then + CheckNilCompatible(lhs, rhs); rhs.type := ltype; elseif (ltype == (0 as [Type])) and (rtype != (0 as [Type])) then + CheckNilCompatible(rhs, lhs); lhs.type := rtype; elseif ltype != rtype then expr_i_cant_do_that(lhs, rhs); end if; end sub; -sub CheckNumber(node: [Node]) is - if IsNum(node.type) == 0 then - SimpleError("number required"); - end if; -end sub; - sub ResolveUntypedConstantsNeedingNumbers(lhs: [Node], rhs: [Node]) is ResolveUntypedConstantsSimply(lhs, rhs); CheckNumber(lhs); diff --git a/src/cowfe/lexer.coh b/src/cowfe/lexer.coh index 451eca27..70a6b7d5 100644 --- a/src/cowfe/lexer.coh +++ b/src/cowfe/lexer.coh @@ -153,6 +153,7 @@ var keyword_names: string[] := { "interface", "implements", "loop", + "nil", "not", "or", "record", @@ -196,6 +197,7 @@ var keyword_ids: uint8[] := { INTERFACE, IMPLEMENTS, LOOP, + NIL, NOT, OR, RECORD, diff --git a/src/cowfe/parser.y b/src/cowfe/parser.y index 73f74bff..93218622 100644 --- a/src/cowfe/parser.y +++ b/src/cowfe/parser.y @@ -6,6 +6,7 @@ %token OPENBR CLOSEBR ID NUMBER AT BYTESOF ELSEIF. %token INT TYPEDEF SIZEOF STRING. %token IMPL DECL EXTERN INTERFACE. +%token NIL. %left COMMA. %left AND. @@ -86,10 +87,10 @@ statement ::= VAR newid(S) ASSIGN expression(E) SEMICOLON. { var type := E.type; if type == (0 as [Type]) then - SimpleError("types cannot be inferred for numeric constants"); + SimpleError("types cannot be inferred for untyped constants"); end if; if IsScalar(type) == 0 then - SimpleError("you can only assign to lvalues"); + SimpleError("you can only assign scalars"); end if; InitVariable(current_subr, S, type); @@ -396,6 +397,7 @@ conditional(R) ::= expression(T1) LEOP expression(T2). %type leafexpression {[Node]} leafexpression(E) ::= NUMBER(T). { E := MidConstant(T.number); } leafexpression(E) ::= OPENPAREN expression(E1) CLOSEPAREN. { E := E1; } +leafexpression(E) ::= NIL. { E := MidConstant(0); } %type expression {[Node]} expression(E) ::= leafexpression(E1). { E := E1; } diff --git a/tests/build.py b/tests/build.py index cdcd00b5..b1a57d49 100644 --- a/tests/build.py +++ b/tests/build.py @@ -37,6 +37,7 @@ "mul-8bit-s", "mul-8bit-u", "nested-calls", + "null", "outputparams", "pointers", "rangetypes", diff --git a/tests/null.good b/tests/null.good new file mode 100644 index 00000000..4faf30c9 --- /dev/null +++ b/tests/null.good @@ -0,0 +1,2 @@ +p == 0: yes +p == nil: yes diff --git a/tests/null.test.cow b/tests/null.test.cow new file mode 100644 index 00000000..6ffa512b --- /dev/null +++ b/tests/null.test.cow @@ -0,0 +1,6 @@ +include "cowgol.coh"; +include "tests/_framework.coh"; + +var p: [uint8] := nil; +print("p == 0"); if p == (0 as [uint8]) then yes(); else no(); end if; +print("p == nil"); if p == nil then yes(); else no(); end if; From 6ef62ed798781c4109bfe0082cf846bf147b02a3 Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 5 Apr 2024 23:18:19 +0200 Subject: [PATCH 58/69] Update bootstrap. --- bootstrap/cowbe-cgen.bootstrap.c | 9354 ++++----- bootstrap/cowfe-cgen.bootstrap.c | 27992 +++++++++++++-------------- bootstrap/cowlink-cgen.bootstrap.c | 2372 +-- bootstrap/cowwrap.bootstrap.c | 1510 +- update-bootstrap.sh | 8 +- 5 files changed, 20614 insertions(+), 20622 deletions(-) diff --git a/bootstrap/cowbe-cgen.bootstrap.c b/bootstrap/cowbe-cgen.bootstrap.c index 1f3d40ba..1bd07ffb 100644 --- a/bootstrap/cowbe-cgen.bootstrap.c +++ b/bootstrap/cowbe-cgen.bootstrap.c @@ -3,7 +3,7 @@ static i8 workspace[0x022e]; #define ws ((i1*)workspace) // ExitWithError workspace at ws+4288 length ws+0 -void f6_ExitWithError(void) { +void f5_ExitWithError(void) { @@ -14,7 +14,7 @@ exit(1); } // MemSet workspace at ws+4240 length ws+24 -void f7_MemSet(void) { +void f6_MemSet(void) { @@ -31,7 +31,7 @@ memset((void*)(intptr_t) } // print_char workspace at ws+4304 length ws+1 -void f9_print_char(void) { +void f8_print_char(void) { @@ -42,12 +42,12 @@ putchar( } - void f9_print_char(void); + void f8_print_char(void); // print workspace at ws+4288 length ws+9 -void f12_print(void) { +void f11_print(void) { -c02_0001:; +c01_0001:; i8 v6 = (i8)(intptr_t)(ws+4288); i8 v7 = *(i8*)(intptr_t)v6; @@ -58,20 +58,20 @@ c02_0001:; i8 v10 = (i8)(intptr_t)(ws+4296); i1 v11 = *(i1*)(intptr_t)v10; i1 v12 = (i1)+0; - if (v11==v12) goto c02_0006; else goto c02_0007; + if (v11==v12) goto c01_0006; else goto c01_0007; -c02_0006:; +c01_0006:; return; -c02_0007:; +c01_0007:; -c02_0003:; +c01_0003:; i8 v13 = (i8)(intptr_t)(ws+4296); i1 v14 = *(i1*)(intptr_t)v13; *(i1*)(intptr_t)(ws+4304) = v14; - i8 v15 = (i8)(intptr_t)(f9_print_char); + i8 v15 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v15)(); @@ -81,33 +81,33 @@ c02_0003:; i8 v19 = (i8)(intptr_t)(ws+4288); *(i8*)(intptr_t)v19 = v18; - goto c02_0001; + goto c01_0001; -c02_0002:; +c01_0002:; } - void f9_print_char(void); + void f8_print_char(void); // print_nl workspace at ws+4288 length ws+0 -void f13_print_nl(void) { +void f12_print_nl(void) { i1 v20 = (i1)+10; *(i1*)(intptr_t)(ws+4304) = v20; - i8 v21 = (i8)(intptr_t)(f9_print_char); + i8 v21 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v21)(); } // UIToA workspace at ws+4328 length ws+49 -void f14_UIToA(void) { +void f13_UIToA(void) { i8 v22 = (i8)(intptr_t)(ws+4336); i8 v23 = *(i8*)(intptr_t)v22; i8 v24 = (i8)(intptr_t)(ws+4344); *(i8*)(intptr_t)v24 = v23; -c02_0008:; +c01_0008:; i8 v25 = (i8)(intptr_t)(ws+4328); i4 v26 = *(i4*)(intptr_t)v25; @@ -130,9 +130,9 @@ c02_0008:; i8 v39 = (i8)(intptr_t)(ws+4352); i4 v40 = *(i4*)(intptr_t)v39; i4 v41 = (i4)+10; - if (v40>v178; i1 v180 = v179; *(i1*)(intptr_t)(ws+4296) = v180; - i8 v181 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v181 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v181)(); @@ -406,18 +406,18 @@ void f20_print_hex_i16(void) { i2 v183 = *(i2*)(intptr_t)v182; i1 v184 = v183; *(i1*)(intptr_t)(ws+4296) = v184; - i8 v185 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v185 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v185)(); } - void f19_print_hex_i8(void); - void f19_print_hex_i8(void); - void f19_print_hex_i8(void); - void f19_print_hex_i8(void); + void f18_print_hex_i8(void); + void f18_print_hex_i8(void); + void f18_print_hex_i8(void); + void f18_print_hex_i8(void); // print_hex_i32 workspace at ws+4288 length ws+4 -void f21_print_hex_i32(void) { +void f20_print_hex_i32(void) { i8 v186 = (i8)(intptr_t)(ws+4288); i4 v187 = *(i4*)(intptr_t)v186; @@ -425,7 +425,7 @@ void f21_print_hex_i32(void) { i4 v189 = ((i4)v187)>>v188; i1 v190 = v189; *(i1*)(intptr_t)(ws+4296) = v190; - i8 v191 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v191 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v191)(); @@ -435,7 +435,7 @@ void f21_print_hex_i32(void) { i4 v195 = ((i4)v193)>>v194; i1 v196 = v195; *(i1*)(intptr_t)(ws+4296) = v196; - i8 v197 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v197 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v197)(); @@ -445,7 +445,7 @@ void f21_print_hex_i32(void) { i4 v201 = ((i4)v199)>>v200; i1 v202 = v201; *(i1*)(intptr_t)(ws+4296) = v202; - i8 v203 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v203 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v203)(); @@ -453,15 +453,15 @@ void f21_print_hex_i32(void) { i4 v205 = *(i4*)(intptr_t)v204; i1 v206 = v205; *(i1*)(intptr_t)(ws+4296) = v206; - i8 v207 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v207 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v207)(); } - void f7_MemSet(void); + void f6_MemSet(void); // MemZero workspace at ws+4176 length ws+16 -void f23_MemZero(void) { +void f22_MemZero(void) { i8 v309 = (i8)(intptr_t)(ws+4176); i8 v310 = *(i8*)(intptr_t)v309; @@ -471,14 +471,14 @@ void f23_MemZero(void) { i8 v312 = (i8)(intptr_t)(ws+4184); i8 v313 = *(i8*)(intptr_t)v312; *(i8*)(intptr_t)(ws+4256) = v313; - i8 v314 = (i8)(intptr_t)(f7_MemSet); + i8 v314 = (i8)(intptr_t)(f6_MemSet); ((void(*)(void))(intptr_t)v314)(); } // ArgvInit workspace at ws+4008 length ws+0 -void f24_ArgvInit(void) { +void f23_ArgvInit(void) { @@ -496,14 +496,14 @@ void f24_ArgvInit(void) { } // ArgvNext workspace at ws+4008 length ws+8 -void f25_ArgvNext(void) { +void f24_ArgvNext(void) { i8 v319 = (i8)(intptr_t)(ws+16); i8 v320 = *(i8*)(intptr_t)v319; i8 v321 = (i8)+0; - if (v320==v321) goto c02_0052; else goto c02_0053; + if (v320==v321) goto c01_0052; else goto c01_0053; -c02_0052:; +c01_0052:; i8 v322 = (i8)+0; i8 v323 = (i8)(intptr_t)(ws+4008); @@ -511,9 +511,9 @@ c02_0052:; return; -c02_0053:; +c01_0053:; -c02_004f:; +c01_004f:; i8 v324 = (i8)(intptr_t)(ws+16); i8 v325 = *(i8*)(intptr_t)v324; @@ -524,17 +524,17 @@ c02_004f:; i8 v328 = (i8)(intptr_t)(ws+4008); i8 v329 = *(i8*)(intptr_t)v328; i8 v330 = (i8)+0; - if (v329==v330) goto c02_0057; else goto c02_0058; + if (v329==v330) goto c01_0057; else goto c01_0058; -c02_0057:; +c01_0057:; i8 v331 = (i8)+0; i8 v332 = (i8)(intptr_t)(ws+16); *(i8*)(intptr_t)v332 = v331; - goto c02_0054; + goto c01_0054; -c02_0058:; +c01_0058:; i8 v333 = (i8)(intptr_t)(ws+16); i8 v334 = *(i8*)(intptr_t)v333; @@ -542,19 +542,19 @@ c02_0058:; i8 v336 = (i8)(intptr_t)(ws+16); *(i8*)(intptr_t)v336 = v335; -c02_0054:; +c01_0054:; } // StrLen workspace at ws+4064 length ws+25 -void f29_StrLen(void) { +void f28_StrLen(void) { i8 v406 = (i8)(intptr_t)(ws+4064); i8 v407 = *(i8*)(intptr_t)v406; i8 v408 = (i8)(intptr_t)(ws+4080); *(i8*)(intptr_t)v408 = v407; -c02_0075:; +c01_0075:; i8 v409 = (i8)(intptr_t)(ws+4080); i8 v410 = *(i8*)(intptr_t)v409; @@ -565,15 +565,15 @@ c02_0075:; i8 v413 = (i8)(intptr_t)(ws+4088); i1 v414 = *(i1*)(intptr_t)v413; i1 v415 = (i1)+0; - if (v414==v415) goto c02_007a; else goto c02_007b; + if (v414==v415) goto c01_007a; else goto c01_007b; -c02_007a:; +c01_007a:; - goto c02_0076; + goto c01_0076; -c02_007b:; +c01_007b:; -c02_0077:; +c01_0077:; i8 v416 = (i8)(intptr_t)(ws+4080); i8 v417 = *(i8*)(intptr_t)v416; @@ -581,9 +581,9 @@ c02_0077:; i8 v419 = (i8)(intptr_t)(ws+4080); *(i8*)(intptr_t)v419 = v418; - goto c02_0075; + goto c01_0075; -c02_0076:; +c01_0076:; i8 v420 = (i8)(intptr_t)(ws+4080); i8 v421 = *(i8*)(intptr_t)v420; @@ -596,16 +596,16 @@ c02_0076:; } // MemCopy workspace at ws+4264 length ws+24 -void f31_MemCopy(void) { +void f30_MemCopy(void) { -c02_0083:; +c01_0083:; i8 v445 = (i8)(intptr_t)(ws+4272); i8 v446 = *(i8*)(intptr_t)v445; i8 v447 = (i8)+0; - if (v446==v447) goto c02_0088; else goto c02_0087; + if (v446==v447) goto c01_0088; else goto c01_0087; -c02_0087:; +c01_0087:; i8 v448 = (i8)(intptr_t)(ws+4264); i8 v449 = *(i8*)(intptr_t)v448; @@ -632,14 +632,14 @@ c02_0087:; i8 v464 = (i8)(intptr_t)(ws+4272); *(i8*)(intptr_t)v464 = v463; - goto c02_0083; + goto c01_0083; -c02_0088:; +c01_0088:; } // RawAlloc workspace at ws+4272 length ws+16 -void f32_RawAlloc(void) { +void f31_RawAlloc(void) { @@ -651,18 +651,18 @@ void f32_RawAlloc(void) { } - void f32_RawAlloc(void); -const i1 c02_s0000[] = { 0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x6d,0x65,0x6d,0x6f,0x72,0x79,0 }; - void f12_print(void); - void f6_ExitWithError(void); + void f31_RawAlloc(void); +const i1 c01_s0000[] = { 0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x6d,0x65,0x6d,0x6f,0x72,0x79,0 }; + void f11_print(void); + void f5_ExitWithError(void); // Alloc workspace at ws+4152 length ws+24 -void f33_Alloc(void) { +void f32_Alloc(void) { i8 v465 = (i8)(intptr_t)(ws+4152); i8 v466 = *(i8*)(intptr_t)v465; *(i8*)(intptr_t)(ws+4272) = v466; - i8 v467 = (i8)(intptr_t)(f32_RawAlloc); + i8 v467 = (i8)(intptr_t)(f31_RawAlloc); ((void(*)(void))(intptr_t)v467)(); @@ -678,28 +678,28 @@ void f33_Alloc(void) { i8 v473 = (i8)(intptr_t)(ws+4160); i8 v474 = *(i8*)(intptr_t)v473; i8 v475 = (i8)+0; - if (v474==v475) goto c02_008c; else goto c02_008d; + if (v474==v475) goto c01_008c; else goto c01_008d; -c02_008c:; +c01_008c:; - i8 v476 = (i8)(intptr_t)c02_s0000; + i8 v476 = (i8)(intptr_t)c01_s0000; *(i8*)(intptr_t)(ws+4288) = v476; - i8 v477 = (i8)(intptr_t)(f12_print); + i8 v477 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v477)(); - i8 v478 = (i8)(intptr_t)(f6_ExitWithError); + i8 v478 = (i8)(intptr_t)(f5_ExitWithError); ((void(*)(void))(intptr_t)v478)(); -c02_008d:; +c01_008d:; -c02_0089:; +c01_0089:; } // Free workspace at ws+4280 length ws+8 -void f34_Free(void) { +void f33_Free(void) { @@ -712,7 +712,7 @@ free((void*)(intptr_t) } // GetFreeMemory workspace at ws+3992 length ws+8 -void f38_GetFreeMemory(void) { +void f37_GetFreeMemory(void) { i8 v479 = (i8)+0; i8 v480 = (i8)(intptr_t)(ws+3992); @@ -721,7 +721,7 @@ void f38_GetFreeMemory(void) { } // _fcb_init workspace at ws+4056 length ws+8 -void f41__fcb_init(void) { +void f40__fcb_init(void) { i4 v481 = (i4)+0; i8 v482 = (i8)(intptr_t)(ws+4056); @@ -750,7 +750,7 @@ void f41__fcb_init(void) { } // _fcb_advance workspace at ws+4408 length ws+8 -void f42__fcb_advance(void) { +void f41__fcb_advance(void) { i8 v497 = (i8)(intptr_t)(ws+4408); i8 v498 = *(i8*)(intptr_t)v497; @@ -763,11 +763,11 @@ void f42__fcb_advance(void) { *(i2*)(intptr_t)v504 = v501; } - void f39_FCBRawRead(void); - void f42__fcb_advance(void); + void f38_FCBRawRead(void); + void f41__fcb_advance(void); // _fcb_fillbuffer workspace at ws+4176 length ws+18 -void f43__fcb_fillbuffer(void) { +void f42__fcb_fillbuffer(void) { i8 v505 = (i8)(intptr_t)(ws+4176); i8 v506 = *(i8*)(intptr_t)v505; @@ -790,7 +790,7 @@ void f43__fcb_fillbuffer(void) { *(i4*)(intptr_t)(ws+4208) = v519; i2 v520 = (i2)+512; *(i2*)(intptr_t)(ws+4212) = v520; - i8 v521 = (i8)(intptr_t)(f39_FCBRawRead); + i8 v521 = (i8)(intptr_t)(f38_FCBRawRead); ((void(*)(void))(intptr_t)v521)(); @@ -815,15 +815,15 @@ void f43__fcb_fillbuffer(void) { i1 v534 = *(i1*)(intptr_t)v533; i1 v535 = v534&(+1); i1 v536 = (i1)+0; - if (v535==v536) goto c02_0092; else goto c02_0091; + if (v535==v536) goto c01_0092; else goto c01_0091; -c02_0091:; +c01_0091:; return; -c02_0092:; +c01_0092:; -c02_008e:; +c01_008e:; i1 v537 = (i1)+2; i8 v538 = (i8)(intptr_t)(ws+4176); @@ -849,9 +849,9 @@ c02_008e:; i8 v552 = v551+(+8); i2 v553 = *(i2*)(intptr_t)v552; i2 v554 = (i2)+0; - if (v553==v554) goto c02_0097; else goto c02_0096; + if (v553==v554) goto c01_0097; else goto c01_0096; -c02_0096:; +c01_0096:; i8 v555 = (i8)(intptr_t)(ws+4176); i8 v556 = *(i8*)(intptr_t)v555; @@ -863,19 +863,19 @@ c02_0096:; i8 v560 = (i8)(intptr_t)(ws+4176); i8 v561 = *(i8*)(intptr_t)v560; *(i8*)(intptr_t)(ws+4408) = v561; - i8 v562 = (i8)(intptr_t)(f42__fcb_advance); + i8 v562 = (i8)(intptr_t)(f41__fcb_advance); ((void(*)(void))(intptr_t)v562)(); -c02_0097:; +c01_0097:; -c02_0093:; +c01_0093:; } - void f40_FCBRawWrite(void); + void f39_FCBRawWrite(void); // FCBFlush workspace at ws+4408 length ws+12 -void f44_FCBFlush(void) { +void f43_FCBFlush(void) { i8 v563 = (i8)(intptr_t)(ws+4408); i8 v564 = *(i8*)(intptr_t)v563; @@ -890,9 +890,9 @@ void f44_FCBFlush(void) { i1 v571 = *(i1*)(intptr_t)v570; i1 v572 = v571&(+4); i1 v573 = (i1)+0; - if (v572==v573) goto c02_009c; else goto c02_009b; + if (v572==v573) goto c01_009c; else goto c01_009b; -c02_009b:; +c01_009b:; i8 v574 = (i8)(intptr_t)(ws+4408); i8 v575 = *(i8*)(intptr_t)v574; @@ -905,7 +905,7 @@ c02_009b:; i8 v580 = v579+(+10); i2 v581 = *(i2*)(intptr_t)v580; *(i2*)(intptr_t)(ws+4436) = v581; - i8 v582 = (i8)(intptr_t)(f40_FCBRawWrite); + i8 v582 = (i8)(intptr_t)(f39_FCBRawWrite); ((void(*)(void))(intptr_t)v582)(); @@ -915,19 +915,19 @@ c02_009b:; i1 v586 = *(i1*)(intptr_t)v585; i1 v587 = v586&(+1); i1 v588 = (i1)+0; - if (v587==v588) goto c02_00a1; else goto c02_00a0; + if (v587==v588) goto c01_00a1; else goto c01_00a0; -c02_00a0:; +c01_00a0:; return; -c02_00a1:; +c01_00a1:; -c02_009d:; +c01_009d:; -c02_009c:; +c01_009c:; -c02_0098:; +c01_0098:; i8 v589 = (i8)(intptr_t)(ws+4416); i4 v590 = *(i4*)(intptr_t)v589; @@ -961,16 +961,16 @@ c02_0098:; *(i2*)(intptr_t)v611 = v608; } - void f44_FCBFlush(void); - void f42__fcb_advance(void); + void f43_FCBFlush(void); + void f41__fcb_advance(void); // _fcb_flushbuffer workspace at ws+4392 length ws+9 -void f45__fcb_flushbuffer(void) { +void f44__fcb_flushbuffer(void) { i8 v612 = (i8)(intptr_t)(ws+4392); i8 v613 = *(i8*)(intptr_t)v612; *(i8*)(intptr_t)(ws+4408) = v613; - i8 v614 = (i8)(intptr_t)(f44_FCBFlush); + i8 v614 = (i8)(intptr_t)(f43_FCBFlush); ((void(*)(void))(intptr_t)v614)(); @@ -980,15 +980,15 @@ void f45__fcb_flushbuffer(void) { i1 v618 = *(i1*)(intptr_t)v617; i1 v619 = v618&(+1); i1 v620 = (i1)+0; - if (v619==v620) goto c02_00a6; else goto c02_00a5; + if (v619==v620) goto c01_00a6; else goto c01_00a5; -c02_00a5:; +c01_00a5:; return; -c02_00a6:; +c01_00a6:; -c02_00a2:; +c01_00a2:; i1 v621 = (i1)+4; i8 v622 = (i8)(intptr_t)(ws+4392); @@ -1006,17 +1006,17 @@ c02_00a2:; i8 v630 = (i8)(intptr_t)(ws+4392); i8 v631 = *(i8*)(intptr_t)v630; *(i8*)(intptr_t)(ws+4408) = v631; - i8 v632 = (i8)(intptr_t)(f42__fcb_advance); + i8 v632 = (i8)(intptr_t)(f41__fcb_advance); ((void(*)(void))(intptr_t)v632)(); } - void f44_FCBFlush(void); - void f43__fcb_fillbuffer(void); - void f42__fcb_advance(void); + void f43_FCBFlush(void); + void f42__fcb_fillbuffer(void); + void f41__fcb_advance(void); // FCBGetChar workspace at ws+4160 length ws+13 -void f46_FCBGetChar(void) { +void f45_FCBGetChar(void) { i8 v633 = (i8)(intptr_t)(ws+4160); i8 v634 = *(i8*)(intptr_t)v633; @@ -1024,20 +1024,20 @@ void f46_FCBGetChar(void) { i1 v636 = *(i1*)(intptr_t)v635; i1 v637 = v636&(+4); i1 v638 = (i1)+0; - if (v637==v638) goto c02_00ab; else goto c02_00aa; + if (v637==v638) goto c01_00ab; else goto c01_00aa; -c02_00aa:; +c01_00aa:; i8 v639 = (i8)(intptr_t)(ws+4160); i8 v640 = *(i8*)(intptr_t)v639; *(i8*)(intptr_t)(ws+4408) = v640; - i8 v641 = (i8)(intptr_t)(f44_FCBFlush); + i8 v641 = (i8)(intptr_t)(f43_FCBFlush); ((void(*)(void))(intptr_t)v641)(); -c02_00ab:; +c01_00ab:; -c02_00a7:; +c01_00a7:; i8 v642 = (i8)(intptr_t)(ws+4160); i8 v643 = *(i8*)(intptr_t)v642; @@ -1052,14 +1052,14 @@ c02_00a7:; i8 v650 = *(i8*)(intptr_t)v649; i8 v651 = v650+(+8); i2 v652 = *(i2*)(intptr_t)v651; - if (v648==v652) goto c02_00af; else goto c02_00b0; + if (v648==v652) goto c01_00af; else goto c01_00b0; -c02_00af:; +c01_00af:; i8 v653 = (i8)(intptr_t)(ws+4160); i8 v654 = *(i8*)(intptr_t)v653; *(i8*)(intptr_t)(ws+4176) = v654; - i8 v655 = (i8)(intptr_t)(f43__fcb_fillbuffer); + i8 v655 = (i8)(intptr_t)(f42__fcb_fillbuffer); ((void(*)(void))(intptr_t)v655)(); @@ -1072,9 +1072,9 @@ c02_00af:; i8 v660 = (i8)(intptr_t)(ws+4168); *(i1*)(intptr_t)v660 = v659; - goto c02_00ac; + goto c01_00ac; -c02_00b0:; +c01_00b0:; i8 v661 = (i8)(intptr_t)(ws+4160); i8 v662 = *(i8*)(intptr_t)v661; @@ -1090,19 +1090,19 @@ c02_00b0:; i8 v670 = (i8)(intptr_t)(ws+4160); i8 v671 = *(i8*)(intptr_t)v670; *(i8*)(intptr_t)(ws+4408) = v671; - i8 v672 = (i8)(intptr_t)(f42__fcb_advance); + i8 v672 = (i8)(intptr_t)(f41__fcb_advance); ((void(*)(void))(intptr_t)v672)(); -c02_00ac:; +c01_00ac:; } - void f44_FCBFlush(void); - void f45__fcb_flushbuffer(void); - void f42__fcb_advance(void); + void f43_FCBFlush(void); + void f44__fcb_flushbuffer(void); + void f41__fcb_advance(void); // FCBPutChar workspace at ws+4376 length ws+12 -void f47_FCBPutChar(void) { +void f46_FCBPutChar(void) { i8 v673 = (i8)(intptr_t)(ws+4376); i8 v674 = *(i8*)(intptr_t)v673; @@ -1110,20 +1110,20 @@ void f47_FCBPutChar(void) { i1 v676 = *(i1*)(intptr_t)v675; i1 v677 = v676&(+2); i1 v678 = (i1)+0; - if (v677==v678) goto c02_00b5; else goto c02_00b4; + if (v677==v678) goto c01_00b5; else goto c01_00b4; -c02_00b4:; +c01_00b4:; i8 v679 = (i8)(intptr_t)(ws+4376); i8 v680 = *(i8*)(intptr_t)v679; *(i8*)(intptr_t)(ws+4408) = v680; - i8 v681 = (i8)(intptr_t)(f44_FCBFlush); + i8 v681 = (i8)(intptr_t)(f43_FCBFlush); ((void(*)(void))(intptr_t)v681)(); -c02_00b5:; +c01_00b5:; -c02_00b1:; +c01_00b1:; i8 v682 = (i8)(intptr_t)(ws+4376); i8 v683 = *(i8*)(intptr_t)v682; @@ -1135,9 +1135,9 @@ c02_00b1:; i8 v687 = (i8)(intptr_t)(ws+4386); i2 v688 = *(i2*)(intptr_t)v687; i2 v689 = (i2)+512; - if (v688==v689) goto c02_00b9; else goto c02_00ba; + if (v688==v689) goto c01_00b9; else goto c01_00ba; -c02_00b9:; +c01_00b9:; i8 v690 = (i8)(intptr_t)(ws+4376); i8 v691 = *(i8*)(intptr_t)v690; @@ -1145,13 +1145,13 @@ c02_00b9:; i8 v692 = (i8)(intptr_t)(ws+4384); i1 v693 = *(i1*)(intptr_t)v692; *(i1*)(intptr_t)(ws+4400) = v693; - i8 v694 = (i8)(intptr_t)(f45__fcb_flushbuffer); + i8 v694 = (i8)(intptr_t)(f44__fcb_flushbuffer); ((void(*)(void))(intptr_t)v694)(); - goto c02_00b6; + goto c01_00b6; -c02_00ba:; +c01_00ba:; i8 v695 = (i8)(intptr_t)(ws+4384); i1 v696 = *(i1*)(intptr_t)v695; @@ -1167,11 +1167,11 @@ c02_00ba:; i8 v704 = (i8)(intptr_t)(ws+4376); i8 v705 = *(i8*)(intptr_t)v704; *(i8*)(intptr_t)(ws+4408) = v705; - i8 v706 = (i8)(intptr_t)(f42__fcb_advance); + i8 v706 = (i8)(intptr_t)(f41__fcb_advance); ((void(*)(void))(intptr_t)v706)(); -c02_00b6:; +c01_00b6:; i8 v707 = (i8)(intptr_t)(ws+4376); i8 v708 = *(i8*)(intptr_t)v707; @@ -1186,7 +1186,7 @@ c02_00b6:; } // FCBPos workspace at ws+4288 length ws+12 -void f48_FCBPos(void) { +void f47_FCBPos(void) { i8 v715 = (i8)(intptr_t)(ws+4288); i8 v716 = *(i8*)(intptr_t)v715; @@ -1204,7 +1204,7 @@ void f48_FCBPos(void) { } // FCBRawRead workspace at ws+4200 length ws+36 -void f39_FCBRawRead(void) { +void f38_FCBRawRead(void) { i8 v790 = (i8)(intptr_t)(ws+4200); i8 v791 = *(i8*)(intptr_t)v790; @@ -1236,9 +1236,9 @@ void f39_FCBRawRead(void) { i8 v798 = (i8)(intptr_t)(ws+4232); i4 v799 = *(i4*)(intptr_t)v798; i4 v800 = (i4)-1; - if (v799==v800) goto c02_00d6; else goto c02_00d7; + if (v799==v800) goto c01_00d6; else goto c01_00d7; -c02_00d6:; +c01_00d6:; i2 v801 = (i2)+0; i8 v802 = (i8)(intptr_t)(ws+4214); @@ -1254,9 +1254,9 @@ c02_00d6:; i8 v810 = v809+(+524); *(i1*)(intptr_t)v810 = v807; - goto c02_00d3; + goto c01_00d3; -c02_00d7:; +c01_00d7:; i8 v811 = (i8)(intptr_t)(ws+4232); i4 v812 = *(i4*)(intptr_t)v811; @@ -1264,12 +1264,12 @@ c02_00d7:; i8 v814 = (i8)(intptr_t)(ws+4214); *(i2*)(intptr_t)v814 = v813; -c02_00d3:; +c01_00d3:; } // FCBRawWrite workspace at ws+4424 length ws+36 -void f40_FCBRawWrite(void) { +void f39_FCBRawWrite(void) { i8 v815 = (i8)(intptr_t)(ws+4424); i8 v816 = *(i8*)(intptr_t)v815; @@ -1301,9 +1301,9 @@ void f40_FCBRawWrite(void) { i8 v823 = (i8)(intptr_t)(ws+4456); i4 v824 = *(i4*)(intptr_t)v823; i4 v825 = (i4)-1; - if (v824==v825) goto c02_00db; else goto c02_00dc; + if (v824==v825) goto c01_00db; else goto c01_00dc; -c02_00db:; +c01_00db:; i8 v826 = (i8)(intptr_t)(ws+4424); i8 v827 = *(i8*)(intptr_t)v826; @@ -1315,20 +1315,20 @@ c02_00db:; i8 v833 = v832+(+524); *(i1*)(intptr_t)v833 = v830; -c02_00dc:; +c01_00dc:; -c02_00d8:; +c01_00d8:; } - void f41__fcb_init(void); + void f40__fcb_init(void); // fcb_i_open workspace at ws+4024 length ws+28 -void f51_fcb_i_open(void) { +void f50_fcb_i_open(void) { i8 v834 = (i8)(intptr_t)(ws+4024); i8 v835 = *(i8*)(intptr_t)v834; *(i8*)(intptr_t)(ws+4056) = v835; - i8 v836 = (i8)(intptr_t)(f41__fcb_init); + i8 v836 = (i8)(intptr_t)(f40__fcb_init); ((void(*)(void))(intptr_t)v836)(); @@ -1358,9 +1358,9 @@ errno = 0; i8 v841 = (i8)(intptr_t)(ws+4048); i4 v842 = *(i4*)(intptr_t)v841; i4 v843 = (i4)+0; - if ((s4)v842<(s4)v843) goto c02_00e0; else goto c02_00e1; + if ((s4)v842<(s4)v843) goto c01_00e0; else goto c01_00e1; -c02_00e0:; +c01_00e0:; @@ -1369,21 +1369,21 @@ c02_00e0:; - goto c02_00dd; + goto c01_00dd; -c02_00e1:; +c01_00e1:; i1 v844 = (i1)+0; i8 v845 = (i8)(intptr_t)(ws+4044); *(i1*)(intptr_t)v845 = v844; -c02_00dd:; +c01_00dd:; } - void f51_fcb_i_open(void); + void f50_fcb_i_open(void); // FCBOpenIn workspace at ws+4000 length ws+18 -void f52_FCBOpenIn(void) { +void f51_FCBOpenIn(void) { i8 v846 = (i8)(intptr_t)(ws+4000); i8 v847 = *(i8*)(intptr_t)v846; @@ -1393,7 +1393,7 @@ void f52_FCBOpenIn(void) { *(i8*)(intptr_t)(ws+4032) = v849; i4 v850 = (i4)+0; *(i4*)(intptr_t)(ws+4040) = v850; - i8 v851 = (i8)(intptr_t)(f51_fcb_i_open); + i8 v851 = (i8)(intptr_t)(f50_fcb_i_open); ((void(*)(void))(intptr_t)v851)(); @@ -1407,10 +1407,10 @@ void f52_FCBOpenIn(void) { *(i1*)(intptr_t)v856 = v855; } - void f51_fcb_i_open(void); + void f50_fcb_i_open(void); // FCBOpenOut workspace at ws+4000 length ws+18 -void f54_FCBOpenOut(void) { +void f53_FCBOpenOut(void) { i8 v868 = (i8)(intptr_t)(ws+4000); i8 v869 = *(i8*)(intptr_t)v868; @@ -1420,7 +1420,7 @@ void f54_FCBOpenOut(void) { *(i8*)(intptr_t)(ws+4032) = v871; i4 v872 = (i4)+578; *(i4*)(intptr_t)(ws+4040) = v872; - i8 v873 = (i8)(intptr_t)(f51_fcb_i_open); + i8 v873 = (i8)(intptr_t)(f50_fcb_i_open); ((void(*)(void))(intptr_t)v873)(); @@ -1434,15 +1434,15 @@ void f54_FCBOpenOut(void) { *(i1*)(intptr_t)v878 = v877; } - void f44_FCBFlush(void); + void f43_FCBFlush(void); // FCBClose workspace at ws+3992 length ws+16 -void f55_FCBClose(void) { +void f54_FCBClose(void) { i8 v879 = (i8)(intptr_t)(ws+3992); i8 v880 = *(i8*)(intptr_t)v879; *(i8*)(intptr_t)(ws+4408) = v880; - i8 v881 = (i8)(intptr_t)(f44_FCBFlush); + i8 v881 = (i8)(intptr_t)(f43_FCBFlush); ((void(*)(void))(intptr_t)v881)(); @@ -1470,19 +1470,19 @@ close( } - void f47_FCBPutChar(void); + void f46_FCBPutChar(void); // FCBPutBlock workspace at ws+4352 length ws+24 -void f59_FCBPutBlock(void) { +void f58_FCBPutBlock(void) { -c02_00ef:; +c01_00ef:; i8 v929 = (i8)(intptr_t)(ws+4368); i8 v930 = *(i8*)(intptr_t)v929; i8 v931 = (i8)+0; - if (v930==v931) goto c02_00f4; else goto c02_00f3; + if (v930==v931) goto c01_00f4; else goto c01_00f3; -c02_00f3:; +c01_00f3:; i8 v932 = (i8)(intptr_t)(ws+4352); i8 v933 = *(i8*)(intptr_t)v932; @@ -1491,7 +1491,7 @@ c02_00f3:; i8 v935 = *(i8*)(intptr_t)v934; i1 v936 = *(i1*)(intptr_t)v935; *(i1*)(intptr_t)(ws+4384) = v936; - i8 v937 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v937 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v937)(); @@ -1507,121 +1507,121 @@ c02_00f3:; i8 v945 = (i8)(intptr_t)(ws+4368); *(i8*)(intptr_t)v945 = v944; - goto c02_00ef; + goto c01_00ef; -c02_00f4:; +c01_00f4:; } // MidReader workspace at ws+4080 length ws+8 -void f60_MidReader(void) { +void f59_MidReader(void) { } -const i1 c02_s0001[] = { 0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0 }; - void f12_print(void); +const i1 c01_s0001[] = { 0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0 }; + void f11_print(void); // StartError workspace at ws+4288 length ws+0 -void f66_StartError(void) { +void f65_StartError(void) { - i8 v956 = (i8)(intptr_t)c02_s0001; + i8 v956 = (i8)(intptr_t)c01_s0001; *(i8*)(intptr_t)(ws+4288) = v956; - i8 v957 = (i8)(intptr_t)(f12_print); + i8 v957 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v957)(); } - void f13_print_nl(void); - void f6_ExitWithError(void); + void f12_print_nl(void); + void f5_ExitWithError(void); // EndError workspace at ws+4288 length ws+0 -void f67_EndError(void) { +void f66_EndError(void) { - i8 v958 = (i8)(intptr_t)(f13_print_nl); + i8 v958 = (i8)(intptr_t)(f12_print_nl); ((void(*)(void))(intptr_t)v958)(); - i8 v959 = (i8)(intptr_t)(f6_ExitWithError); + i8 v959 = (i8)(intptr_t)(f5_ExitWithError); ((void(*)(void))(intptr_t)v959)(); } - void f66_StartError(void); - void f12_print(void); - void f67_EndError(void); + void f65_StartError(void); + void f11_print(void); + void f66_EndError(void); // SimpleError workspace at ws+4280 length ws+8 -void f68_SimpleError(void) { +void f67_SimpleError(void) { - i8 v960 = (i8)(intptr_t)(f66_StartError); + i8 v960 = (i8)(intptr_t)(f65_StartError); ((void(*)(void))(intptr_t)v960)(); i8 v961 = (i8)(intptr_t)(ws+4280); i8 v962 = *(i8*)(intptr_t)v961; *(i8*)(intptr_t)(ws+4288) = v962; - i8 v963 = (i8)(intptr_t)(f12_print); + i8 v963 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v963)(); - i8 v964 = (i8)(intptr_t)(f67_EndError); + i8 v964 = (i8)(intptr_t)(f66_EndError); ((void(*)(void))(intptr_t)v964)(); } - void f66_StartError(void); -const i1 c02_s0002[] = { 0x75,0x6e,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x6f,0x70,0x65,0x6e,0x20,0x27,0 }; - void f12_print(void); - void f12_print(void); -const i1 c02_s0003[] = { 0x27,0 }; - void f12_print(void); - void f67_EndError(void); + void f65_StartError(void); +const i1 c01_s0002[] = { 0x75,0x6e,0x61,0x62,0x6c,0x65,0x20,0x74,0x6f,0x20,0x6f,0x70,0x65,0x6e,0x20,0x27,0 }; + void f11_print(void); + void f11_print(void); +const i1 c01_s0003[] = { 0x27,0 }; + void f11_print(void); + void f66_EndError(void); // CannotOpen workspace at ws+4000 length ws+8 -void f69_CannotOpen(void) { +void f68_CannotOpen(void) { - i8 v965 = (i8)(intptr_t)(f66_StartError); + i8 v965 = (i8)(intptr_t)(f65_StartError); ((void(*)(void))(intptr_t)v965)(); - i8 v966 = (i8)(intptr_t)c02_s0002; + i8 v966 = (i8)(intptr_t)c01_s0002; *(i8*)(intptr_t)(ws+4288) = v966; - i8 v967 = (i8)(intptr_t)(f12_print); + i8 v967 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v967)(); i8 v968 = (i8)(intptr_t)(ws+4000); i8 v969 = *(i8*)(intptr_t)v968; *(i8*)(intptr_t)(ws+4288) = v969; - i8 v970 = (i8)(intptr_t)(f12_print); + i8 v970 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v970)(); - i8 v971 = (i8)(intptr_t)c02_s0003; + i8 v971 = (i8)(intptr_t)c01_s0003; *(i8*)(intptr_t)(ws+4288) = v971; - i8 v972 = (i8)(intptr_t)(f12_print); + i8 v972 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v972)(); - i8 v973 = (i8)(intptr_t)(f67_EndError); + i8 v973 = (i8)(intptr_t)(f66_EndError); ((void(*)(void))(intptr_t)v973)(); } - void f32_RawAlloc(void); - void f71_PurgeAllFreeNodes(void); - void f72_PurgeAllFreeInstructions(void); - void f32_RawAlloc(void); -const i1 c02_s0004[] = { 0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x6d,0x65,0x6d,0x6f,0x72,0x79,0x0a,0 }; - void f12_print(void); - void f6_ExitWithError(void); + void f31_RawAlloc(void); + void f70_PurgeAllFreeNodes(void); + void f71_PurgeAllFreeInstructions(void); + void f31_RawAlloc(void); +const i1 c01_s0004[] = { 0x4f,0x75,0x74,0x20,0x6f,0x66,0x20,0x6d,0x65,0x6d,0x6f,0x72,0x79,0x0a,0 }; + void f11_print(void); + void f5_ExitWithError(void); // InternalAlloc workspace at ws+4240 length ws+32 -void f70_InternalAlloc(void) { +void f69_InternalAlloc(void) { i8 v974 = (i8)(intptr_t)(ws+4240); i8 v975 = *(i8*)(intptr_t)v974; *(i8*)(intptr_t)(ws+4272) = v975; - i8 v976 = (i8)(intptr_t)(f32_RawAlloc); + i8 v976 = (i8)(intptr_t)(f31_RawAlloc); ((void(*)(void))(intptr_t)v976)(); @@ -1637,22 +1637,22 @@ void f70_InternalAlloc(void) { i8 v982 = (i8)(intptr_t)(ws+4248); i8 v983 = *(i8*)(intptr_t)v982; i8 v984 = (i8)+0; - if (v983==v984) goto c02_00f8; else goto c02_00f9; + if (v983==v984) goto c01_00f8; else goto c01_00f9; -c02_00f8:; +c01_00f8:; - i8 v985 = (i8)(intptr_t)(f71_PurgeAllFreeNodes); + i8 v985 = (i8)(intptr_t)(f70_PurgeAllFreeNodes); ((void(*)(void))(intptr_t)v985)(); - i8 v986 = (i8)(intptr_t)(f72_PurgeAllFreeInstructions); + i8 v986 = (i8)(intptr_t)(f71_PurgeAllFreeInstructions); ((void(*)(void))(intptr_t)v986)(); i8 v987 = (i8)(intptr_t)(ws+4240); i8 v988 = *(i8*)(intptr_t)v987; *(i8*)(intptr_t)(ws+4272) = v988; - i8 v989 = (i8)(intptr_t)(f32_RawAlloc); + i8 v989 = (i8)(intptr_t)(f31_RawAlloc); ((void(*)(void))(intptr_t)v989)(); @@ -1668,37 +1668,37 @@ c02_00f8:; i8 v995 = (i8)(intptr_t)(ws+4248); i8 v996 = *(i8*)(intptr_t)v995; i8 v997 = (i8)+0; - if (v996==v997) goto c02_00fd; else goto c02_00fe; + if (v996==v997) goto c01_00fd; else goto c01_00fe; -c02_00fd:; +c01_00fd:; - i8 v998 = (i8)(intptr_t)c02_s0004; + i8 v998 = (i8)(intptr_t)c01_s0004; *(i8*)(intptr_t)(ws+4288) = v998; - i8 v999 = (i8)(intptr_t)(f12_print); + i8 v999 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v999)(); - i8 v1000 = (i8)(intptr_t)(f6_ExitWithError); + i8 v1000 = (i8)(intptr_t)(f5_ExitWithError); ((void(*)(void))(intptr_t)v1000)(); -c02_00fe:; +c01_00fe:; -c02_00fa:; +c01_00fa:; -c02_00f9:; +c01_00f9:; -c02_00f5:; +c01_00f5:; } -const i1 c02_s0005[] = { 0x70,0x61,0x72,0x61,0x6d,0 }; -const i1 c02_s0006[] = { 0x76,0x38,0 }; -const i1 c02_s0007[] = { 0x76,0x34,0 }; -const i1 c02_s0008[] = { 0x76,0x32,0 }; -const i1 c02_s0009[] = { 0x76,0x31,0 }; -static data f3___main_s00ff[] = { +const i1 c01_s0005[] = { 0x70,0x61,0x72,0x61,0x6d,0 }; +const i1 c01_s0006[] = { 0x76,0x38,0 }; +const i1 c01_s0007[] = { 0x76,0x34,0 }; +const i1 c01_s0008[] = { 0x76,0x32,0 }; +const i1 c01_s0009[] = { 0x76,0x31,0 }; +static data f2___main_s00ff[] = { - { .ptr = (void*)c02_s0005 }, + { .ptr = (void*)c01_s0005 }, @@ -1709,7 +1709,7 @@ static data f3___main_s00ff[] = { { .i1 = { 0x10,0x10,0x10,0x00,0x00,0x00,0x00,0x00}}, - { .ptr = (void*)c02_s0006 }, + { .ptr = (void*)c01_s0006 }, @@ -1720,7 +1720,7 @@ static data f3___main_s00ff[] = { { .i1 = { 0x08,0x08,0x08,0x01,0x00,0x00,0x00,0x00}}, - { .ptr = (void*)c02_s0007 }, + { .ptr = (void*)c01_s0007 }, @@ -1731,7 +1731,7 @@ static data f3___main_s00ff[] = { { .i1 = { 0x04,0x04,0x04,0x01,0x00,0x00,0x00,0x00}}, - { .ptr = (void*)c02_s0008 }, + { .ptr = (void*)c01_s0008 }, @@ -1742,7 +1742,7 @@ static data f3___main_s00ff[] = { { .i1 = { 0x02,0x02,0x02,0x01,0x00,0x00,0x00,0x00}}, - { .ptr = (void*)c02_s0009 }, + { .ptr = (void*)c01_s0009 }, @@ -1750,555 +1750,555 @@ static data f3___main_s00ff[] = { { .i1 = { 0x01,0x01,0x01,0x01}}, }; -const i1 c02_s000b[] = { 0x45,0x4e,0x44,0 }; -const i1 c02_s000c[] = { 0x53,0x54,0x41,0x52,0x54,0x46,0x49,0x4c,0x45,0 }; -const i1 c02_s000d[] = { 0x45,0x4e,0x44,0x46,0x49,0x4c,0x45,0 }; -const i1 c02_s000e[] = { 0x53,0x54,0x41,0x52,0x54,0x53,0x55,0x42,0 }; -const i1 c02_s000f[] = { 0x45,0x4e,0x44,0x53,0x55,0x42,0 }; -const i1 c02_s0010[] = { 0x53,0x54,0x41,0x52,0x54,0x49,0x4e,0x49,0x54,0 }; -const i1 c02_s0011[] = { 0x49,0x4e,0x49,0x54,0x30,0 }; -const i1 c02_s0012[] = { 0x49,0x4e,0x49,0x54,0x31,0 }; -const i1 c02_s0013[] = { 0x49,0x4e,0x49,0x54,0x32,0 }; -const i1 c02_s0014[] = { 0x49,0x4e,0x49,0x54,0x34,0 }; -const i1 c02_s0015[] = { 0x49,0x4e,0x49,0x54,0x38,0 }; -const i1 c02_s0016[] = { 0x49,0x4e,0x49,0x54,0x53,0x54,0x52,0x49,0x4e,0x47,0 }; -const i1 c02_s0017[] = { 0x49,0x4e,0x49,0x54,0x41,0x44,0x44,0x52,0x45,0x53,0x53,0 }; -const i1 c02_s0018[] = { 0x49,0x4e,0x49,0x54,0x53,0x55,0x42,0x52,0x45,0x46,0 }; -const i1 c02_s0019[] = { 0x45,0x4e,0x44,0x49,0x4e,0x49,0x54,0 }; -const i1 c02_s001a[] = { 0x41,0x53,0x4d,0x47,0x52,0x4f,0x55,0x50,0x53,0x54,0x41,0x52,0x54,0 }; -const i1 c02_s001b[] = { 0x41,0x53,0x4d,0x47,0x52,0x4f,0x55,0x50,0x45,0x4e,0x44,0 }; -const i1 c02_s001c[] = { 0x41,0x53,0x4d,0x53,0x54,0x41,0x52,0x54,0 }; -const i1 c02_s001d[] = { 0x41,0x53,0x4d,0x54,0x45,0x58,0x54,0 }; -const i1 c02_s001e[] = { 0x41,0x53,0x4d,0x53,0x59,0x4d,0x42,0x4f,0x4c,0 }; -const i1 c02_s001f[] = { 0x41,0x53,0x4d,0x53,0x55,0x42,0x52,0x45,0x46,0 }; -const i1 c02_s0020[] = { 0x41,0x53,0x4d,0x56,0x41,0x4c,0x55,0x45,0 }; -const i1 c02_s0021[] = { 0x41,0x53,0x4d,0x45,0x4e,0x44,0 }; -const i1 c02_s0022[] = { 0x46,0x41,0x4c,0x4c,0x42,0x41,0x43,0x4b,0 }; -const i1 c02_s0023[] = { 0x50,0x41,0x49,0x52,0 }; -const i1 c02_s0024[] = { 0x4c,0x41,0x42,0x45,0x4c,0 }; -const i1 c02_s0025[] = { 0x4a,0x55,0x4d,0x50,0 }; -const i1 c02_s0026[] = { 0x52,0x45,0x54,0x55,0x52,0x4e,0 }; -const i1 c02_s0027[] = { 0x43,0x41,0x4c,0x4c,0 }; -const i1 c02_s0028[] = { 0x41,0x52,0x47,0x30,0 }; -const i1 c02_s0029[] = { 0x41,0x52,0x47,0x31,0 }; -const i1 c02_s002a[] = { 0x41,0x52,0x47,0x32,0 }; -const i1 c02_s002b[] = { 0x41,0x52,0x47,0x34,0 }; -const i1 c02_s002c[] = { 0x41,0x52,0x47,0x38,0 }; -const i1 c02_s002d[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x30,0 }; -const i1 c02_s002e[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x31,0 }; -const i1 c02_s002f[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x32,0 }; -const i1 c02_s0030[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x34,0 }; -const i1 c02_s0031[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x38,0 }; -const i1 c02_s0032[] = { 0x43,0x4f,0x4e,0x53,0x54,0x41,0x4e,0x54,0 }; -const i1 c02_s0033[] = { 0x53,0x54,0x52,0x49,0x4e,0x47,0 }; -const i1 c02_s0034[] = { 0x41,0x44,0x44,0x52,0x45,0x53,0x53,0 }; -const i1 c02_s0035[] = { 0x53,0x55,0x42,0x52,0x45,0x46,0 }; -const i1 c02_s0036[] = { 0x44,0x45,0x52,0x45,0x46,0x30,0 }; -const i1 c02_s0037[] = { 0x44,0x45,0x52,0x45,0x46,0x31,0 }; -const i1 c02_s0038[] = { 0x44,0x45,0x52,0x45,0x46,0x32,0 }; -const i1 c02_s0039[] = { 0x44,0x45,0x52,0x45,0x46,0x34,0 }; -const i1 c02_s003a[] = { 0x44,0x45,0x52,0x45,0x46,0x38,0 }; -const i1 c02_s003b[] = { 0x53,0x54,0x4f,0x52,0x45,0x30,0 }; -const i1 c02_s003c[] = { 0x53,0x54,0x4f,0x52,0x45,0x31,0 }; -const i1 c02_s003d[] = { 0x53,0x54,0x4f,0x52,0x45,0x32,0 }; -const i1 c02_s003e[] = { 0x53,0x54,0x4f,0x52,0x45,0x34,0 }; -const i1 c02_s003f[] = { 0x53,0x54,0x4f,0x52,0x45,0x38,0 }; -const i1 c02_s0040[] = { 0x42,0x41,0x4e,0x44,0 }; -const i1 c02_s0041[] = { 0x42,0x4f,0x52,0 }; -const i1 c02_s0042[] = { 0x42,0x45,0x51,0x30,0 }; -const i1 c02_s0043[] = { 0x42,0x45,0x51,0x31,0 }; -const i1 c02_s0044[] = { 0x42,0x45,0x51,0x32,0 }; -const i1 c02_s0045[] = { 0x42,0x45,0x51,0x34,0 }; -const i1 c02_s0046[] = { 0x42,0x45,0x51,0x38,0 }; -const i1 c02_s0047[] = { 0x42,0x4c,0x54,0x53,0x30,0 }; -const i1 c02_s0048[] = { 0x42,0x4c,0x54,0x53,0x31,0 }; -const i1 c02_s0049[] = { 0x42,0x4c,0x54,0x53,0x32,0 }; -const i1 c02_s004a[] = { 0x42,0x4c,0x54,0x53,0x34,0 }; -const i1 c02_s004b[] = { 0x42,0x4c,0x54,0x53,0x38,0 }; -const i1 c02_s004c[] = { 0x42,0x4c,0x54,0x55,0x30,0 }; -const i1 c02_s004d[] = { 0x42,0x4c,0x54,0x55,0x31,0 }; -const i1 c02_s004e[] = { 0x42,0x4c,0x54,0x55,0x32,0 }; -const i1 c02_s004f[] = { 0x42,0x4c,0x54,0x55,0x34,0 }; -const i1 c02_s0050[] = { 0x42,0x4c,0x54,0x55,0x38,0 }; -const i1 c02_s0051[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x30,0 }; -const i1 c02_s0052[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x31,0 }; -const i1 c02_s0053[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x32,0 }; -const i1 c02_s0054[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x34,0 }; -const i1 c02_s0055[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x38,0 }; -const i1 c02_s0056[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x30,0 }; -const i1 c02_s0057[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x31,0 }; -const i1 c02_s0058[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x32,0 }; -const i1 c02_s0059[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x34,0 }; -const i1 c02_s005a[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x38,0 }; -const i1 c02_s005b[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x30,0 }; -const i1 c02_s005c[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x31,0 }; -const i1 c02_s005d[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x32,0 }; -const i1 c02_s005e[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x34,0 }; -const i1 c02_s005f[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x38,0 }; -const i1 c02_s0060[] = { 0x43,0x41,0x53,0x54,0x31,0x30,0 }; -const i1 c02_s0061[] = { 0x43,0x41,0x53,0x54,0x31,0x31,0 }; -const i1 c02_s0062[] = { 0x43,0x41,0x53,0x54,0x31,0x32,0 }; -const i1 c02_s0063[] = { 0x43,0x41,0x53,0x54,0x31,0x34,0 }; -const i1 c02_s0064[] = { 0x43,0x41,0x53,0x54,0x31,0x38,0 }; -const i1 c02_s0065[] = { 0x43,0x41,0x53,0x54,0x32,0x30,0 }; -const i1 c02_s0066[] = { 0x43,0x41,0x53,0x54,0x32,0x31,0 }; -const i1 c02_s0067[] = { 0x43,0x41,0x53,0x54,0x32,0x32,0 }; -const i1 c02_s0068[] = { 0x43,0x41,0x53,0x54,0x32,0x34,0 }; -const i1 c02_s0069[] = { 0x43,0x41,0x53,0x54,0x32,0x38,0 }; -const i1 c02_s006a[] = { 0x43,0x41,0x53,0x54,0x34,0x30,0 }; -const i1 c02_s006b[] = { 0x43,0x41,0x53,0x54,0x34,0x31,0 }; -const i1 c02_s006c[] = { 0x43,0x41,0x53,0x54,0x34,0x32,0 }; -const i1 c02_s006d[] = { 0x43,0x41,0x53,0x54,0x34,0x34,0 }; -const i1 c02_s006e[] = { 0x43,0x41,0x53,0x54,0x34,0x38,0 }; -const i1 c02_s006f[] = { 0x43,0x41,0x53,0x54,0x38,0x30,0 }; -const i1 c02_s0070[] = { 0x43,0x41,0x53,0x54,0x38,0x31,0 }; -const i1 c02_s0071[] = { 0x43,0x41,0x53,0x54,0x38,0x32,0 }; -const i1 c02_s0072[] = { 0x43,0x41,0x53,0x54,0x38,0x34,0 }; -const i1 c02_s0073[] = { 0x43,0x41,0x53,0x54,0x38,0x38,0 }; -const i1 c02_s0074[] = { 0x4e,0x4f,0x54,0x30,0 }; -const i1 c02_s0075[] = { 0x4e,0x4f,0x54,0x31,0 }; -const i1 c02_s0076[] = { 0x4e,0x4f,0x54,0x32,0 }; -const i1 c02_s0077[] = { 0x4e,0x4f,0x54,0x34,0 }; -const i1 c02_s0078[] = { 0x4e,0x4f,0x54,0x38,0 }; -const i1 c02_s0079[] = { 0x4e,0x45,0x47,0x30,0 }; -const i1 c02_s007a[] = { 0x4e,0x45,0x47,0x31,0 }; -const i1 c02_s007b[] = { 0x4e,0x45,0x47,0x32,0 }; -const i1 c02_s007c[] = { 0x4e,0x45,0x47,0x34,0 }; -const i1 c02_s007d[] = { 0x4e,0x45,0x47,0x38,0 }; -const i1 c02_s007e[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x30,0 }; -const i1 c02_s007f[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x31,0 }; -const i1 c02_s0080[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x32,0 }; -const i1 c02_s0081[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x34,0 }; -const i1 c02_s0082[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x38,0 }; -const i1 c02_s0083[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x30,0 }; -const i1 c02_s0084[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x31,0 }; -const i1 c02_s0085[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x32,0 }; -const i1 c02_s0086[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x34,0 }; -const i1 c02_s0087[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x38,0 }; -const i1 c02_s0088[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x30,0 }; -const i1 c02_s0089[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x31,0 }; -const i1 c02_s008a[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x32,0 }; -const i1 c02_s008b[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x34,0 }; -const i1 c02_s008c[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x38,0 }; -const i1 c02_s008d[] = { 0x53,0x55,0x42,0x30,0 }; -const i1 c02_s008e[] = { 0x53,0x55,0x42,0x31,0 }; -const i1 c02_s008f[] = { 0x53,0x55,0x42,0x32,0 }; -const i1 c02_s0090[] = { 0x53,0x55,0x42,0x34,0 }; -const i1 c02_s0091[] = { 0x53,0x55,0x42,0x38,0 }; -const i1 c02_s0092[] = { 0x44,0x49,0x56,0x55,0x30,0 }; -const i1 c02_s0093[] = { 0x44,0x49,0x56,0x55,0x31,0 }; -const i1 c02_s0094[] = { 0x44,0x49,0x56,0x55,0x32,0 }; -const i1 c02_s0095[] = { 0x44,0x49,0x56,0x55,0x34,0 }; -const i1 c02_s0096[] = { 0x44,0x49,0x56,0x55,0x38,0 }; -const i1 c02_s0097[] = { 0x44,0x49,0x56,0x53,0x30,0 }; -const i1 c02_s0098[] = { 0x44,0x49,0x56,0x53,0x31,0 }; -const i1 c02_s0099[] = { 0x44,0x49,0x56,0x53,0x32,0 }; -const i1 c02_s009a[] = { 0x44,0x49,0x56,0x53,0x34,0 }; -const i1 c02_s009b[] = { 0x44,0x49,0x56,0x53,0x38,0 }; -const i1 c02_s009c[] = { 0x52,0x45,0x4d,0x55,0x30,0 }; -const i1 c02_s009d[] = { 0x52,0x45,0x4d,0x55,0x31,0 }; -const i1 c02_s009e[] = { 0x52,0x45,0x4d,0x55,0x32,0 }; -const i1 c02_s009f[] = { 0x52,0x45,0x4d,0x55,0x34,0 }; -const i1 c02_s00a0[] = { 0x52,0x45,0x4d,0x55,0x38,0 }; -const i1 c02_s00a1[] = { 0x52,0x45,0x4d,0x53,0x30,0 }; -const i1 c02_s00a2[] = { 0x52,0x45,0x4d,0x53,0x31,0 }; -const i1 c02_s00a3[] = { 0x52,0x45,0x4d,0x53,0x32,0 }; -const i1 c02_s00a4[] = { 0x52,0x45,0x4d,0x53,0x34,0 }; -const i1 c02_s00a5[] = { 0x52,0x45,0x4d,0x53,0x38,0 }; -const i1 c02_s00a6[] = { 0x41,0x44,0x44,0x30,0 }; -const i1 c02_s00a7[] = { 0x41,0x44,0x44,0x31,0 }; -const i1 c02_s00a8[] = { 0x41,0x44,0x44,0x32,0 }; -const i1 c02_s00a9[] = { 0x41,0x44,0x44,0x34,0 }; -const i1 c02_s00aa[] = { 0x41,0x44,0x44,0x38,0 }; -const i1 c02_s00ab[] = { 0x4d,0x55,0x4c,0x30,0 }; -const i1 c02_s00ac[] = { 0x4d,0x55,0x4c,0x31,0 }; -const i1 c02_s00ad[] = { 0x4d,0x55,0x4c,0x32,0 }; -const i1 c02_s00ae[] = { 0x4d,0x55,0x4c,0x34,0 }; -const i1 c02_s00af[] = { 0x4d,0x55,0x4c,0x38,0 }; -const i1 c02_s00b0[] = { 0x41,0x4e,0x44,0x30,0 }; -const i1 c02_s00b1[] = { 0x41,0x4e,0x44,0x31,0 }; -const i1 c02_s00b2[] = { 0x41,0x4e,0x44,0x32,0 }; -const i1 c02_s00b3[] = { 0x41,0x4e,0x44,0x34,0 }; -const i1 c02_s00b4[] = { 0x41,0x4e,0x44,0x38,0 }; -const i1 c02_s00b5[] = { 0x4f,0x52,0x30,0 }; -const i1 c02_s00b6[] = { 0x4f,0x52,0x31,0 }; -const i1 c02_s00b7[] = { 0x4f,0x52,0x32,0 }; -const i1 c02_s00b8[] = { 0x4f,0x52,0x34,0 }; -const i1 c02_s00b9[] = { 0x4f,0x52,0x38,0 }; -const i1 c02_s00ba[] = { 0x45,0x4f,0x52,0x30,0 }; -const i1 c02_s00bb[] = { 0x45,0x4f,0x52,0x31,0 }; -const i1 c02_s00bc[] = { 0x45,0x4f,0x52,0x32,0 }; -const i1 c02_s00bd[] = { 0x45,0x4f,0x52,0x34,0 }; -const i1 c02_s00be[] = { 0x45,0x4f,0x52,0x38,0 }; -static data f78_MidcodeName_s010d[] = { +const i1 c01_s000b[] = { 0x45,0x4e,0x44,0 }; +const i1 c01_s000c[] = { 0x53,0x54,0x41,0x52,0x54,0x46,0x49,0x4c,0x45,0 }; +const i1 c01_s000d[] = { 0x45,0x4e,0x44,0x46,0x49,0x4c,0x45,0 }; +const i1 c01_s000e[] = { 0x53,0x54,0x41,0x52,0x54,0x53,0x55,0x42,0 }; +const i1 c01_s000f[] = { 0x45,0x4e,0x44,0x53,0x55,0x42,0 }; +const i1 c01_s0010[] = { 0x53,0x54,0x41,0x52,0x54,0x49,0x4e,0x49,0x54,0 }; +const i1 c01_s0011[] = { 0x49,0x4e,0x49,0x54,0x30,0 }; +const i1 c01_s0012[] = { 0x49,0x4e,0x49,0x54,0x31,0 }; +const i1 c01_s0013[] = { 0x49,0x4e,0x49,0x54,0x32,0 }; +const i1 c01_s0014[] = { 0x49,0x4e,0x49,0x54,0x34,0 }; +const i1 c01_s0015[] = { 0x49,0x4e,0x49,0x54,0x38,0 }; +const i1 c01_s0016[] = { 0x49,0x4e,0x49,0x54,0x53,0x54,0x52,0x49,0x4e,0x47,0 }; +const i1 c01_s0017[] = { 0x49,0x4e,0x49,0x54,0x41,0x44,0x44,0x52,0x45,0x53,0x53,0 }; +const i1 c01_s0018[] = { 0x49,0x4e,0x49,0x54,0x53,0x55,0x42,0x52,0x45,0x46,0 }; +const i1 c01_s0019[] = { 0x45,0x4e,0x44,0x49,0x4e,0x49,0x54,0 }; +const i1 c01_s001a[] = { 0x41,0x53,0x4d,0x47,0x52,0x4f,0x55,0x50,0x53,0x54,0x41,0x52,0x54,0 }; +const i1 c01_s001b[] = { 0x41,0x53,0x4d,0x47,0x52,0x4f,0x55,0x50,0x45,0x4e,0x44,0 }; +const i1 c01_s001c[] = { 0x41,0x53,0x4d,0x53,0x54,0x41,0x52,0x54,0 }; +const i1 c01_s001d[] = { 0x41,0x53,0x4d,0x54,0x45,0x58,0x54,0 }; +const i1 c01_s001e[] = { 0x41,0x53,0x4d,0x53,0x59,0x4d,0x42,0x4f,0x4c,0 }; +const i1 c01_s001f[] = { 0x41,0x53,0x4d,0x53,0x55,0x42,0x52,0x45,0x46,0 }; +const i1 c01_s0020[] = { 0x41,0x53,0x4d,0x56,0x41,0x4c,0x55,0x45,0 }; +const i1 c01_s0021[] = { 0x41,0x53,0x4d,0x45,0x4e,0x44,0 }; +const i1 c01_s0022[] = { 0x46,0x41,0x4c,0x4c,0x42,0x41,0x43,0x4b,0 }; +const i1 c01_s0023[] = { 0x50,0x41,0x49,0x52,0 }; +const i1 c01_s0024[] = { 0x4c,0x41,0x42,0x45,0x4c,0 }; +const i1 c01_s0025[] = { 0x4a,0x55,0x4d,0x50,0 }; +const i1 c01_s0026[] = { 0x52,0x45,0x54,0x55,0x52,0x4e,0 }; +const i1 c01_s0027[] = { 0x43,0x41,0x4c,0x4c,0 }; +const i1 c01_s0028[] = { 0x41,0x52,0x47,0x30,0 }; +const i1 c01_s0029[] = { 0x41,0x52,0x47,0x31,0 }; +const i1 c01_s002a[] = { 0x41,0x52,0x47,0x32,0 }; +const i1 c01_s002b[] = { 0x41,0x52,0x47,0x34,0 }; +const i1 c01_s002c[] = { 0x41,0x52,0x47,0x38,0 }; +const i1 c01_s002d[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x30,0 }; +const i1 c01_s002e[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x31,0 }; +const i1 c01_s002f[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x32,0 }; +const i1 c01_s0030[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x34,0 }; +const i1 c01_s0031[] = { 0x50,0x4f,0x50,0x41,0x52,0x47,0x38,0 }; +const i1 c01_s0032[] = { 0x43,0x4f,0x4e,0x53,0x54,0x41,0x4e,0x54,0 }; +const i1 c01_s0033[] = { 0x53,0x54,0x52,0x49,0x4e,0x47,0 }; +const i1 c01_s0034[] = { 0x41,0x44,0x44,0x52,0x45,0x53,0x53,0 }; +const i1 c01_s0035[] = { 0x53,0x55,0x42,0x52,0x45,0x46,0 }; +const i1 c01_s0036[] = { 0x44,0x45,0x52,0x45,0x46,0x30,0 }; +const i1 c01_s0037[] = { 0x44,0x45,0x52,0x45,0x46,0x31,0 }; +const i1 c01_s0038[] = { 0x44,0x45,0x52,0x45,0x46,0x32,0 }; +const i1 c01_s0039[] = { 0x44,0x45,0x52,0x45,0x46,0x34,0 }; +const i1 c01_s003a[] = { 0x44,0x45,0x52,0x45,0x46,0x38,0 }; +const i1 c01_s003b[] = { 0x53,0x54,0x4f,0x52,0x45,0x30,0 }; +const i1 c01_s003c[] = { 0x53,0x54,0x4f,0x52,0x45,0x31,0 }; +const i1 c01_s003d[] = { 0x53,0x54,0x4f,0x52,0x45,0x32,0 }; +const i1 c01_s003e[] = { 0x53,0x54,0x4f,0x52,0x45,0x34,0 }; +const i1 c01_s003f[] = { 0x53,0x54,0x4f,0x52,0x45,0x38,0 }; +const i1 c01_s0040[] = { 0x42,0x41,0x4e,0x44,0 }; +const i1 c01_s0041[] = { 0x42,0x4f,0x52,0 }; +const i1 c01_s0042[] = { 0x42,0x45,0x51,0x30,0 }; +const i1 c01_s0043[] = { 0x42,0x45,0x51,0x31,0 }; +const i1 c01_s0044[] = { 0x42,0x45,0x51,0x32,0 }; +const i1 c01_s0045[] = { 0x42,0x45,0x51,0x34,0 }; +const i1 c01_s0046[] = { 0x42,0x45,0x51,0x38,0 }; +const i1 c01_s0047[] = { 0x42,0x4c,0x54,0x53,0x30,0 }; +const i1 c01_s0048[] = { 0x42,0x4c,0x54,0x53,0x31,0 }; +const i1 c01_s0049[] = { 0x42,0x4c,0x54,0x53,0x32,0 }; +const i1 c01_s004a[] = { 0x42,0x4c,0x54,0x53,0x34,0 }; +const i1 c01_s004b[] = { 0x42,0x4c,0x54,0x53,0x38,0 }; +const i1 c01_s004c[] = { 0x42,0x4c,0x54,0x55,0x30,0 }; +const i1 c01_s004d[] = { 0x42,0x4c,0x54,0x55,0x31,0 }; +const i1 c01_s004e[] = { 0x42,0x4c,0x54,0x55,0x32,0 }; +const i1 c01_s004f[] = { 0x42,0x4c,0x54,0x55,0x34,0 }; +const i1 c01_s0050[] = { 0x42,0x4c,0x54,0x55,0x38,0 }; +const i1 c01_s0051[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x30,0 }; +const i1 c01_s0052[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x31,0 }; +const i1 c01_s0053[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x32,0 }; +const i1 c01_s0054[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x34,0 }; +const i1 c01_s0055[] = { 0x53,0x54,0x41,0x52,0x54,0x43,0x41,0x53,0x45,0x38,0 }; +const i1 c01_s0056[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x30,0 }; +const i1 c01_s0057[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x31,0 }; +const i1 c01_s0058[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x32,0 }; +const i1 c01_s0059[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x34,0 }; +const i1 c01_s005a[] = { 0x57,0x48,0x45,0x4e,0x43,0x41,0x53,0x45,0x38,0 }; +const i1 c01_s005b[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x30,0 }; +const i1 c01_s005c[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x31,0 }; +const i1 c01_s005d[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x32,0 }; +const i1 c01_s005e[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x34,0 }; +const i1 c01_s005f[] = { 0x45,0x4e,0x44,0x43,0x41,0x53,0x45,0x38,0 }; +const i1 c01_s0060[] = { 0x43,0x41,0x53,0x54,0x31,0x30,0 }; +const i1 c01_s0061[] = { 0x43,0x41,0x53,0x54,0x31,0x31,0 }; +const i1 c01_s0062[] = { 0x43,0x41,0x53,0x54,0x31,0x32,0 }; +const i1 c01_s0063[] = { 0x43,0x41,0x53,0x54,0x31,0x34,0 }; +const i1 c01_s0064[] = { 0x43,0x41,0x53,0x54,0x31,0x38,0 }; +const i1 c01_s0065[] = { 0x43,0x41,0x53,0x54,0x32,0x30,0 }; +const i1 c01_s0066[] = { 0x43,0x41,0x53,0x54,0x32,0x31,0 }; +const i1 c01_s0067[] = { 0x43,0x41,0x53,0x54,0x32,0x32,0 }; +const i1 c01_s0068[] = { 0x43,0x41,0x53,0x54,0x32,0x34,0 }; +const i1 c01_s0069[] = { 0x43,0x41,0x53,0x54,0x32,0x38,0 }; +const i1 c01_s006a[] = { 0x43,0x41,0x53,0x54,0x34,0x30,0 }; +const i1 c01_s006b[] = { 0x43,0x41,0x53,0x54,0x34,0x31,0 }; +const i1 c01_s006c[] = { 0x43,0x41,0x53,0x54,0x34,0x32,0 }; +const i1 c01_s006d[] = { 0x43,0x41,0x53,0x54,0x34,0x34,0 }; +const i1 c01_s006e[] = { 0x43,0x41,0x53,0x54,0x34,0x38,0 }; +const i1 c01_s006f[] = { 0x43,0x41,0x53,0x54,0x38,0x30,0 }; +const i1 c01_s0070[] = { 0x43,0x41,0x53,0x54,0x38,0x31,0 }; +const i1 c01_s0071[] = { 0x43,0x41,0x53,0x54,0x38,0x32,0 }; +const i1 c01_s0072[] = { 0x43,0x41,0x53,0x54,0x38,0x34,0 }; +const i1 c01_s0073[] = { 0x43,0x41,0x53,0x54,0x38,0x38,0 }; +const i1 c01_s0074[] = { 0x4e,0x4f,0x54,0x30,0 }; +const i1 c01_s0075[] = { 0x4e,0x4f,0x54,0x31,0 }; +const i1 c01_s0076[] = { 0x4e,0x4f,0x54,0x32,0 }; +const i1 c01_s0077[] = { 0x4e,0x4f,0x54,0x34,0 }; +const i1 c01_s0078[] = { 0x4e,0x4f,0x54,0x38,0 }; +const i1 c01_s0079[] = { 0x4e,0x45,0x47,0x30,0 }; +const i1 c01_s007a[] = { 0x4e,0x45,0x47,0x31,0 }; +const i1 c01_s007b[] = { 0x4e,0x45,0x47,0x32,0 }; +const i1 c01_s007c[] = { 0x4e,0x45,0x47,0x34,0 }; +const i1 c01_s007d[] = { 0x4e,0x45,0x47,0x38,0 }; +const i1 c01_s007e[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x30,0 }; +const i1 c01_s007f[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x31,0 }; +const i1 c01_s0080[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x32,0 }; +const i1 c01_s0081[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x34,0 }; +const i1 c01_s0082[] = { 0x4c,0x53,0x48,0x49,0x46,0x54,0x38,0 }; +const i1 c01_s0083[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x30,0 }; +const i1 c01_s0084[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x31,0 }; +const i1 c01_s0085[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x32,0 }; +const i1 c01_s0086[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x34,0 }; +const i1 c01_s0087[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x55,0x38,0 }; +const i1 c01_s0088[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x30,0 }; +const i1 c01_s0089[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x31,0 }; +const i1 c01_s008a[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x32,0 }; +const i1 c01_s008b[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x34,0 }; +const i1 c01_s008c[] = { 0x52,0x53,0x48,0x49,0x46,0x54,0x53,0x38,0 }; +const i1 c01_s008d[] = { 0x53,0x55,0x42,0x30,0 }; +const i1 c01_s008e[] = { 0x53,0x55,0x42,0x31,0 }; +const i1 c01_s008f[] = { 0x53,0x55,0x42,0x32,0 }; +const i1 c01_s0090[] = { 0x53,0x55,0x42,0x34,0 }; +const i1 c01_s0091[] = { 0x53,0x55,0x42,0x38,0 }; +const i1 c01_s0092[] = { 0x44,0x49,0x56,0x55,0x30,0 }; +const i1 c01_s0093[] = { 0x44,0x49,0x56,0x55,0x31,0 }; +const i1 c01_s0094[] = { 0x44,0x49,0x56,0x55,0x32,0 }; +const i1 c01_s0095[] = { 0x44,0x49,0x56,0x55,0x34,0 }; +const i1 c01_s0096[] = { 0x44,0x49,0x56,0x55,0x38,0 }; +const i1 c01_s0097[] = { 0x44,0x49,0x56,0x53,0x30,0 }; +const i1 c01_s0098[] = { 0x44,0x49,0x56,0x53,0x31,0 }; +const i1 c01_s0099[] = { 0x44,0x49,0x56,0x53,0x32,0 }; +const i1 c01_s009a[] = { 0x44,0x49,0x56,0x53,0x34,0 }; +const i1 c01_s009b[] = { 0x44,0x49,0x56,0x53,0x38,0 }; +const i1 c01_s009c[] = { 0x52,0x45,0x4d,0x55,0x30,0 }; +const i1 c01_s009d[] = { 0x52,0x45,0x4d,0x55,0x31,0 }; +const i1 c01_s009e[] = { 0x52,0x45,0x4d,0x55,0x32,0 }; +const i1 c01_s009f[] = { 0x52,0x45,0x4d,0x55,0x34,0 }; +const i1 c01_s00a0[] = { 0x52,0x45,0x4d,0x55,0x38,0 }; +const i1 c01_s00a1[] = { 0x52,0x45,0x4d,0x53,0x30,0 }; +const i1 c01_s00a2[] = { 0x52,0x45,0x4d,0x53,0x31,0 }; +const i1 c01_s00a3[] = { 0x52,0x45,0x4d,0x53,0x32,0 }; +const i1 c01_s00a4[] = { 0x52,0x45,0x4d,0x53,0x34,0 }; +const i1 c01_s00a5[] = { 0x52,0x45,0x4d,0x53,0x38,0 }; +const i1 c01_s00a6[] = { 0x41,0x44,0x44,0x30,0 }; +const i1 c01_s00a7[] = { 0x41,0x44,0x44,0x31,0 }; +const i1 c01_s00a8[] = { 0x41,0x44,0x44,0x32,0 }; +const i1 c01_s00a9[] = { 0x41,0x44,0x44,0x34,0 }; +const i1 c01_s00aa[] = { 0x41,0x44,0x44,0x38,0 }; +const i1 c01_s00ab[] = { 0x4d,0x55,0x4c,0x30,0 }; +const i1 c01_s00ac[] = { 0x4d,0x55,0x4c,0x31,0 }; +const i1 c01_s00ad[] = { 0x4d,0x55,0x4c,0x32,0 }; +const i1 c01_s00ae[] = { 0x4d,0x55,0x4c,0x34,0 }; +const i1 c01_s00af[] = { 0x4d,0x55,0x4c,0x38,0 }; +const i1 c01_s00b0[] = { 0x41,0x4e,0x44,0x30,0 }; +const i1 c01_s00b1[] = { 0x41,0x4e,0x44,0x31,0 }; +const i1 c01_s00b2[] = { 0x41,0x4e,0x44,0x32,0 }; +const i1 c01_s00b3[] = { 0x41,0x4e,0x44,0x34,0 }; +const i1 c01_s00b4[] = { 0x41,0x4e,0x44,0x38,0 }; +const i1 c01_s00b5[] = { 0x4f,0x52,0x30,0 }; +const i1 c01_s00b6[] = { 0x4f,0x52,0x31,0 }; +const i1 c01_s00b7[] = { 0x4f,0x52,0x32,0 }; +const i1 c01_s00b8[] = { 0x4f,0x52,0x34,0 }; +const i1 c01_s00b9[] = { 0x4f,0x52,0x38,0 }; +const i1 c01_s00ba[] = { 0x45,0x4f,0x52,0x30,0 }; +const i1 c01_s00bb[] = { 0x45,0x4f,0x52,0x31,0 }; +const i1 c01_s00bc[] = { 0x45,0x4f,0x52,0x32,0 }; +const i1 c01_s00bd[] = { 0x45,0x4f,0x52,0x34,0 }; +const i1 c01_s00be[] = { 0x45,0x4f,0x52,0x38,0 }; +static data f77_MidcodeName_s010d[] = { - { .ptr = (void*)c02_s000b }, + { .ptr = (void*)c01_s000b }, - { .ptr = (void*)c02_s000c }, + { .ptr = (void*)c01_s000c }, - { .ptr = (void*)c02_s000d }, + { .ptr = (void*)c01_s000d }, - { .ptr = (void*)c02_s000e }, + { .ptr = (void*)c01_s000e }, - { .ptr = (void*)c02_s000f }, + { .ptr = (void*)c01_s000f }, - { .ptr = (void*)c02_s0010 }, + { .ptr = (void*)c01_s0010 }, - { .ptr = (void*)c02_s0011 }, + { .ptr = (void*)c01_s0011 }, - { .ptr = (void*)c02_s0012 }, + { .ptr = (void*)c01_s0012 }, - { .ptr = (void*)c02_s0013 }, + { .ptr = (void*)c01_s0013 }, - { .ptr = (void*)c02_s0014 }, + { .ptr = (void*)c01_s0014 }, - { .ptr = (void*)c02_s0015 }, + { .ptr = (void*)c01_s0015 }, - { .ptr = (void*)c02_s0016 }, + { .ptr = (void*)c01_s0016 }, - { .ptr = (void*)c02_s0017 }, + { .ptr = (void*)c01_s0017 }, - { .ptr = (void*)c02_s0018 }, + { .ptr = (void*)c01_s0018 }, - { .ptr = (void*)c02_s0019 }, + { .ptr = (void*)c01_s0019 }, - { .ptr = (void*)c02_s001a }, + { .ptr = (void*)c01_s001a }, - { .ptr = (void*)c02_s001b }, + { .ptr = (void*)c01_s001b }, - { .ptr = (void*)c02_s001c }, + { .ptr = (void*)c01_s001c }, - { .ptr = (void*)c02_s001d }, + { .ptr = (void*)c01_s001d }, - { .ptr = (void*)c02_s001e }, + { .ptr = (void*)c01_s001e }, - { .ptr = (void*)c02_s001f }, + { .ptr = (void*)c01_s001f }, - { .ptr = (void*)c02_s0020 }, + { .ptr = (void*)c01_s0020 }, - { .ptr = (void*)c02_s0021 }, + { .ptr = (void*)c01_s0021 }, - { .ptr = (void*)c02_s0022 }, + { .ptr = (void*)c01_s0022 }, - { .ptr = (void*)c02_s0023 }, + { .ptr = (void*)c01_s0023 }, - { .ptr = (void*)c02_s0024 }, + { .ptr = (void*)c01_s0024 }, - { .ptr = (void*)c02_s0025 }, + { .ptr = (void*)c01_s0025 }, - { .ptr = (void*)c02_s0026 }, + { .ptr = (void*)c01_s0026 }, - { .ptr = (void*)c02_s0027 }, + { .ptr = (void*)c01_s0027 }, - { .ptr = (void*)c02_s0028 }, + { .ptr = (void*)c01_s0028 }, - { .ptr = (void*)c02_s0029 }, + { .ptr = (void*)c01_s0029 }, - { .ptr = (void*)c02_s002a }, + { .ptr = (void*)c01_s002a }, - { .ptr = (void*)c02_s002b }, + { .ptr = (void*)c01_s002b }, - { .ptr = (void*)c02_s002c }, + { .ptr = (void*)c01_s002c }, - { .ptr = (void*)c02_s002d }, + { .ptr = (void*)c01_s002d }, - { .ptr = (void*)c02_s002e }, + { .ptr = (void*)c01_s002e }, - { .ptr = (void*)c02_s002f }, + { .ptr = (void*)c01_s002f }, - { .ptr = (void*)c02_s0030 }, + { .ptr = (void*)c01_s0030 }, - { .ptr = (void*)c02_s0031 }, + { .ptr = (void*)c01_s0031 }, - { .ptr = (void*)c02_s0032 }, + { .ptr = (void*)c01_s0032 }, - { .ptr = (void*)c02_s0033 }, + { .ptr = (void*)c01_s0033 }, - { .ptr = (void*)c02_s0034 }, + { .ptr = (void*)c01_s0034 }, - { .ptr = (void*)c02_s0035 }, + { .ptr = (void*)c01_s0035 }, - { .ptr = (void*)c02_s0036 }, + { .ptr = (void*)c01_s0036 }, - { .ptr = (void*)c02_s0037 }, + { .ptr = (void*)c01_s0037 }, - { .ptr = (void*)c02_s0038 }, + { .ptr = (void*)c01_s0038 }, - { .ptr = (void*)c02_s0039 }, + { .ptr = (void*)c01_s0039 }, - { .ptr = (void*)c02_s003a }, + { .ptr = (void*)c01_s003a }, - { .ptr = (void*)c02_s003b }, + { .ptr = (void*)c01_s003b }, - { .ptr = (void*)c02_s003c }, + { .ptr = (void*)c01_s003c }, - { .ptr = (void*)c02_s003d }, + { .ptr = (void*)c01_s003d }, - { .ptr = (void*)c02_s003e }, + { .ptr = (void*)c01_s003e }, - { .ptr = (void*)c02_s003f }, + { .ptr = (void*)c01_s003f }, - { .ptr = (void*)c02_s0040 }, + { .ptr = (void*)c01_s0040 }, - { .ptr = (void*)c02_s0041 }, + { .ptr = (void*)c01_s0041 }, - { .ptr = (void*)c02_s0042 }, + { .ptr = (void*)c01_s0042 }, - { .ptr = (void*)c02_s0043 }, + { .ptr = (void*)c01_s0043 }, - { .ptr = (void*)c02_s0044 }, + { .ptr = (void*)c01_s0044 }, - { .ptr = (void*)c02_s0045 }, + { .ptr = (void*)c01_s0045 }, - { .ptr = (void*)c02_s0046 }, + { .ptr = (void*)c01_s0046 }, - { .ptr = (void*)c02_s0047 }, + { .ptr = (void*)c01_s0047 }, - { .ptr = (void*)c02_s0048 }, + { .ptr = (void*)c01_s0048 }, - { .ptr = (void*)c02_s0049 }, + { .ptr = (void*)c01_s0049 }, - { .ptr = (void*)c02_s004a }, + { .ptr = (void*)c01_s004a }, - { .ptr = (void*)c02_s004b }, + { .ptr = (void*)c01_s004b }, - { .ptr = (void*)c02_s004c }, + { .ptr = (void*)c01_s004c }, - { .ptr = (void*)c02_s004d }, + { .ptr = (void*)c01_s004d }, - { .ptr = (void*)c02_s004e }, + { .ptr = (void*)c01_s004e }, - { .ptr = (void*)c02_s004f }, + { .ptr = (void*)c01_s004f }, - { .ptr = (void*)c02_s0050 }, + { .ptr = (void*)c01_s0050 }, - { .ptr = (void*)c02_s0051 }, + { .ptr = (void*)c01_s0051 }, - { .ptr = (void*)c02_s0052 }, + { .ptr = (void*)c01_s0052 }, - { .ptr = (void*)c02_s0053 }, + { .ptr = (void*)c01_s0053 }, - { .ptr = (void*)c02_s0054 }, + { .ptr = (void*)c01_s0054 }, - { .ptr = (void*)c02_s0055 }, + { .ptr = (void*)c01_s0055 }, - { .ptr = (void*)c02_s0056 }, + { .ptr = (void*)c01_s0056 }, - { .ptr = (void*)c02_s0057 }, + { .ptr = (void*)c01_s0057 }, - { .ptr = (void*)c02_s0058 }, + { .ptr = (void*)c01_s0058 }, - { .ptr = (void*)c02_s0059 }, + { .ptr = (void*)c01_s0059 }, - { .ptr = (void*)c02_s005a }, + { .ptr = (void*)c01_s005a }, - { .ptr = (void*)c02_s005b }, + { .ptr = (void*)c01_s005b }, - { .ptr = (void*)c02_s005c }, + { .ptr = (void*)c01_s005c }, - { .ptr = (void*)c02_s005d }, + { .ptr = (void*)c01_s005d }, - { .ptr = (void*)c02_s005e }, + { .ptr = (void*)c01_s005e }, - { .ptr = (void*)c02_s005f }, + { .ptr = (void*)c01_s005f }, - { .ptr = (void*)c02_s0060 }, + { .ptr = (void*)c01_s0060 }, - { .ptr = (void*)c02_s0061 }, + { .ptr = (void*)c01_s0061 }, - { .ptr = (void*)c02_s0062 }, + { .ptr = (void*)c01_s0062 }, - { .ptr = (void*)c02_s0063 }, + { .ptr = (void*)c01_s0063 }, - { .ptr = (void*)c02_s0064 }, + { .ptr = (void*)c01_s0064 }, - { .ptr = (void*)c02_s0065 }, + { .ptr = (void*)c01_s0065 }, - { .ptr = (void*)c02_s0066 }, + { .ptr = (void*)c01_s0066 }, - { .ptr = (void*)c02_s0067 }, + { .ptr = (void*)c01_s0067 }, - { .ptr = (void*)c02_s0068 }, + { .ptr = (void*)c01_s0068 }, - { .ptr = (void*)c02_s0069 }, + { .ptr = (void*)c01_s0069 }, - { .ptr = (void*)c02_s006a }, + { .ptr = (void*)c01_s006a }, - { .ptr = (void*)c02_s006b }, + { .ptr = (void*)c01_s006b }, - { .ptr = (void*)c02_s006c }, + { .ptr = (void*)c01_s006c }, - { .ptr = (void*)c02_s006d }, + { .ptr = (void*)c01_s006d }, - { .ptr = (void*)c02_s006e }, + { .ptr = (void*)c01_s006e }, - { .ptr = (void*)c02_s006f }, + { .ptr = (void*)c01_s006f }, - { .ptr = (void*)c02_s0070 }, + { .ptr = (void*)c01_s0070 }, - { .ptr = (void*)c02_s0071 }, + { .ptr = (void*)c01_s0071 }, - { .ptr = (void*)c02_s0072 }, + { .ptr = (void*)c01_s0072 }, - { .ptr = (void*)c02_s0073 }, + { .ptr = (void*)c01_s0073 }, - { .ptr = (void*)c02_s0074 }, + { .ptr = (void*)c01_s0074 }, - { .ptr = (void*)c02_s0075 }, + { .ptr = (void*)c01_s0075 }, - { .ptr = (void*)c02_s0076 }, + { .ptr = (void*)c01_s0076 }, - { .ptr = (void*)c02_s0077 }, + { .ptr = (void*)c01_s0077 }, - { .ptr = (void*)c02_s0078 }, + { .ptr = (void*)c01_s0078 }, - { .ptr = (void*)c02_s0079 }, + { .ptr = (void*)c01_s0079 }, - { .ptr = (void*)c02_s007a }, + { .ptr = (void*)c01_s007a }, - { .ptr = (void*)c02_s007b }, + { .ptr = (void*)c01_s007b }, - { .ptr = (void*)c02_s007c }, + { .ptr = (void*)c01_s007c }, - { .ptr = (void*)c02_s007d }, + { .ptr = (void*)c01_s007d }, - { .ptr = (void*)c02_s007e }, + { .ptr = (void*)c01_s007e }, - { .ptr = (void*)c02_s007f }, + { .ptr = (void*)c01_s007f }, - { .ptr = (void*)c02_s0080 }, + { .ptr = (void*)c01_s0080 }, - { .ptr = (void*)c02_s0081 }, + { .ptr = (void*)c01_s0081 }, - { .ptr = (void*)c02_s0082 }, + { .ptr = (void*)c01_s0082 }, - { .ptr = (void*)c02_s0083 }, + { .ptr = (void*)c01_s0083 }, - { .ptr = (void*)c02_s0084 }, + { .ptr = (void*)c01_s0084 }, - { .ptr = (void*)c02_s0085 }, + { .ptr = (void*)c01_s0085 }, - { .ptr = (void*)c02_s0086 }, + { .ptr = (void*)c01_s0086 }, - { .ptr = (void*)c02_s0087 }, + { .ptr = (void*)c01_s0087 }, - { .ptr = (void*)c02_s0088 }, + { .ptr = (void*)c01_s0088 }, - { .ptr = (void*)c02_s0089 }, + { .ptr = (void*)c01_s0089 }, - { .ptr = (void*)c02_s008a }, + { .ptr = (void*)c01_s008a }, - { .ptr = (void*)c02_s008b }, + { .ptr = (void*)c01_s008b }, - { .ptr = (void*)c02_s008c }, + { .ptr = (void*)c01_s008c }, - { .ptr = (void*)c02_s008d }, + { .ptr = (void*)c01_s008d }, - { .ptr = (void*)c02_s008e }, + { .ptr = (void*)c01_s008e }, - { .ptr = (void*)c02_s008f }, + { .ptr = (void*)c01_s008f }, - { .ptr = (void*)c02_s0090 }, + { .ptr = (void*)c01_s0090 }, - { .ptr = (void*)c02_s0091 }, + { .ptr = (void*)c01_s0091 }, - { .ptr = (void*)c02_s0092 }, + { .ptr = (void*)c01_s0092 }, - { .ptr = (void*)c02_s0093 }, + { .ptr = (void*)c01_s0093 }, - { .ptr = (void*)c02_s0094 }, + { .ptr = (void*)c01_s0094 }, - { .ptr = (void*)c02_s0095 }, + { .ptr = (void*)c01_s0095 }, - { .ptr = (void*)c02_s0096 }, + { .ptr = (void*)c01_s0096 }, - { .ptr = (void*)c02_s0097 }, + { .ptr = (void*)c01_s0097 }, - { .ptr = (void*)c02_s0098 }, + { .ptr = (void*)c01_s0098 }, - { .ptr = (void*)c02_s0099 }, + { .ptr = (void*)c01_s0099 }, - { .ptr = (void*)c02_s009a }, + { .ptr = (void*)c01_s009a }, - { .ptr = (void*)c02_s009b }, + { .ptr = (void*)c01_s009b }, - { .ptr = (void*)c02_s009c }, + { .ptr = (void*)c01_s009c }, - { .ptr = (void*)c02_s009d }, + { .ptr = (void*)c01_s009d }, - { .ptr = (void*)c02_s009e }, + { .ptr = (void*)c01_s009e }, - { .ptr = (void*)c02_s009f }, + { .ptr = (void*)c01_s009f }, - { .ptr = (void*)c02_s00a0 }, + { .ptr = (void*)c01_s00a0 }, - { .ptr = (void*)c02_s00a1 }, + { .ptr = (void*)c01_s00a1 }, - { .ptr = (void*)c02_s00a2 }, + { .ptr = (void*)c01_s00a2 }, - { .ptr = (void*)c02_s00a3 }, + { .ptr = (void*)c01_s00a3 }, - { .ptr = (void*)c02_s00a4 }, + { .ptr = (void*)c01_s00a4 }, - { .ptr = (void*)c02_s00a5 }, + { .ptr = (void*)c01_s00a5 }, - { .ptr = (void*)c02_s00a6 }, + { .ptr = (void*)c01_s00a6 }, - { .ptr = (void*)c02_s00a7 }, + { .ptr = (void*)c01_s00a7 }, - { .ptr = (void*)c02_s00a8 }, + { .ptr = (void*)c01_s00a8 }, - { .ptr = (void*)c02_s00a9 }, + { .ptr = (void*)c01_s00a9 }, - { .ptr = (void*)c02_s00aa }, + { .ptr = (void*)c01_s00aa }, - { .ptr = (void*)c02_s00ab }, + { .ptr = (void*)c01_s00ab }, - { .ptr = (void*)c02_s00ac }, + { .ptr = (void*)c01_s00ac }, - { .ptr = (void*)c02_s00ad }, + { .ptr = (void*)c01_s00ad }, - { .ptr = (void*)c02_s00ae }, + { .ptr = (void*)c01_s00ae }, - { .ptr = (void*)c02_s00af }, + { .ptr = (void*)c01_s00af }, - { .ptr = (void*)c02_s00b0 }, + { .ptr = (void*)c01_s00b0 }, - { .ptr = (void*)c02_s00b1 }, + { .ptr = (void*)c01_s00b1 }, - { .ptr = (void*)c02_s00b2 }, + { .ptr = (void*)c01_s00b2 }, - { .ptr = (void*)c02_s00b3 }, + { .ptr = (void*)c01_s00b3 }, - { .ptr = (void*)c02_s00b4 }, + { .ptr = (void*)c01_s00b4 }, - { .ptr = (void*)c02_s00b5 }, + { .ptr = (void*)c01_s00b5 }, - { .ptr = (void*)c02_s00b6 }, + { .ptr = (void*)c01_s00b6 }, - { .ptr = (void*)c02_s00b7 }, + { .ptr = (void*)c01_s00b7 }, - { .ptr = (void*)c02_s00b8 }, + { .ptr = (void*)c01_s00b8 }, - { .ptr = (void*)c02_s00b9 }, + { .ptr = (void*)c01_s00b9 }, - { .ptr = (void*)c02_s00ba }, + { .ptr = (void*)c01_s00ba }, - { .ptr = (void*)c02_s00bb }, + { .ptr = (void*)c01_s00bb }, - { .ptr = (void*)c02_s00bc }, + { .ptr = (void*)c01_s00bc }, - { .ptr = (void*)c02_s00bd }, + { .ptr = (void*)c01_s00bd }, - { .ptr = (void*)c02_s00be }, + { .ptr = (void*)c01_s00be }, }; // MidcodeName workspace at ws+4216 length ws+16 -void f78_MidcodeName(void) { +void f77_MidcodeName(void) { - i8 v1055 = (i8)(intptr_t)((i1*)f78_MidcodeName_s010d); + i8 v1055 = (i8)(intptr_t)((i1*)f77_MidcodeName_s010d); i8 v1056 = (i8)(intptr_t)(ws+4216); i1 v1057 = *(i1*)(intptr_t)v1056; i1 v1058 = v1057+(-1); @@ -2311,18 +2311,18 @@ void f78_MidcodeName(void) { *(i8*)(intptr_t)v1064 = v1063; } - void f7_MemSet(void); - void f70_InternalAlloc(void); + void f6_MemSet(void); + void f69_InternalAlloc(void); // AllocateNewNode workspace at ws+4216 length ws+24 -void f77_AllocateNewNode(void) { +void f76_AllocateNewNode(void) { i8 v1067 = (i8)(intptr_t)(ws+192); i8 v1068 = *(i8*)(intptr_t)v1067; i8 v1069 = (i8)+0; - if (v1068==v1069) goto c02_0112; else goto c02_0111; + if (v1068==v1069) goto c01_0112; else goto c01_0111; -c02_0111:; +c01_0111:; i8 v1070 = (i8)(intptr_t)(ws+192); i8 v1071 = *(i8*)(intptr_t)v1070; @@ -2343,17 +2343,17 @@ c02_0111:; *(i1*)(intptr_t)(ws+4248) = v1080; i8 v1081 = (i8)+257; *(i8*)(intptr_t)(ws+4256) = v1081; - i8 v1082 = (i8)(intptr_t)(f7_MemSet); + i8 v1082 = (i8)(intptr_t)(f6_MemSet); ((void(*)(void))(intptr_t)v1082)(); - goto c02_010e; + goto c01_010e; -c02_0112:; +c01_0112:; i8 v1083 = (i8)+257; *(i8*)(intptr_t)(ws+4240) = v1083; - i8 v1084 = (i8)(intptr_t)(f70_InternalAlloc); + i8 v1084 = (i8)(intptr_t)(f69_InternalAlloc); ((void(*)(void))(intptr_t)v1084)(); @@ -2366,7 +2366,7 @@ c02_0112:; i8 v1089 = (i8)(intptr_t)(ws+4224); *(i8*)(intptr_t)v1089 = v1088; -c02_010e:; +c01_010e:; i8 v1090 = (i8)(intptr_t)(ws+4216); i1 v1091 = *(i1*)(intptr_t)v1090; @@ -2378,7 +2378,7 @@ c02_010e:; } // FreeNode workspace at ws+4144 length ws+8 -void f79_FreeNode(void) { +void f78_FreeNode(void) { i8 v1095 = (i8)(intptr_t)(ws+192); i8 v1096 = *(i8*)(intptr_t)v1095; @@ -2393,19 +2393,19 @@ void f79_FreeNode(void) { *(i8*)(intptr_t)v1102 = v1101; } - void f34_Free(void); + void f33_Free(void); // PurgeAllFreeNodes workspace at ws+4272 length ws+8 -void f71_PurgeAllFreeNodes(void) { +void f70_PurgeAllFreeNodes(void) { -c02_0113:; +c01_0113:; i8 v1103 = (i8)(intptr_t)(ws+192); i8 v1104 = *(i8*)(intptr_t)v1103; i8 v1105 = (i8)+0; - if (v1104==v1105) goto c02_0118; else goto c02_0117; + if (v1104==v1105) goto c01_0118; else goto c01_0117; -c02_0117:; +c01_0117:; i8 v1106 = (i8)(intptr_t)(ws+192); i8 v1107 = *(i8*)(intptr_t)v1106; @@ -2422,41 +2422,41 @@ c02_0117:; i8 v1114 = (i8)(intptr_t)(ws+4272); i8 v1115 = *(i8*)(intptr_t)v1114; *(i8*)(intptr_t)(ws+4280) = v1115; - i8 v1116 = (i8)(intptr_t)(f34_Free); + i8 v1116 = (i8)(intptr_t)(f33_Free); ((void(*)(void))(intptr_t)v1116)(); - goto c02_0113; + goto c01_0113; -c02_0118:; +c01_0118:; } - void f47_FCBPutChar(void); + void f46_FCBPutChar(void); // WriteB8 workspace at ws+4360 length ws+1 -void f80_WriteB8(void) { +void f79_WriteB8(void) { i8 v1123 = (i8)(intptr_t)(ws+200); *(i8*)(intptr_t)(ws+4376) = v1123; i8 v1124 = (i8)(intptr_t)(ws+4360); i1 v1125 = *(i1*)(intptr_t)v1124; *(i1*)(intptr_t)(ws+4384) = v1125; - i8 v1126 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1126 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1126)(); } - void f80_WriteB8(void); - void f80_WriteB8(void); + void f79_WriteB8(void); + void f79_WriteB8(void); // WriteB16 workspace at ws+4352 length ws+2 -void f81_WriteB16(void) { +void f80_WriteB16(void) { i8 v1127 = (i8)(intptr_t)(ws+4352); i2 v1128 = *(i2*)(intptr_t)v1127; i1 v1129 = v1128; *(i1*)(intptr_t)(ws+4360) = v1129; - i8 v1130 = (i8)(intptr_t)(f80_WriteB8); + i8 v1130 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1130)(); @@ -2466,23 +2466,23 @@ void f81_WriteB16(void) { i2 v1134 = ((i2)v1132)>>v1133; i1 v1135 = v1134; *(i1*)(intptr_t)(ws+4360) = v1135; - i8 v1136 = (i8)(intptr_t)(f80_WriteB8); + i8 v1136 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1136)(); } - void f80_WriteB8(void); - void f81_WriteB16(void); - void f80_WriteB8(void); - void f81_WriteB16(void); - void f59_FCBPutBlock(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f58_FCBPutBlock(void); // FlushCurrentStream workspace at ws+4344 length ws+1 -void f82_FlushCurrentStream(void) { +void f81_FlushCurrentStream(void) { i1 v1137 = (i1)+70; *(i1*)(intptr_t)(ws+4360) = v1137; - i8 v1138 = (i8)(intptr_t)(f80_WriteB8); + i8 v1138 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1138)(); @@ -2490,7 +2490,7 @@ void f82_FlushCurrentStream(void) { i2 v1140 = *(i2*)(intptr_t)v1139; i2 v1141 = v1140+(+3); *(i2*)(intptr_t)(ws+4352) = v1141; - i8 v1142 = (i8)(intptr_t)(f81_WriteB16); + i8 v1142 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1142)(); @@ -2500,7 +2500,7 @@ void f82_FlushCurrentStream(void) { i1 v1146 = *(i1*)(intptr_t)v1145; i1 v1147 = v1144|v1146; *(i1*)(intptr_t)(ws+4360) = v1147; - i8 v1148 = (i8)(intptr_t)(f80_WriteB8); + i8 v1148 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1148)(); @@ -2508,7 +2508,7 @@ void f82_FlushCurrentStream(void) { i8 v1150 = *(i8*)(intptr_t)v1149; i2 v1151 = *(i2*)(intptr_t)v1150; *(i2*)(intptr_t)(ws+4352) = v1151; - i8 v1152 = (i8)(intptr_t)(f81_WriteB16); + i8 v1152 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1152)(); @@ -2520,7 +2520,7 @@ void f82_FlushCurrentStream(void) { i2 v1156 = *(i2*)(intptr_t)v1155; i8 v1157 = v1156; *(i8*)(intptr_t)(ws+4368) = v1157; - i8 v1158 = (i8)(intptr_t)(f59_FCBPutBlock); + i8 v1158 = (i8)(intptr_t)(f58_FCBPutBlock); ((void(*)(void))(intptr_t)v1158)(); @@ -2529,17 +2529,17 @@ void f82_FlushCurrentStream(void) { *(i2*)(intptr_t)v1160 = v1159; } - void f82_FlushCurrentStream(void); + void f81_FlushCurrentStream(void); // E_b8 workspace at ws+4336 length ws+1 -void f83_E_b8(void) { +void f82_E_b8(void) { i8 v1161 = (i8)(intptr_t)(ws+2792); i8 v1162 = *(i8*)(intptr_t)v1161; i8 v1163 = (i8)+0; - if (v1162==v1163) goto c02_011d; else goto c02_011c; + if (v1162==v1163) goto c01_011d; else goto c01_011c; -c02_011c:; +c01_011c:; i8 v1164 = (i8)(intptr_t)(ws+4336); i1 v1165 = *(i1*)(intptr_t)v1164; @@ -2559,36 +2559,36 @@ c02_011c:; i8 v1175 = (i8)(intptr_t)(ws+2774); i2 v1176 = *(i2*)(intptr_t)v1175; i2 v1177 = (i2)+2048; - if (v1176==v1177) goto c02_0121; else goto c02_0122; + if (v1176==v1177) goto c01_0121; else goto c01_0122; -c02_0121:; +c01_0121:; i1 v1178 = (i1)+0; *(i1*)(intptr_t)(ws+4344) = v1178; - i8 v1179 = (i8)(intptr_t)(f82_FlushCurrentStream); + i8 v1179 = (i8)(intptr_t)(f81_FlushCurrentStream); ((void(*)(void))(intptr_t)v1179)(); -c02_0122:; +c01_0122:; -c02_011e:; +c01_011e:; -c02_011d:; +c01_011d:; -c02_0119:; +c01_0119:; } - void f83_E_b8(void); - void f83_E_b8(void); + void f82_E_b8(void); + void f82_E_b8(void); // E_b16 workspace at ws+4272 length ws+2 -void f84_E_b16(void) { +void f83_E_b16(void) { i8 v1180 = (i8)(intptr_t)(ws+4272); i2 v1181 = *(i2*)(intptr_t)v1180; i1 v1182 = v1181; *(i1*)(intptr_t)(ws+4336) = v1182; - i8 v1183 = (i8)(intptr_t)(f83_E_b8); + i8 v1183 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1183)(); @@ -2598,65 +2598,65 @@ void f84_E_b16(void) { i2 v1187 = ((i2)v1185)>>v1186; i1 v1188 = v1187; *(i1*)(intptr_t)(ws+4336) = v1188; - i8 v1189 = (i8)(intptr_t)(f83_E_b8); + i8 v1189 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1189)(); } - void f83_E_b8(void); + void f82_E_b8(void); // E_space workspace at ws+4224 length ws+0 -void f86_E_space(void) { +void f85_E_space(void) { i1 v1200 = (i1)+32; *(i1*)(intptr_t)(ws+4336) = v1200; - i8 v1201 = (i8)(intptr_t)(f83_E_b8); + i8 v1201 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1201)(); } - void f83_E_b8(void); + void f82_E_b8(void); // E_comma workspace at ws+4248 length ws+0 -void f87_E_comma(void) { +void f86_E_comma(void) { i1 v1202 = (i1)+44; *(i1*)(intptr_t)(ws+4336) = v1202; - i8 v1203 = (i8)(intptr_t)(f83_E_b8); + i8 v1203 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1203)(); } - void f83_E_b8(void); + void f82_E_b8(void); // E_tab workspace at ws+4224 length ws+0 -void f88_E_tab(void) { +void f87_E_tab(void) { i1 v1204 = (i1)+9; *(i1*)(intptr_t)(ws+4336) = v1204; - i8 v1205 = (i8)(intptr_t)(f83_E_b8); + i8 v1205 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1205)(); } - void f83_E_b8(void); + void f82_E_b8(void); // E_nl workspace at ws+4224 length ws+0 -void f89_E_nl(void) { +void f88_E_nl(void) { i1 v1206 = (i1)+10; *(i1*)(intptr_t)(ws+4336) = v1206; - i8 v1207 = (i8)(intptr_t)(f83_E_b8); + i8 v1207 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1207)(); } - void f83_E_b8(void); + void f82_E_b8(void); // E workspace at ws+4320 length ws+9 -void f92_E(void) { +void f91_E(void) { -c02_0123:; +c01_0123:; i8 v1212 = (i8)(intptr_t)(ws+4320); i8 v1213 = *(i8*)(intptr_t)v1212; @@ -2673,33 +2673,33 @@ c02_0123:; i8 v1220 = (i8)(intptr_t)(ws+4328); i1 v1221 = *(i1*)(intptr_t)v1220; i1 v1222 = (i1)+0; - if (v1221==v1222) goto c02_0128; else goto c02_0129; + if (v1221==v1222) goto c01_0128; else goto c01_0129; -c02_0128:; +c01_0128:; - goto c02_0124; + goto c01_0124; -c02_0129:; +c01_0129:; -c02_0125:; +c01_0125:; i8 v1223 = (i8)(intptr_t)(ws+4328); i1 v1224 = *(i1*)(intptr_t)v1223; *(i1*)(intptr_t)(ws+4336) = v1224; - i8 v1225 = (i8)(intptr_t)(f83_E_b8); + i8 v1225 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1225)(); - goto c02_0123; + goto c01_0123; -c02_0124:; +c01_0124:; } - void f14_UIToA(void); - void f83_E_b8(void); + void f13_UIToA(void); + void f82_E_b8(void); // E_u32 workspace at ws+4280 length ws+41 -void f93_E_u32(void) { +void f92_E_u32(void) { i8 v1226 = (i8)(intptr_t)(ws+4284); i8 v1227 = (i8)(intptr_t)(ws+4296); @@ -2713,7 +2713,7 @@ void f93_E_u32(void) { i8 v1231 = (i8)(intptr_t)(ws+4296); i8 v1232 = *(i8*)(intptr_t)v1231; *(i8*)(intptr_t)(ws+4336) = v1232; - i8 v1233 = (i8)(intptr_t)(f14_UIToA); + i8 v1233 = (i8)(intptr_t)(f13_UIToA); ((void(*)(void))(intptr_t)v1233)(); @@ -2726,7 +2726,7 @@ void f93_E_u32(void) { i8 v1238 = (i8)(intptr_t)(ws+4312); *(i8*)(intptr_t)v1238 = v1237; -c02_012a:; +c01_012a:; i8 v1239 = (i8)(intptr_t)(ws+4296); i8 v1240 = *(i8*)(intptr_t)v1239; @@ -2737,20 +2737,20 @@ c02_012a:; i8 v1243 = (i8)(intptr_t)(ws+4320); i1 v1244 = *(i1*)(intptr_t)v1243; i1 v1245 = (i1)+0; - if (v1244==v1245) goto c02_012f; else goto c02_0130; + if (v1244==v1245) goto c01_012f; else goto c01_0130; -c02_012f:; +c01_012f:; - goto c02_012b; + goto c01_012b; -c02_0130:; +c01_0130:; -c02_012c:; +c01_012c:; i8 v1246 = (i8)(intptr_t)(ws+4320); i1 v1247 = *(i1*)(intptr_t)v1246; *(i1*)(intptr_t)(ws+4336) = v1247; - i8 v1248 = (i8)(intptr_t)(f83_E_b8); + i8 v1248 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1248)(); @@ -2760,56 +2760,56 @@ c02_012c:; i8 v1252 = (i8)(intptr_t)(ws+4296); *(i8*)(intptr_t)v1252 = v1251; - goto c02_012a; + goto c01_012a; -c02_012b:; +c01_012b:; } - void f93_E_u32(void); + void f92_E_u32(void); // E_u16 workspace at ws+4272 length ws+2 -void f94_E_u16(void) { +void f93_E_u16(void) { i8 v1253 = (i8)(intptr_t)(ws+4272); i2 v1254 = *(i2*)(intptr_t)v1253; i4 v1255 = v1254; *(i4*)(intptr_t)(ws+4280) = v1255; - i8 v1256 = (i8)(intptr_t)(f93_E_u32); + i8 v1256 = (i8)(intptr_t)(f92_E_u32); ((void(*)(void))(intptr_t)v1256)(); } - void f93_E_u32(void); + void f92_E_u32(void); // E_u8 workspace at ws+4264 length ws+1 -void f95_E_u8(void) { +void f94_E_u8(void) { i8 v1257 = (i8)(intptr_t)(ws+4264); i1 v1258 = *(i1*)(intptr_t)v1257; i4 v1259 = v1258; *(i4*)(intptr_t)(ws+4280) = v1259; - i8 v1260 = (i8)(intptr_t)(f93_E_u32); + i8 v1260 = (i8)(intptr_t)(f92_E_u32); ((void(*)(void))(intptr_t)v1260)(); } - void f83_E_b8(void); - void f83_E_b8(void); - void f94_E_u16(void); + void f82_E_b8(void); + void f82_E_b8(void); + void f93_E_u16(void); // E_i16 workspace at ws+4264 length ws+2 -void f97_E_i16(void) { +void f96_E_i16(void) { i8 v1275 = (i8)(intptr_t)(ws+4264); i2 v1276 = *(i2*)(intptr_t)v1275; i2 v1277 = (i2)+0; - if ((s2)v1276<(s2)v1277) goto c02_0139; else goto c02_013a; + if ((s2)v1276<(s2)v1277) goto c01_0139; else goto c01_013a; -c02_0139:; +c01_0139:; i1 v1278 = (i1)+45; *(i1*)(intptr_t)(ws+4336) = v1278; - i8 v1279 = (i8)(intptr_t)(f83_E_b8); + i8 v1279 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1279)(); @@ -2819,43 +2819,43 @@ c02_0139:; i8 v1283 = (i8)(intptr_t)(ws+4264); *(i2*)(intptr_t)v1283 = v1282; - goto c02_0136; + goto c01_0136; -c02_013a:; +c01_013a:; i1 v1284 = (i1)+43; *(i1*)(intptr_t)(ws+4336) = v1284; - i8 v1285 = (i8)(intptr_t)(f83_E_b8); + i8 v1285 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1285)(); -c02_0136:; +c01_0136:; i8 v1286 = (i8)(intptr_t)(ws+4264); i2 v1287 = *(i2*)(intptr_t)v1286; *(i2*)(intptr_t)(ws+4272) = v1287; - i8 v1288 = (i8)(intptr_t)(f94_E_u16); + i8 v1288 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v1288)(); } - void f83_E_b8(void); - void f83_E_b8(void); - void f93_E_u32(void); + void f82_E_b8(void); + void f82_E_b8(void); + void f92_E_u32(void); // E_i32 workspace at ws+4256 length ws+4 -void f98_E_i32(void) { +void f97_E_i32(void) { i8 v1289 = (i8)(intptr_t)(ws+4256); i4 v1290 = *(i4*)(intptr_t)v1289; i4 v1291 = (i4)+0; - if ((s4)v1290<(s4)v1291) goto c02_013e; else goto c02_013f; + if ((s4)v1290<(s4)v1291) goto c01_013e; else goto c01_013f; -c02_013e:; +c01_013e:; i1 v1292 = (i1)+45; *(i1*)(intptr_t)(ws+4336) = v1292; - i8 v1293 = (i8)(intptr_t)(f83_E_b8); + i8 v1293 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1293)(); @@ -2865,32 +2865,32 @@ c02_013e:; i8 v1297 = (i8)(intptr_t)(ws+4256); *(i4*)(intptr_t)v1297 = v1296; - goto c02_013b; + goto c01_013b; -c02_013f:; +c01_013f:; i1 v1298 = (i1)+43; *(i1*)(intptr_t)(ws+4336) = v1298; - i8 v1299 = (i8)(intptr_t)(f83_E_b8); + i8 v1299 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1299)(); -c02_013b:; +c01_013b:; i8 v1300 = (i8)(intptr_t)(ws+4256); i4 v1301 = *(i4*)(intptr_t)v1300; *(i4*)(intptr_t)(ws+4280) = v1301; - i8 v1302 = (i8)(intptr_t)(f93_E_u32); + i8 v1302 = (i8)(intptr_t)(f92_E_u32); ((void(*)(void))(intptr_t)v1302)(); } - void f14_UIToA(void); - void f83_E_b8(void); - void f92_E(void); + void f13_UIToA(void); + void f82_E_b8(void); + void f91_E(void); // E_h workspace at ws+4280 length ws+33 -void f99_E_h(void) { +void f98_E_h(void) { i8 v1303 = (i8)(intptr_t)(ws+4280); i4 v1304 = *(i4*)(intptr_t)v1303; @@ -2899,7 +2899,7 @@ void f99_E_h(void) { *(i1*)(intptr_t)(ws+4332) = v1305; i8 v1306 = (i8)(intptr_t)(ws+4285); *(i8*)(intptr_t)(ws+4336) = v1306; - i8 v1307 = (i8)(intptr_t)(f14_UIToA); + i8 v1307 = (i8)(intptr_t)(f13_UIToA); ((void(*)(void))(intptr_t)v1307)(); @@ -2923,18 +2923,18 @@ void f99_E_h(void) { i8 v1321 = (i8)(intptr_t)(ws+4312); *(i1*)(intptr_t)v1321 = v1320; -c02_0140:; +c01_0140:; i8 v1322 = (i8)(intptr_t)(ws+4312); i1 v1323 = *(i1*)(intptr_t)v1322; i1 v1324 = (i1)+0; - if (v1323==v1324) goto c02_0145; else goto c02_0144; + if (v1323==v1324) goto c01_0145; else goto c01_0144; -c02_0144:; +c01_0144:; i1 v1325 = (i1)+48; *(i1*)(intptr_t)(ws+4336) = v1325; - i8 v1326 = (i8)(intptr_t)(f83_E_b8); + i8 v1326 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1326)(); @@ -2944,21 +2944,21 @@ c02_0144:; i8 v1330 = (i8)(intptr_t)(ws+4312); *(i1*)(intptr_t)v1330 = v1329; - goto c02_0140; + goto c01_0140; -c02_0145:; +c01_0145:; i8 v1331 = (i8)(intptr_t)(ws+4285); *(i8*)(intptr_t)(ws+4320) = v1331; - i8 v1332 = (i8)(intptr_t)(f92_E); + i8 v1332 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v1332)(); } - void f99_E_h(void); + void f98_E_h(void); // E_h8 workspace at ws+4248 length ws+1 -void f100_E_h8(void) { +void f99_E_h8(void) { i8 v1333 = (i8)(intptr_t)(ws+4248); i1 v1334 = *(i1*)(intptr_t)v1333; @@ -2966,15 +2966,15 @@ void f100_E_h8(void) { *(i4*)(intptr_t)(ws+4280) = v1335; i1 v1336 = (i1)+2; *(i1*)(intptr_t)(ws+4284) = v1336; - i8 v1337 = (i8)(intptr_t)(f99_E_h); + i8 v1337 = (i8)(intptr_t)(f98_E_h); ((void(*)(void))(intptr_t)v1337)(); } - void f99_E_h(void); + void f98_E_h(void); // E_h16 workspace at ws+4272 length ws+2 -void f101_E_h16(void) { +void f100_E_h16(void) { i8 v1338 = (i8)(intptr_t)(ws+4272); i2 v1339 = *(i2*)(intptr_t)v1338; @@ -2982,59 +2982,59 @@ void f101_E_h16(void) { *(i4*)(intptr_t)(ws+4280) = v1340; i1 v1341 = (i1)+4; *(i1*)(intptr_t)(ws+4284) = v1341; - i8 v1342 = (i8)(intptr_t)(f99_E_h); + i8 v1342 = (i8)(intptr_t)(f98_E_h); ((void(*)(void))(intptr_t)v1342)(); } - void f83_E_b8(void); - void f101_E_h16(void); + void f82_E_b8(void); + void f100_E_h16(void); // E_labelref workspace at ws+4256 length ws+2 -void f103_E_labelref(void) { +void f102_E_labelref(void) { i1 v1347 = (i1)+3; *(i1*)(intptr_t)(ws+4336) = v1347; - i8 v1348 = (i8)(intptr_t)(f83_E_b8); + i8 v1348 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1348)(); i8 v1349 = (i8)(intptr_t)(ws+4256); i2 v1350 = *(i2*)(intptr_t)v1349; *(i2*)(intptr_t)(ws+4272) = v1350; - i8 v1351 = (i8)(intptr_t)(f101_E_h16); + i8 v1351 = (i8)(intptr_t)(f100_E_h16); ((void(*)(void))(intptr_t)v1351)(); } - void f83_E_b8(void); - void f83_E_b8(void); - void f84_E_b16(void); + void f82_E_b8(void); + void f82_E_b8(void); + void f83_E_b16(void); // E_subref workspace at ws+4240 length ws+8 -void f104_E_subref(void) { +void f103_E_subref(void) { i8 v1352 = (i8)(intptr_t)(ws+4240); i8 v1353 = *(i8*)(intptr_t)v1352; i8 v1354 = (i8)(intptr_t)(ws+40); i8 v1355 = *(i8*)(intptr_t)v1354; - if (v1353==v1355) goto c02_0149; else goto c02_014a; + if (v1353==v1355) goto c01_0149; else goto c01_014a; -c02_0149:; +c01_0149:; i1 v1356 = (i1)+4; *(i1*)(intptr_t)(ws+4336) = v1356; - i8 v1357 = (i8)(intptr_t)(f83_E_b8); + i8 v1357 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1357)(); - goto c02_0146; + goto c01_0146; -c02_014a:; +c01_014a:; i1 v1358 = (i1)+1; *(i1*)(intptr_t)(ws+4336) = v1358; - i8 v1359 = (i8)(intptr_t)(f83_E_b8); + i8 v1359 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1359)(); @@ -3043,104 +3043,104 @@ c02_014a:; i8 v1362 = v1361+(+8); i2 v1363 = *(i2*)(intptr_t)v1362; *(i2*)(intptr_t)(ws+4272) = v1363; - i8 v1364 = (i8)(intptr_t)(f84_E_b16); + i8 v1364 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v1364)(); -c02_0146:; +c01_0146:; } - void f83_E_b8(void); - void f84_E_b16(void); -const i1 c02_s00bf[] = { 0x5f,0x73,0 }; - void f92_E(void); - void f101_E_h16(void); - void f83_E_b8(void); - void f84_E_b16(void); - void f83_E_b8(void); - void f84_E_b16(void); + void f82_E_b8(void); + void f83_E_b16(void); +const i1 c01_s00bf[] = { 0x5f,0x73,0 }; + void f91_E(void); + void f100_E_h16(void); + void f82_E_b8(void); + void f83_E_b16(void); + void f82_E_b8(void); + void f83_E_b16(void); // E_wsref workspace at ws+4264 length ws+6 -void f105_E_wsref(void) { +void f104_E_wsref(void) { i8 v1365 = (i8)(intptr_t)(ws+4266); i1 v1366 = *(i1*)(intptr_t)v1365; i1 v1367 = (i1)+255; - if (v1366==v1367) goto c02_014e; else goto c02_014f; + if (v1366==v1367) goto c01_014e; else goto c01_014f; -c02_014e:; +c01_014e:; i1 v1368 = (i1)+1; *(i1*)(intptr_t)(ws+4336) = v1368; - i8 v1369 = (i8)(intptr_t)(f83_E_b8); + i8 v1369 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1369)(); i8 v1370 = (i8)(intptr_t)(ws+4264); i2 v1371 = *(i2*)(intptr_t)v1370; *(i2*)(intptr_t)(ws+4272) = v1371; - i8 v1372 = (i8)(intptr_t)(f84_E_b16); + i8 v1372 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v1372)(); - i8 v1373 = (i8)(intptr_t)c02_s00bf; + i8 v1373 = (i8)(intptr_t)c01_s00bf; *(i8*)(intptr_t)(ws+4320) = v1373; - i8 v1374 = (i8)(intptr_t)(f92_E); + i8 v1374 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v1374)(); i8 v1375 = (i8)(intptr_t)(ws+4268); i2 v1376 = *(i2*)(intptr_t)v1375; *(i2*)(intptr_t)(ws+4272) = v1376; - i8 v1377 = (i8)(intptr_t)(f101_E_h16); + i8 v1377 = (i8)(intptr_t)(f100_E_h16); ((void(*)(void))(intptr_t)v1377)(); - goto c02_014b; + goto c01_014b; -c02_014f:; +c01_014f:; i1 v1378 = (i1)+2; *(i1*)(intptr_t)(ws+4336) = v1378; - i8 v1379 = (i8)(intptr_t)(f83_E_b8); + i8 v1379 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1379)(); i8 v1380 = (i8)(intptr_t)(ws+4264); i2 v1381 = *(i2*)(intptr_t)v1380; *(i2*)(intptr_t)(ws+4272) = v1381; - i8 v1382 = (i8)(intptr_t)(f84_E_b16); + i8 v1382 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v1382)(); i8 v1383 = (i8)(intptr_t)(ws+4266); i1 v1384 = *(i1*)(intptr_t)v1383; *(i1*)(intptr_t)(ws+4336) = v1384; - i8 v1385 = (i8)(intptr_t)(f83_E_b8); + i8 v1385 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v1385)(); i8 v1386 = (i8)(intptr_t)(ws+4268); i2 v1387 = *(i2*)(intptr_t)v1386; *(i2*)(intptr_t)(ws+4272) = v1387; - i8 v1388 = (i8)(intptr_t)(f84_E_b16); + i8 v1388 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v1388)(); -c02_014b:; +c01_014b:; } - void f82_FlushCurrentStream(void); + void f81_FlushCurrentStream(void); // EmitterOpenStream workspace at ws+4248 length ws+8 -void f106_EmitterOpenStream(void) { +void f105_EmitterOpenStream(void) { i8 v1389 = (i8)(intptr_t)(ws+2792); i8 v1390 = *(i8*)(intptr_t)v1389; i8 v1391 = (i8)+0; - if (v1390==v1391) goto c02_0153; else goto c02_0154; + if (v1390==v1391) goto c01_0153; else goto c01_0154; -c02_0153:; +c01_0153:; i8 v1392 = (i8)(intptr_t)(ws+2776); i8 v1393 = (i8)(intptr_t)(ws+2792); @@ -3150,13 +3150,13 @@ c02_0153:; i8 v1395 = (i8)(intptr_t)(ws+2800); *(i1*)(intptr_t)v1395 = v1394; - goto c02_0150; + goto c01_0150; -c02_0154:; +c01_0154:; i1 v1396 = (i1)+0; *(i1*)(intptr_t)(ws+4344) = v1396; - i8 v1397 = (i8)(intptr_t)(f82_FlushCurrentStream); + i8 v1397 = (i8)(intptr_t)(f81_FlushCurrentStream); ((void(*)(void))(intptr_t)v1397)(); @@ -3172,7 +3172,7 @@ c02_0154:; i8 v1405 = (i8)(intptr_t)(ws+2800); *(i1*)(intptr_t)v1405 = v1404; -c02_0150:; +c01_0150:; i8 v1406 = (i8)(intptr_t)(ws+4248); i8 v1407 = *(i8*)(intptr_t)v1406; @@ -3183,31 +3183,31 @@ c02_0150:; *(i2*)(intptr_t)v1411 = v1409; } - void f82_FlushCurrentStream(void); + void f81_FlushCurrentStream(void); // EmitterCloseStream workspace at ws+4248 length ws+0 -void f107_EmitterCloseStream(void) { +void f106_EmitterCloseStream(void) { i1 v1412 = (i1)+128; *(i1*)(intptr_t)(ws+4344) = v1412; - i8 v1413 = (i8)(intptr_t)(f82_FlushCurrentStream); + i8 v1413 = (i8)(intptr_t)(f81_FlushCurrentStream); ((void(*)(void))(intptr_t)v1413)(); i8 v1414 = (i8)(intptr_t)(ws+2792); i8 v1415 = *(i8*)(intptr_t)v1414; i8 v1416 = (i8)(intptr_t)(ws+2776); - if (v1415==v1416) goto c02_0158; else goto c02_0159; + if (v1415==v1416) goto c01_0158; else goto c01_0159; -c02_0158:; +c01_0158:; i8 v1417 = (i8)+0; i8 v1418 = (i8)(intptr_t)(ws+2792); *(i8*)(intptr_t)v1418 = v1417; - goto c02_0155; + goto c01_0155; -c02_0159:; +c01_0159:; i8 v1419 = (i8)(intptr_t)(ws+2792); i8 v1420 = *(i8*)(intptr_t)v1419; @@ -3221,22 +3221,22 @@ c02_0159:; i8 v1426 = (i8)(intptr_t)(ws+2800); *(i1*)(intptr_t)v1426 = v1425; -c02_0155:; +c01_0155:; } - void f54_FCBOpenOut(void); -const i1 c02_s00c0[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,0x70,0x65,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; - void f68_SimpleError(void); + void f53_FCBOpenOut(void); +const i1 c01_s00c0[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,0x70,0x65,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; + void f67_SimpleError(void); // EmitterOpenfile workspace at ws+3984 length ws+9 -void f108_EmitterOpenfile(void) { +void f107_EmitterOpenfile(void) { i8 v1427 = (i8)(intptr_t)(ws+200); *(i8*)(intptr_t)(ws+4000) = v1427; i8 v1428 = (i8)(intptr_t)(ws+3984); i8 v1429 = *(i8*)(intptr_t)v1428; *(i8*)(intptr_t)(ws+4008) = v1429; - i8 v1430 = (i8)(intptr_t)(f54_FCBOpenOut); + i8 v1430 = (i8)(intptr_t)(f53_FCBOpenOut); ((void(*)(void))(intptr_t)v1430)(); @@ -3247,45 +3247,45 @@ void f108_EmitterOpenfile(void) { i8 v1433 = (i8)(intptr_t)(ws+3992); i1 v1434 = *(i1*)(intptr_t)v1433; i1 v1435 = (i1)+0; - if (v1434==v1435) goto c02_015e; else goto c02_015d; + if (v1434==v1435) goto c01_015e; else goto c01_015d; -c02_015d:; +c01_015d:; - i8 v1436 = (i8)(intptr_t)c02_s00c0; + i8 v1436 = (i8)(intptr_t)c01_s00c0; *(i8*)(intptr_t)(ws+4280) = v1436; - i8 v1437 = (i8)(intptr_t)(f68_SimpleError); + i8 v1437 = (i8)(intptr_t)(f67_SimpleError); ((void(*)(void))(intptr_t)v1437)(); -c02_015e:; +c01_015e:; -c02_015a:; +c01_015a:; } - void f80_WriteB8(void); - void f81_WriteB16(void); - void f55_FCBClose(void); -const i1 c02_s00c1[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; - void f68_SimpleError(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f54_FCBClose(void); +const i1 c01_s00c1[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; + void f67_SimpleError(void); // EmitterClosefile workspace at ws+3984 length ws+1 -void f109_EmitterClosefile(void) { +void f108_EmitterClosefile(void) { i1 v1438 = (i1)+69; *(i1*)(intptr_t)(ws+4360) = v1438; - i8 v1439 = (i8)(intptr_t)(f80_WriteB8); + i8 v1439 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1439)(); i2 v1440 = (i2)+0; *(i2*)(intptr_t)(ws+4352) = v1440; - i8 v1441 = (i8)(intptr_t)(f81_WriteB16); + i8 v1441 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1441)(); i8 v1442 = (i8)(intptr_t)(ws+200); *(i8*)(intptr_t)(ws+3992) = v1442; - i8 v1443 = (i8)(intptr_t)(f55_FCBClose); + i8 v1443 = (i8)(intptr_t)(f54_FCBClose); ((void(*)(void))(intptr_t)v1443)(); @@ -3296,35 +3296,35 @@ void f109_EmitterClosefile(void) { i8 v1446 = (i8)(intptr_t)(ws+3984); i1 v1447 = *(i1*)(intptr_t)v1446; i1 v1448 = (i1)+0; - if (v1447==v1448) goto c02_0163; else goto c02_0162; + if (v1447==v1448) goto c01_0163; else goto c01_0162; -c02_0162:; +c01_0162:; - i8 v1449 = (i8)(intptr_t)c02_s00c1; + i8 v1449 = (i8)(intptr_t)c01_s00c1; *(i8*)(intptr_t)(ws+4280) = v1449; - i8 v1450 = (i8)(intptr_t)(f68_SimpleError); + i8 v1450 = (i8)(intptr_t)(f67_SimpleError); ((void(*)(void))(intptr_t)v1450)(); -c02_0163:; +c01_0163:; -c02_015f:; +c01_015f:; } - void f29_StrLen(void); - void f80_WriteB8(void); - void f81_WriteB16(void); - void f81_WriteB16(void); - void f59_FCBPutBlock(void); + void f28_StrLen(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f80_WriteB16(void); + void f58_FCBPutBlock(void); // EmitterDeclareSubroutine workspace at ws+4024 length ws+18 -void f110_EmitterDeclareSubroutine(void) { +void f109_EmitterDeclareSubroutine(void) { i8 v1451 = (i8)(intptr_t)(ws+4024); i8 v1452 = *(i8*)(intptr_t)v1451; i8 v1453 = *(i8*)(intptr_t)v1452; *(i8*)(intptr_t)(ws+4064) = v1453; - i8 v1454 = (i8)(intptr_t)(f29_StrLen); + i8 v1454 = (i8)(intptr_t)(f28_StrLen); ((void(*)(void))(intptr_t)v1454)(); @@ -3340,7 +3340,7 @@ void f110_EmitterDeclareSubroutine(void) { i1 v1461 = (i1)+78; *(i1*)(intptr_t)(ws+4360) = v1461; - i8 v1462 = (i8)(intptr_t)(f80_WriteB8); + i8 v1462 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1462)(); @@ -3348,7 +3348,7 @@ void f110_EmitterDeclareSubroutine(void) { i2 v1464 = *(i2*)(intptr_t)v1463; i2 v1465 = v1464+(+2); *(i2*)(intptr_t)(ws+4352) = v1465; - i8 v1466 = (i8)(intptr_t)(f81_WriteB16); + i8 v1466 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1466)(); @@ -3357,7 +3357,7 @@ void f110_EmitterDeclareSubroutine(void) { i8 v1469 = v1468+(+8); i2 v1470 = *(i2*)(intptr_t)v1469; *(i2*)(intptr_t)(ws+4352) = v1470; - i8 v1471 = (i8)(intptr_t)(f81_WriteB16); + i8 v1471 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1471)(); @@ -3371,24 +3371,24 @@ void f110_EmitterDeclareSubroutine(void) { i2 v1477 = *(i2*)(intptr_t)v1476; i8 v1478 = v1477; *(i8*)(intptr_t)(ws+4368) = v1478; - i8 v1479 = (i8)(intptr_t)(f59_FCBPutBlock); + i8 v1479 = (i8)(intptr_t)(f58_FCBPutBlock); ((void(*)(void))(intptr_t)v1479)(); } - void f29_StrLen(void); - void f80_WriteB8(void); - void f81_WriteB16(void); - void f81_WriteB16(void); - void f59_FCBPutBlock(void); + void f28_StrLen(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f80_WriteB16(void); + void f58_FCBPutBlock(void); // EmitterDeclareExternalSubroutine workspace at ws+4032 length ws+26 -void f111_EmitterDeclareExternalSubroutine(void) { +void f110_EmitterDeclareExternalSubroutine(void) { i8 v1480 = (i8)(intptr_t)(ws+4040); i8 v1481 = *(i8*)(intptr_t)v1480; *(i8*)(intptr_t)(ws+4064) = v1481; - i8 v1482 = (i8)(intptr_t)(f29_StrLen); + i8 v1482 = (i8)(intptr_t)(f28_StrLen); ((void(*)(void))(intptr_t)v1482)(); @@ -3404,7 +3404,7 @@ void f111_EmitterDeclareExternalSubroutine(void) { i1 v1489 = (i1)+88; *(i1*)(intptr_t)(ws+4360) = v1489; - i8 v1490 = (i8)(intptr_t)(f80_WriteB8); + i8 v1490 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1490)(); @@ -3412,14 +3412,14 @@ void f111_EmitterDeclareExternalSubroutine(void) { i2 v1492 = *(i2*)(intptr_t)v1491; i2 v1493 = v1492+(+2); *(i2*)(intptr_t)(ws+4352) = v1493; - i8 v1494 = (i8)(intptr_t)(f81_WriteB16); + i8 v1494 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1494)(); i8 v1495 = (i8)(intptr_t)(ws+4032); i2 v1496 = *(i2*)(intptr_t)v1495; *(i2*)(intptr_t)(ws+4352) = v1496; - i8 v1497 = (i8)(intptr_t)(f81_WriteB16); + i8 v1497 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1497)(); @@ -3432,97 +3432,97 @@ void f111_EmitterDeclareExternalSubroutine(void) { i2 v1502 = *(i2*)(intptr_t)v1501; i8 v1503 = v1502; *(i8*)(intptr_t)(ws+4368) = v1503; - i8 v1504 = (i8)(intptr_t)(f59_FCBPutBlock); + i8 v1504 = (i8)(intptr_t)(f58_FCBPutBlock); ((void(*)(void))(intptr_t)v1504)(); } - void f80_WriteB8(void); - void f81_WriteB16(void); - void f81_WriteB16(void); - void f81_WriteB16(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f80_WriteB16(void); + void f80_WriteB16(void); // EmitterReferenceSubroutineById workspace at ws+4040 length ws+4 -void f112_EmitterReferenceSubroutineById(void) { +void f111_EmitterReferenceSubroutineById(void) { i1 v1505 = (i1)+82; *(i1*)(intptr_t)(ws+4360) = v1505; - i8 v1506 = (i8)(intptr_t)(f80_WriteB8); + i8 v1506 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1506)(); i2 v1507 = (i2)+4; *(i2*)(intptr_t)(ws+4352) = v1507; - i8 v1508 = (i8)(intptr_t)(f81_WriteB16); + i8 v1508 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1508)(); i8 v1509 = (i8)(intptr_t)(ws+4040); i2 v1510 = *(i2*)(intptr_t)v1509; *(i2*)(intptr_t)(ws+4352) = v1510; - i8 v1511 = (i8)(intptr_t)(f81_WriteB16); + i8 v1511 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1511)(); i8 v1512 = (i8)(intptr_t)(ws+4042); i2 v1513 = *(i2*)(intptr_t)v1512; *(i2*)(intptr_t)(ws+4352) = v1513; - i8 v1514 = (i8)(intptr_t)(f81_WriteB16); + i8 v1514 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1514)(); } - void f80_WriteB8(void); - void f81_WriteB16(void); - void f81_WriteB16(void); - void f80_WriteB8(void); - void f81_WriteB16(void); + void f79_WriteB8(void); + void f80_WriteB16(void); + void f80_WriteB16(void); + void f79_WriteB8(void); + void f80_WriteB16(void); // EmitterDeclareWorkspace workspace at ws+4024 length ws+6 -void f114_EmitterDeclareWorkspace(void) { +void f113_EmitterDeclareWorkspace(void) { i1 v1524 = (i1)+87; *(i1*)(intptr_t)(ws+4360) = v1524; - i8 v1525 = (i8)(intptr_t)(f80_WriteB8); + i8 v1525 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1525)(); i2 v1526 = (i2)+5; *(i2*)(intptr_t)(ws+4352) = v1526; - i8 v1527 = (i8)(intptr_t)(f81_WriteB16); + i8 v1527 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1527)(); i8 v1528 = (i8)(intptr_t)(ws+4024); i2 v1529 = *(i2*)(intptr_t)v1528; *(i2*)(intptr_t)(ws+4352) = v1529; - i8 v1530 = (i8)(intptr_t)(f81_WriteB16); + i8 v1530 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1530)(); i8 v1531 = (i8)(intptr_t)(ws+4026); i1 v1532 = *(i1*)(intptr_t)v1531; *(i1*)(intptr_t)(ws+4360) = v1532; - i8 v1533 = (i8)(intptr_t)(f80_WriteB8); + i8 v1533 = (i8)(intptr_t)(f79_WriteB8); ((void(*)(void))(intptr_t)v1533)(); i8 v1534 = (i8)(intptr_t)(ws+4028); i2 v1535 = *(i2*)(intptr_t)v1534; *(i2*)(intptr_t)(ws+4352) = v1535; - i8 v1536 = (i8)(intptr_t)(f81_WriteB16); + i8 v1536 = (i8)(intptr_t)(f80_WriteB16); ((void(*)(void))(intptr_t)v1536)(); } - void f46_FCBGetChar(void); + void f45_FCBGetChar(void); // I_b8 workspace at ws+4152 length ws+2 -void f115_I_b8(void) { +void f114_I_b8(void) { i8 v1537 = (i8)(intptr_t)(ws+2804); *(i8*)(intptr_t)(ws+4160) = v1537; - i8 v1538 = (i8)(intptr_t)(f46_FCBGetChar); + i8 v1538 = (i8)(intptr_t)(f45_FCBGetChar); ((void(*)(void))(intptr_t)v1538)(); @@ -3536,13 +3536,13 @@ void f115_I_b8(void) { *(i1*)(intptr_t)v1543 = v1542; } - void f115_I_b8(void); - void f115_I_b8(void); + void f114_I_b8(void); + void f114_I_b8(void); // I_b16 workspace at ws+4136 length ws+4 -void f116_I_b16(void) { +void f115_I_b16(void) { - i8 v1544 = (i8)(intptr_t)(f115_I_b8); + i8 v1544 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1544)(); @@ -3556,7 +3556,7 @@ void f116_I_b16(void) { i8 v1550 = (i8)(intptr_t)(ws+4136); *(i2*)(intptr_t)v1550 = v1549; - i8 v1551 = (i8)(intptr_t)(f115_I_b8); + i8 v1551 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1551)(); @@ -3576,13 +3576,13 @@ void f116_I_b16(void) { *(i2*)(intptr_t)v1562 = v1561; } - void f116_I_b16(void); - void f116_I_b16(void); + void f115_I_b16(void); + void f115_I_b16(void); // I_b32 workspace at ws+4096 length ws+8 -void f117_I_b32(void) { +void f116_I_b32(void) { - i8 v1563 = (i8)(intptr_t)(f116_I_b16); + i8 v1563 = (i8)(intptr_t)(f115_I_b16); ((void(*)(void))(intptr_t)v1563)(); @@ -3596,7 +3596,7 @@ void f117_I_b32(void) { i8 v1569 = (i8)(intptr_t)(ws+4096); *(i4*)(intptr_t)v1569 = v1568; - i8 v1570 = (i8)(intptr_t)(f116_I_b16); + i8 v1570 = (i8)(intptr_t)(f115_I_b16); ((void(*)(void))(intptr_t)v1570)(); @@ -3616,12 +3616,12 @@ void f117_I_b32(void) { *(i4*)(intptr_t)v1581 = v1580; } - void f116_I_b16(void); + void f115_I_b16(void); // I_bsize workspace at ws+4128 length ws+4 -void f118_I_bsize(void) { +void f117_I_bsize(void) { - i8 v1582 = (i8)(intptr_t)(f116_I_b16); + i8 v1582 = (i8)(intptr_t)(f115_I_b16); ((void(*)(void))(intptr_t)v1582)(); @@ -3635,14 +3635,14 @@ void f118_I_bsize(void) { *(i2*)(intptr_t)v1587 = v1586; } - void f115_I_b8(void); - void f33_Alloc(void); - void f115_I_b8(void); + void f114_I_b8(void); + void f32_Alloc(void); + void f114_I_b8(void); // I_countedstring workspace at ws+4112 length ws+33 -void f119_I_countedstring(void) { +void f118_I_countedstring(void) { - i8 v1588 = (i8)(intptr_t)(f115_I_b8); + i8 v1588 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1588)(); @@ -3660,7 +3660,7 @@ void f119_I_countedstring(void) { i1 v1596 = v1595+(+1); i8 v1597 = v1596; *(i8*)(intptr_t)(ws+4152) = v1597; - i8 v1598 = (i8)(intptr_t)(f33_Alloc); + i8 v1598 = (i8)(intptr_t)(f32_Alloc); ((void(*)(void))(intptr_t)v1598)(); @@ -3678,16 +3678,16 @@ void f119_I_countedstring(void) { i8 v1606 = (i8)(intptr_t)(ws+4136); *(i8*)(intptr_t)v1606 = v1605; -c02_0164:; +c01_0164:; i8 v1607 = (i8)(intptr_t)(ws+4121); i1 v1608 = *(i1*)(intptr_t)v1607; i1 v1609 = (i1)+0; - if (v1608==v1609) goto c02_0169; else goto c02_0168; + if (v1608==v1609) goto c01_0169; else goto c01_0168; -c02_0168:; +c01_0168:; - i8 v1610 = (i8)(intptr_t)(f115_I_b8); + i8 v1610 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1610)(); @@ -3713,9 +3713,9 @@ c02_0168:; i8 v1624 = (i8)(intptr_t)(ws+4121); *(i1*)(intptr_t)v1624 = v1623; - goto c02_0164; + goto c01_0164; -c02_0169:; +c01_0169:; i1 v1625 = (i1)+0; i8 v1626 = (i8)(intptr_t)(ws+4136); @@ -3723,18 +3723,18 @@ c02_0169:; *(i1*)(intptr_t)v1627 = v1625; } - void f52_FCBOpenIn(void); - void f69_CannotOpen(void); + void f51_FCBOpenIn(void); + void f68_CannotOpen(void); // InputterOpenfile workspace at ws+3984 length ws+9 -void f120_InputterOpenfile(void) { +void f119_InputterOpenfile(void) { i8 v1628 = (i8)(intptr_t)(ws+2804); *(i8*)(intptr_t)(ws+4000) = v1628; i8 v1629 = (i8)(intptr_t)(ws+3984); i8 v1630 = *(i8*)(intptr_t)v1629; *(i8*)(intptr_t)(ws+4008) = v1630; - i8 v1631 = (i8)(intptr_t)(f52_FCBOpenIn); + i8 v1631 = (i8)(intptr_t)(f51_FCBOpenIn); ((void(*)(void))(intptr_t)v1631)(); @@ -3745,30 +3745,30 @@ void f120_InputterOpenfile(void) { i8 v1634 = (i8)(intptr_t)(ws+3992); i1 v1635 = *(i1*)(intptr_t)v1634; i1 v1636 = (i1)+0; - if (v1635==v1636) goto c02_016e; else goto c02_016d; + if (v1635==v1636) goto c01_016e; else goto c01_016d; -c02_016d:; +c01_016d:; i8 v1637 = (i8)(intptr_t)(ws+3984); i8 v1638 = *(i8*)(intptr_t)v1637; *(i8*)(intptr_t)(ws+4000) = v1638; - i8 v1639 = (i8)(intptr_t)(f69_CannotOpen); + i8 v1639 = (i8)(intptr_t)(f68_CannotOpen); ((void(*)(void))(intptr_t)v1639)(); -c02_016e:; +c01_016e:; -c02_016a:; +c01_016a:; } - void f55_FCBClose(void); + void f54_FCBClose(void); // InputterClosefile workspace at ws+3984 length ws+2 -void f121_InputterClosefile(void) { +void f120_InputterClosefile(void) { i8 v1640 = (i8)(intptr_t)(ws+2804); *(i8*)(intptr_t)(ws+3992) = v1640; - i8 v1641 = (i8)(intptr_t)(f55_FCBClose); + i8 v1641 = (i8)(intptr_t)(f54_FCBClose); ((void(*)(void))(intptr_t)v1641)(); @@ -3782,564 +3782,564 @@ void f121_InputterClosefile(void) { *(i1*)(intptr_t)v1646 = v1645; } + void f115_I_b16(void); + void f64_FindSubr(void); -// ReadMid0 workspace at ws+4088 length ws+0 -void f122_ReadMid0(void) { +// ReadMid0 workspace at ws+4088 length ws+16 +void f121_ReadMid0(void) { -} - void f117_I_b32(void); - -// ReadMid1 workspace at ws+4088 length ws+4 -void f123_ReadMid1(void) { - - i8 v1647 = (i8)(intptr_t)(f117_I_b32); + i8 v1647 = (i8)(intptr_t)(f115_I_b16); ((void(*)(void))(intptr_t)v1647)(); - i4 v1648 = *(i4*)(intptr_t)(ws+4096); + i2 v1648 = *(i2*)(intptr_t)(ws+4136); i8 v1649 = (i8)(intptr_t)(ws+4088); - *(i4*)(intptr_t)v1649 = v1648; + *(i2*)(intptr_t)v1649 = v1648; i8 v1650 = (i8)(intptr_t)(ws+4088); - i4 v1651 = *(i4*)(intptr_t)v1650; - i8 v1652 = (i8)(intptr_t)(ws+4080); - i8 v1653 = *(i8*)(intptr_t)v1652; - *(i4*)(intptr_t)v1653 = v1651; - -} - void f116_I_b16(void); - void f116_I_b16(void); - void f116_I_b16(void); - void f115_I_b8(void); - -// ReadMid2 workspace at ws+4088 length ws+7 -void f124_ReadMid2(void) { - - i8 v1654 = (i8)(intptr_t)(f116_I_b16); + i2 v1651 = *(i2*)(intptr_t)v1650; + *(i2*)(intptr_t)(ws+4256) = v1651; + i8 v1652 = (i8)(intptr_t)(f64_FindSubr); - ((void(*)(void))(intptr_t)v1654)(); + ((void(*)(void))(intptr_t)v1652)(); - i2 v1655 = *(i2*)(intptr_t)(ws+4136); - i8 v1656 = (i8)(intptr_t)(ws+4088); - *(i2*)(intptr_t)v1656 = v1655; + i8 v1653 = *(i8*)(intptr_t)(ws+4264); + i8 v1654 = (i8)(intptr_t)(ws+4096); + *(i8*)(intptr_t)v1654 = v1653; - i8 v1657 = (i8)(intptr_t)(ws+4088); - i2 v1658 = *(i2*)(intptr_t)v1657; - i8 v1659 = (i8)(intptr_t)(ws+4080); - i8 v1660 = *(i8*)(intptr_t)v1659; - *(i2*)(intptr_t)v1660 = v1658; + i8 v1655 = (i8)(intptr_t)(ws+4096); + i8 v1656 = *(i8*)(intptr_t)v1655; + i8 v1657 = (i8)(intptr_t)(ws+4080); + i8 v1658 = *(i8*)(intptr_t)v1657; + *(i8*)(intptr_t)v1658 = v1656; - i8 v1661 = (i8)(intptr_t)(f116_I_b16); +} + void f118_I_countedstring(void); - ((void(*)(void))(intptr_t)v1661)(); +// ReadMid1 workspace at ws+4088 length ws+8 +void f122_ReadMid1(void) { - i2 v1662 = *(i2*)(intptr_t)(ws+4136); - i8 v1663 = (i8)(intptr_t)(ws+4090); - *(i2*)(intptr_t)v1663 = v1662; + i8 v1659 = (i8)(intptr_t)(f118_I_countedstring); - i8 v1664 = (i8)(intptr_t)(ws+4090); - i2 v1665 = *(i2*)(intptr_t)v1664; - i8 v1666 = (i8)(intptr_t)(ws+4080); - i8 v1667 = *(i8*)(intptr_t)v1666; - i8 v1668 = v1667+(+2); - *(i2*)(intptr_t)v1668 = v1665; + ((void(*)(void))(intptr_t)v1659)(); - i8 v1669 = (i8)(intptr_t)(f116_I_b16); + i8 v1660 = *(i8*)(intptr_t)(ws+4112); + i8 v1661 = (i8)(intptr_t)(ws+4088); + *(i8*)(intptr_t)v1661 = v1660; - ((void(*)(void))(intptr_t)v1669)(); + i8 v1662 = (i8)(intptr_t)(ws+4088); + i8 v1663 = *(i8*)(intptr_t)v1662; + i8 v1664 = (i8)(intptr_t)(ws+4080); + i8 v1665 = *(i8*)(intptr_t)v1664; + *(i8*)(intptr_t)v1665 = v1663; - i2 v1670 = *(i2*)(intptr_t)(ws+4136); - i8 v1671 = (i8)(intptr_t)(ws+4092); - *(i2*)(intptr_t)v1671 = v1670; +} + void f115_I_b16(void); + void f64_FindSubr(void); + void f115_I_b16(void); + void f64_FindSubr(void); + void f114_I_b8(void); + void f117_I_bsize(void); + void f114_I_b8(void); + void f114_I_b8(void); - i8 v1672 = (i8)(intptr_t)(ws+4092); - i2 v1673 = *(i2*)(intptr_t)v1672; - i8 v1674 = (i8)(intptr_t)(ws+4080); - i8 v1675 = *(i8*)(intptr_t)v1674; - i8 v1676 = v1675+(+4); - *(i2*)(intptr_t)v1676 = v1673; +// ReadMid2 workspace at ws+4088 length ws+38 +void f123_ReadMid2(void) { - i8 v1677 = (i8)(intptr_t)(f115_I_b8); + i8 v1666 = (i8)(intptr_t)(f115_I_b16); - ((void(*)(void))(intptr_t)v1677)(); + ((void(*)(void))(intptr_t)v1666)(); - i1 v1678 = *(i1*)(intptr_t)(ws+4152); - i8 v1679 = (i8)(intptr_t)(ws+4094); - *(i1*)(intptr_t)v1679 = v1678; + i2 v1667 = *(i2*)(intptr_t)(ws+4136); + i8 v1668 = (i8)(intptr_t)(ws+4088); + *(i2*)(intptr_t)v1668 = v1667; - i8 v1680 = (i8)(intptr_t)(ws+4094); - i1 v1681 = *(i1*)(intptr_t)v1680; - i8 v1682 = (i8)(intptr_t)(ws+4080); - i8 v1683 = *(i8*)(intptr_t)v1682; - i8 v1684 = v1683+(+6); - *(i1*)(intptr_t)v1684 = v1681; + i8 v1669 = (i8)(intptr_t)(ws+4088); + i2 v1670 = *(i2*)(intptr_t)v1669; + *(i2*)(intptr_t)(ws+4256) = v1670; + i8 v1671 = (i8)(intptr_t)(f64_FindSubr); -} - void f116_I_b16(void); + ((void(*)(void))(intptr_t)v1671)(); -// ReadMid3 workspace at ws+4088 length ws+2 -void f125_ReadMid3(void) { + i8 v1672 = *(i8*)(intptr_t)(ws+4264); + i8 v1673 = (i8)(intptr_t)(ws+4096); + *(i8*)(intptr_t)v1673 = v1672; - i8 v1685 = (i8)(intptr_t)(f116_I_b16); + i8 v1674 = (i8)(intptr_t)(ws+4096); + i8 v1675 = *(i8*)(intptr_t)v1674; + i8 v1676 = (i8)(intptr_t)(ws+4080); + i8 v1677 = *(i8*)(intptr_t)v1676; + *(i8*)(intptr_t)v1677 = v1675; - ((void(*)(void))(intptr_t)v1685)(); + i8 v1678 = (i8)(intptr_t)(f115_I_b16); - i2 v1686 = *(i2*)(intptr_t)(ws+4136); - i8 v1687 = (i8)(intptr_t)(ws+4088); - *(i2*)(intptr_t)v1687 = v1686; + ((void(*)(void))(intptr_t)v1678)(); - i8 v1688 = (i8)(intptr_t)(ws+4088); - i2 v1689 = *(i2*)(intptr_t)v1688; - i8 v1690 = (i8)(intptr_t)(ws+4080); - i8 v1691 = *(i8*)(intptr_t)v1690; - *(i2*)(intptr_t)v1691 = v1689; + i2 v1679 = *(i2*)(intptr_t)(ws+4136); + i8 v1680 = (i8)(intptr_t)(ws+4104); + *(i2*)(intptr_t)v1680 = v1679; -} - void f115_I_b8(void); + i8 v1681 = (i8)(intptr_t)(ws+4104); + i2 v1682 = *(i2*)(intptr_t)v1681; + *(i2*)(intptr_t)(ws+4256) = v1682; + i8 v1683 = (i8)(intptr_t)(f64_FindSubr); -// ReadMid4 workspace at ws+4088 length ws+1 -void f126_ReadMid4(void) { + ((void(*)(void))(intptr_t)v1683)(); - i8 v1692 = (i8)(intptr_t)(f115_I_b8); + i8 v1684 = *(i8*)(intptr_t)(ws+4264); + i8 v1685 = (i8)(intptr_t)(ws+4112); + *(i8*)(intptr_t)v1685 = v1684; - ((void(*)(void))(intptr_t)v1692)(); + i8 v1686 = (i8)(intptr_t)(ws+4112); + i8 v1687 = *(i8*)(intptr_t)v1686; + i8 v1688 = (i8)(intptr_t)(ws+4080); + i8 v1689 = *(i8*)(intptr_t)v1688; + i8 v1690 = v1689+(+8); + *(i8*)(intptr_t)v1690 = v1687; - i1 v1693 = *(i1*)(intptr_t)(ws+4152); - i8 v1694 = (i8)(intptr_t)(ws+4088); - *(i1*)(intptr_t)v1694 = v1693; + i8 v1691 = (i8)(intptr_t)(f114_I_b8); - i8 v1695 = (i8)(intptr_t)(ws+4088); - i1 v1696 = *(i1*)(intptr_t)v1695; - i8 v1697 = (i8)(intptr_t)(ws+4080); - i8 v1698 = *(i8*)(intptr_t)v1697; - *(i1*)(intptr_t)v1698 = v1696; + ((void(*)(void))(intptr_t)v1691)(); -} - void f116_I_b16(void); - void f65_FindSubr(void); - void f115_I_b8(void); - void f118_I_bsize(void); - void f115_I_b8(void); - void f118_I_bsize(void); + i1 v1692 = *(i1*)(intptr_t)(ws+4152); + i8 v1693 = (i8)(intptr_t)(ws+4120); + *(i1*)(intptr_t)v1693 = v1692; -// ReadMid5 workspace at ws+4088 length ws+24 -void f127_ReadMid5(void) { + i8 v1694 = (i8)(intptr_t)(ws+4120); + i1 v1695 = *(i1*)(intptr_t)v1694; + i8 v1696 = (i8)(intptr_t)(ws+4080); + i8 v1697 = *(i8*)(intptr_t)v1696; + i8 v1698 = v1697+(+18); + *(i1*)(intptr_t)v1698 = v1695; - i8 v1699 = (i8)(intptr_t)(f116_I_b16); + i8 v1699 = (i8)(intptr_t)(f117_I_bsize); ((void(*)(void))(intptr_t)v1699)(); - i2 v1700 = *(i2*)(intptr_t)(ws+4136); - i8 v1701 = (i8)(intptr_t)(ws+4088); + i2 v1700 = *(i2*)(intptr_t)(ws+4128); + i8 v1701 = (i8)(intptr_t)(ws+4122); *(i2*)(intptr_t)v1701 = v1700; - i8 v1702 = (i8)(intptr_t)(ws+4088); + i8 v1702 = (i8)(intptr_t)(ws+4122); i2 v1703 = *(i2*)(intptr_t)v1702; - *(i2*)(intptr_t)(ws+4256) = v1703; - i8 v1704 = (i8)(intptr_t)(f65_FindSubr); + i8 v1704 = (i8)(intptr_t)(ws+4080); + i8 v1705 = *(i8*)(intptr_t)v1704; + i8 v1706 = v1705+(+20); + *(i2*)(intptr_t)v1706 = v1703; + + i8 v1707 = (i8)(intptr_t)(f114_I_b8); - ((void(*)(void))(intptr_t)v1704)(); + ((void(*)(void))(intptr_t)v1707)(); - i8 v1705 = *(i8*)(intptr_t)(ws+4264); - i8 v1706 = (i8)(intptr_t)(ws+4096); - *(i8*)(intptr_t)v1706 = v1705; + i1 v1708 = *(i1*)(intptr_t)(ws+4152); + i8 v1709 = (i8)(intptr_t)(ws+4124); + *(i1*)(intptr_t)v1709 = v1708; - i8 v1707 = (i8)(intptr_t)(ws+4096); - i8 v1708 = *(i8*)(intptr_t)v1707; - i8 v1709 = (i8)(intptr_t)(ws+4080); - i8 v1710 = *(i8*)(intptr_t)v1709; - *(i8*)(intptr_t)v1710 = v1708; + i8 v1710 = (i8)(intptr_t)(ws+4124); + i1 v1711 = *(i1*)(intptr_t)v1710; + i8 v1712 = (i8)(intptr_t)(ws+4080); + i8 v1713 = *(i8*)(intptr_t)v1712; + i8 v1714 = v1713+(+22); + *(i1*)(intptr_t)v1714 = v1711; - i8 v1711 = (i8)(intptr_t)(f115_I_b8); + i8 v1715 = (i8)(intptr_t)(f114_I_b8); - ((void(*)(void))(intptr_t)v1711)(); + ((void(*)(void))(intptr_t)v1715)(); - i1 v1712 = *(i1*)(intptr_t)(ws+4152); - i8 v1713 = (i8)(intptr_t)(ws+4104); - *(i1*)(intptr_t)v1713 = v1712; + i1 v1716 = *(i1*)(intptr_t)(ws+4152); + i8 v1717 = (i8)(intptr_t)(ws+4125); + *(i1*)(intptr_t)v1717 = v1716; - i8 v1714 = (i8)(intptr_t)(ws+4104); - i1 v1715 = *(i1*)(intptr_t)v1714; - i8 v1716 = (i8)(intptr_t)(ws+4080); - i8 v1717 = *(i8*)(intptr_t)v1716; - i8 v1718 = v1717+(+10); - *(i1*)(intptr_t)v1718 = v1715; + i8 v1718 = (i8)(intptr_t)(ws+4125); + i1 v1719 = *(i1*)(intptr_t)v1718; + i8 v1720 = (i8)(intptr_t)(ws+4080); + i8 v1721 = *(i8*)(intptr_t)v1720; + i8 v1722 = v1721+(+23); + *(i1*)(intptr_t)v1722 = v1719; + +} + void f115_I_b16(void); + void f64_FindSubr(void); + void f114_I_b8(void); + void f117_I_bsize(void); + void f114_I_b8(void); - i8 v1719 = (i8)(intptr_t)(f118_I_bsize); +// ReadMid3 workspace at ws+4088 length ws+21 +void f124_ReadMid3(void) { - ((void(*)(void))(intptr_t)v1719)(); + i8 v1723 = (i8)(intptr_t)(f115_I_b16); - i2 v1720 = *(i2*)(intptr_t)(ws+4128); - i8 v1721 = (i8)(intptr_t)(ws+4106); - *(i2*)(intptr_t)v1721 = v1720; + ((void(*)(void))(intptr_t)v1723)(); - i8 v1722 = (i8)(intptr_t)(ws+4106); - i2 v1723 = *(i2*)(intptr_t)v1722; - i8 v1724 = (i8)(intptr_t)(ws+4080); - i8 v1725 = *(i8*)(intptr_t)v1724; - i8 v1726 = v1725+(+12); - *(i2*)(intptr_t)v1726 = v1723; + i2 v1724 = *(i2*)(intptr_t)(ws+4136); + i8 v1725 = (i8)(intptr_t)(ws+4088); + *(i2*)(intptr_t)v1725 = v1724; - i8 v1727 = (i8)(intptr_t)(f115_I_b8); + i8 v1726 = (i8)(intptr_t)(ws+4088); + i2 v1727 = *(i2*)(intptr_t)v1726; + *(i2*)(intptr_t)(ws+4256) = v1727; + i8 v1728 = (i8)(intptr_t)(f64_FindSubr); - ((void(*)(void))(intptr_t)v1727)(); + ((void(*)(void))(intptr_t)v1728)(); - i1 v1728 = *(i1*)(intptr_t)(ws+4152); - i8 v1729 = (i8)(intptr_t)(ws+4108); - *(i1*)(intptr_t)v1729 = v1728; + i8 v1729 = *(i8*)(intptr_t)(ws+4264); + i8 v1730 = (i8)(intptr_t)(ws+4096); + *(i8*)(intptr_t)v1730 = v1729; - i8 v1730 = (i8)(intptr_t)(ws+4108); - i1 v1731 = *(i1*)(intptr_t)v1730; - i8 v1732 = (i8)(intptr_t)(ws+4080); - i8 v1733 = *(i8*)(intptr_t)v1732; - i8 v1734 = v1733+(+14); - *(i1*)(intptr_t)v1734 = v1731; + i8 v1731 = (i8)(intptr_t)(ws+4096); + i8 v1732 = *(i8*)(intptr_t)v1731; + i8 v1733 = (i8)(intptr_t)(ws+4080); + i8 v1734 = *(i8*)(intptr_t)v1733; + *(i8*)(intptr_t)v1734 = v1732; - i8 v1735 = (i8)(intptr_t)(f118_I_bsize); + i8 v1735 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1735)(); - i2 v1736 = *(i2*)(intptr_t)(ws+4128); - i8 v1737 = (i8)(intptr_t)(ws+4110); - *(i2*)(intptr_t)v1737 = v1736; + i1 v1736 = *(i1*)(intptr_t)(ws+4152); + i8 v1737 = (i8)(intptr_t)(ws+4104); + *(i1*)(intptr_t)v1737 = v1736; - i8 v1738 = (i8)(intptr_t)(ws+4110); - i2 v1739 = *(i2*)(intptr_t)v1738; + i8 v1738 = (i8)(intptr_t)(ws+4104); + i1 v1739 = *(i1*)(intptr_t)v1738; i8 v1740 = (i8)(intptr_t)(ws+4080); i8 v1741 = *(i8*)(intptr_t)v1740; - i8 v1742 = v1741+(+16); - *(i2*)(intptr_t)v1742 = v1739; - -} - void f116_I_b16(void); - void f65_FindSubr(void); - void f115_I_b8(void); - void f118_I_bsize(void); - void f115_I_b8(void); - -// ReadMid6 workspace at ws+4088 length ws+21 -void f128_ReadMid6(void) { + i8 v1742 = v1741+(+10); + *(i1*)(intptr_t)v1742 = v1739; - i8 v1743 = (i8)(intptr_t)(f116_I_b16); + i8 v1743 = (i8)(intptr_t)(f117_I_bsize); ((void(*)(void))(intptr_t)v1743)(); - i2 v1744 = *(i2*)(intptr_t)(ws+4136); - i8 v1745 = (i8)(intptr_t)(ws+4088); + i2 v1744 = *(i2*)(intptr_t)(ws+4128); + i8 v1745 = (i8)(intptr_t)(ws+4106); *(i2*)(intptr_t)v1745 = v1744; - i8 v1746 = (i8)(intptr_t)(ws+4088); + i8 v1746 = (i8)(intptr_t)(ws+4106); i2 v1747 = *(i2*)(intptr_t)v1746; - *(i2*)(intptr_t)(ws+4256) = v1747; - i8 v1748 = (i8)(intptr_t)(f65_FindSubr); + i8 v1748 = (i8)(intptr_t)(ws+4080); + i8 v1749 = *(i8*)(intptr_t)v1748; + i8 v1750 = v1749+(+12); + *(i2*)(intptr_t)v1750 = v1747; - ((void(*)(void))(intptr_t)v1748)(); + i8 v1751 = (i8)(intptr_t)(f114_I_b8); - i8 v1749 = *(i8*)(intptr_t)(ws+4264); - i8 v1750 = (i8)(intptr_t)(ws+4096); - *(i8*)(intptr_t)v1750 = v1749; + ((void(*)(void))(intptr_t)v1751)(); - i8 v1751 = (i8)(intptr_t)(ws+4096); - i8 v1752 = *(i8*)(intptr_t)v1751; - i8 v1753 = (i8)(intptr_t)(ws+4080); - i8 v1754 = *(i8*)(intptr_t)v1753; - *(i8*)(intptr_t)v1754 = v1752; + i1 v1752 = *(i1*)(intptr_t)(ws+4152); + i8 v1753 = (i8)(intptr_t)(ws+4108); + *(i1*)(intptr_t)v1753 = v1752; - i8 v1755 = (i8)(intptr_t)(f115_I_b8); + i8 v1754 = (i8)(intptr_t)(ws+4108); + i1 v1755 = *(i1*)(intptr_t)v1754; + i8 v1756 = (i8)(intptr_t)(ws+4080); + i8 v1757 = *(i8*)(intptr_t)v1756; + i8 v1758 = v1757+(+14); + *(i1*)(intptr_t)v1758 = v1755; - ((void(*)(void))(intptr_t)v1755)(); +} + void f115_I_b16(void); + void f64_FindSubr(void); + void f114_I_b8(void); + void f117_I_bsize(void); + void f114_I_b8(void); + void f117_I_bsize(void); + +// ReadMid4 workspace at ws+4088 length ws+24 +void f125_ReadMid4(void) { + + i8 v1759 = (i8)(intptr_t)(f115_I_b16); - i1 v1756 = *(i1*)(intptr_t)(ws+4152); - i8 v1757 = (i8)(intptr_t)(ws+4104); - *(i1*)(intptr_t)v1757 = v1756; + ((void(*)(void))(intptr_t)v1759)(); - i8 v1758 = (i8)(intptr_t)(ws+4104); - i1 v1759 = *(i1*)(intptr_t)v1758; - i8 v1760 = (i8)(intptr_t)(ws+4080); - i8 v1761 = *(i8*)(intptr_t)v1760; - i8 v1762 = v1761+(+10); - *(i1*)(intptr_t)v1762 = v1759; + i2 v1760 = *(i2*)(intptr_t)(ws+4136); + i8 v1761 = (i8)(intptr_t)(ws+4088); + *(i2*)(intptr_t)v1761 = v1760; - i8 v1763 = (i8)(intptr_t)(f118_I_bsize); + i8 v1762 = (i8)(intptr_t)(ws+4088); + i2 v1763 = *(i2*)(intptr_t)v1762; + *(i2*)(intptr_t)(ws+4256) = v1763; + i8 v1764 = (i8)(intptr_t)(f64_FindSubr); - ((void(*)(void))(intptr_t)v1763)(); + ((void(*)(void))(intptr_t)v1764)(); - i2 v1764 = *(i2*)(intptr_t)(ws+4128); - i8 v1765 = (i8)(intptr_t)(ws+4106); - *(i2*)(intptr_t)v1765 = v1764; + i8 v1765 = *(i8*)(intptr_t)(ws+4264); + i8 v1766 = (i8)(intptr_t)(ws+4096); + *(i8*)(intptr_t)v1766 = v1765; - i8 v1766 = (i8)(intptr_t)(ws+4106); - i2 v1767 = *(i2*)(intptr_t)v1766; - i8 v1768 = (i8)(intptr_t)(ws+4080); - i8 v1769 = *(i8*)(intptr_t)v1768; - i8 v1770 = v1769+(+12); - *(i2*)(intptr_t)v1770 = v1767; + i8 v1767 = (i8)(intptr_t)(ws+4096); + i8 v1768 = *(i8*)(intptr_t)v1767; + i8 v1769 = (i8)(intptr_t)(ws+4080); + i8 v1770 = *(i8*)(intptr_t)v1769; + *(i8*)(intptr_t)v1770 = v1768; - i8 v1771 = (i8)(intptr_t)(f115_I_b8); + i8 v1771 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1771)(); i1 v1772 = *(i1*)(intptr_t)(ws+4152); - i8 v1773 = (i8)(intptr_t)(ws+4108); + i8 v1773 = (i8)(intptr_t)(ws+4104); *(i1*)(intptr_t)v1773 = v1772; - i8 v1774 = (i8)(intptr_t)(ws+4108); + i8 v1774 = (i8)(intptr_t)(ws+4104); i1 v1775 = *(i1*)(intptr_t)v1774; i8 v1776 = (i8)(intptr_t)(ws+4080); i8 v1777 = *(i8*)(intptr_t)v1776; - i8 v1778 = v1777+(+14); + i8 v1778 = v1777+(+10); *(i1*)(intptr_t)v1778 = v1775; -} - void f119_I_countedstring(void); - -// ReadMid7 workspace at ws+4088 length ws+8 -void f129_ReadMid7(void) { - - i8 v1779 = (i8)(intptr_t)(f119_I_countedstring); + i8 v1779 = (i8)(intptr_t)(f117_I_bsize); ((void(*)(void))(intptr_t)v1779)(); - i8 v1780 = *(i8*)(intptr_t)(ws+4112); - i8 v1781 = (i8)(intptr_t)(ws+4088); - *(i8*)(intptr_t)v1781 = v1780; + i2 v1780 = *(i2*)(intptr_t)(ws+4128); + i8 v1781 = (i8)(intptr_t)(ws+4106); + *(i2*)(intptr_t)v1781 = v1780; - i8 v1782 = (i8)(intptr_t)(ws+4088); - i8 v1783 = *(i8*)(intptr_t)v1782; + i8 v1782 = (i8)(intptr_t)(ws+4106); + i2 v1783 = *(i2*)(intptr_t)v1782; i8 v1784 = (i8)(intptr_t)(ws+4080); i8 v1785 = *(i8*)(intptr_t)v1784; - *(i8*)(intptr_t)v1785 = v1783; + i8 v1786 = v1785+(+12); + *(i2*)(intptr_t)v1786 = v1783; -} - void f116_I_b16(void); - void f65_FindSubr(void); - void f116_I_b16(void); - void f65_FindSubr(void); - void f115_I_b8(void); - void f118_I_bsize(void); - void f115_I_b8(void); - void f115_I_b8(void); - -// ReadMid8 workspace at ws+4088 length ws+38 -void f130_ReadMid8(void) { + i8 v1787 = (i8)(intptr_t)(f114_I_b8); - i8 v1786 = (i8)(intptr_t)(f116_I_b16); + ((void(*)(void))(intptr_t)v1787)(); - ((void(*)(void))(intptr_t)v1786)(); + i1 v1788 = *(i1*)(intptr_t)(ws+4152); + i8 v1789 = (i8)(intptr_t)(ws+4108); + *(i1*)(intptr_t)v1789 = v1788; - i2 v1787 = *(i2*)(intptr_t)(ws+4136); - i8 v1788 = (i8)(intptr_t)(ws+4088); - *(i2*)(intptr_t)v1788 = v1787; + i8 v1790 = (i8)(intptr_t)(ws+4108); + i1 v1791 = *(i1*)(intptr_t)v1790; + i8 v1792 = (i8)(intptr_t)(ws+4080); + i8 v1793 = *(i8*)(intptr_t)v1792; + i8 v1794 = v1793+(+14); + *(i1*)(intptr_t)v1794 = v1791; - i8 v1789 = (i8)(intptr_t)(ws+4088); - i2 v1790 = *(i2*)(intptr_t)v1789; - *(i2*)(intptr_t)(ws+4256) = v1790; - i8 v1791 = (i8)(intptr_t)(f65_FindSubr); + i8 v1795 = (i8)(intptr_t)(f117_I_bsize); - ((void(*)(void))(intptr_t)v1791)(); + ((void(*)(void))(intptr_t)v1795)(); - i8 v1792 = *(i8*)(intptr_t)(ws+4264); - i8 v1793 = (i8)(intptr_t)(ws+4096); - *(i8*)(intptr_t)v1793 = v1792; + i2 v1796 = *(i2*)(intptr_t)(ws+4128); + i8 v1797 = (i8)(intptr_t)(ws+4110); + *(i2*)(intptr_t)v1797 = v1796; - i8 v1794 = (i8)(intptr_t)(ws+4096); - i8 v1795 = *(i8*)(intptr_t)v1794; - i8 v1796 = (i8)(intptr_t)(ws+4080); - i8 v1797 = *(i8*)(intptr_t)v1796; - *(i8*)(intptr_t)v1797 = v1795; + i8 v1798 = (i8)(intptr_t)(ws+4110); + i2 v1799 = *(i2*)(intptr_t)v1798; + i8 v1800 = (i8)(intptr_t)(ws+4080); + i8 v1801 = *(i8*)(intptr_t)v1800; + i8 v1802 = v1801+(+16); + *(i2*)(intptr_t)v1802 = v1799; - i8 v1798 = (i8)(intptr_t)(f116_I_b16); - - ((void(*)(void))(intptr_t)v1798)(); +} + void f114_I_b8(void); - i2 v1799 = *(i2*)(intptr_t)(ws+4136); - i8 v1800 = (i8)(intptr_t)(ws+4104); - *(i2*)(intptr_t)v1800 = v1799; +// ReadMid5 workspace at ws+4088 length ws+1 +void f126_ReadMid5(void) { - i8 v1801 = (i8)(intptr_t)(ws+4104); - i2 v1802 = *(i2*)(intptr_t)v1801; - *(i2*)(intptr_t)(ws+4256) = v1802; - i8 v1803 = (i8)(intptr_t)(f65_FindSubr); + i8 v1803 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1803)(); - i8 v1804 = *(i8*)(intptr_t)(ws+4264); - i8 v1805 = (i8)(intptr_t)(ws+4112); - *(i8*)(intptr_t)v1805 = v1804; + i1 v1804 = *(i1*)(intptr_t)(ws+4152); + i8 v1805 = (i8)(intptr_t)(ws+4088); + *(i1*)(intptr_t)v1805 = v1804; - i8 v1806 = (i8)(intptr_t)(ws+4112); - i8 v1807 = *(i8*)(intptr_t)v1806; + i8 v1806 = (i8)(intptr_t)(ws+4088); + i1 v1807 = *(i1*)(intptr_t)v1806; i8 v1808 = (i8)(intptr_t)(ws+4080); i8 v1809 = *(i8*)(intptr_t)v1808; - i8 v1810 = v1809+(+8); - *(i8*)(intptr_t)v1810 = v1807; + *(i1*)(intptr_t)v1809 = v1807; - i8 v1811 = (i8)(intptr_t)(f115_I_b8); +} - ((void(*)(void))(intptr_t)v1811)(); +// ReadMid6 workspace at ws+4088 length ws+0 +void f127_ReadMid6(void) { - i1 v1812 = *(i1*)(intptr_t)(ws+4152); - i8 v1813 = (i8)(intptr_t)(ws+4120); - *(i1*)(intptr_t)v1813 = v1812; +} + void f116_I_b32(void); - i8 v1814 = (i8)(intptr_t)(ws+4120); - i1 v1815 = *(i1*)(intptr_t)v1814; - i8 v1816 = (i8)(intptr_t)(ws+4080); - i8 v1817 = *(i8*)(intptr_t)v1816; - i8 v1818 = v1817+(+18); - *(i1*)(intptr_t)v1818 = v1815; +// ReadMid7 workspace at ws+4088 length ws+4 +void f128_ReadMid7(void) { - i8 v1819 = (i8)(intptr_t)(f118_I_bsize); + i8 v1810 = (i8)(intptr_t)(f116_I_b32); - ((void(*)(void))(intptr_t)v1819)(); + ((void(*)(void))(intptr_t)v1810)(); - i2 v1820 = *(i2*)(intptr_t)(ws+4128); - i8 v1821 = (i8)(intptr_t)(ws+4122); - *(i2*)(intptr_t)v1821 = v1820; + i4 v1811 = *(i4*)(intptr_t)(ws+4096); + i8 v1812 = (i8)(intptr_t)(ws+4088); + *(i4*)(intptr_t)v1812 = v1811; - i8 v1822 = (i8)(intptr_t)(ws+4122); - i2 v1823 = *(i2*)(intptr_t)v1822; - i8 v1824 = (i8)(intptr_t)(ws+4080); - i8 v1825 = *(i8*)(intptr_t)v1824; - i8 v1826 = v1825+(+20); - *(i2*)(intptr_t)v1826 = v1823; + i8 v1813 = (i8)(intptr_t)(ws+4088); + i4 v1814 = *(i4*)(intptr_t)v1813; + i8 v1815 = (i8)(intptr_t)(ws+4080); + i8 v1816 = *(i8*)(intptr_t)v1815; + *(i4*)(intptr_t)v1816 = v1814; - i8 v1827 = (i8)(intptr_t)(f115_I_b8); +} + void f116_I_b32(void); + void f115_I_b16(void); - ((void(*)(void))(intptr_t)v1827)(); +// ReadMid8 workspace at ws+4088 length ws+6 +void f129_ReadMid8(void) { - i1 v1828 = *(i1*)(intptr_t)(ws+4152); - i8 v1829 = (i8)(intptr_t)(ws+4124); - *(i1*)(intptr_t)v1829 = v1828; + i8 v1817 = (i8)(intptr_t)(f116_I_b32); - i8 v1830 = (i8)(intptr_t)(ws+4124); - i1 v1831 = *(i1*)(intptr_t)v1830; - i8 v1832 = (i8)(intptr_t)(ws+4080); - i8 v1833 = *(i8*)(intptr_t)v1832; - i8 v1834 = v1833+(+22); - *(i1*)(intptr_t)v1834 = v1831; + ((void(*)(void))(intptr_t)v1817)(); - i8 v1835 = (i8)(intptr_t)(f115_I_b8); + i4 v1818 = *(i4*)(intptr_t)(ws+4096); + i8 v1819 = (i8)(intptr_t)(ws+4088); + *(i4*)(intptr_t)v1819 = v1818; - ((void(*)(void))(intptr_t)v1835)(); + i8 v1820 = (i8)(intptr_t)(ws+4088); + i4 v1821 = *(i4*)(intptr_t)v1820; + i8 v1822 = (i8)(intptr_t)(ws+4080); + i8 v1823 = *(i8*)(intptr_t)v1822; + *(i4*)(intptr_t)v1823 = v1821; - i1 v1836 = *(i1*)(intptr_t)(ws+4152); - i8 v1837 = (i8)(intptr_t)(ws+4125); - *(i1*)(intptr_t)v1837 = v1836; + i8 v1824 = (i8)(intptr_t)(f115_I_b16); - i8 v1838 = (i8)(intptr_t)(ws+4125); - i1 v1839 = *(i1*)(intptr_t)v1838; - i8 v1840 = (i8)(intptr_t)(ws+4080); - i8 v1841 = *(i8*)(intptr_t)v1840; - i8 v1842 = v1841+(+23); - *(i1*)(intptr_t)v1842 = v1839; + ((void(*)(void))(intptr_t)v1824)(); + + i2 v1825 = *(i2*)(intptr_t)(ws+4136); + i8 v1826 = (i8)(intptr_t)(ws+4092); + *(i2*)(intptr_t)v1826 = v1825; + + i8 v1827 = (i8)(intptr_t)(ws+4092); + i2 v1828 = *(i2*)(intptr_t)v1827; + i8 v1829 = (i8)(intptr_t)(ws+4080); + i8 v1830 = *(i8*)(intptr_t)v1829; + i8 v1831 = v1830+(+4); + *(i2*)(intptr_t)v1831 = v1828; } - void f116_I_b16(void); - void f65_FindSubr(void); + void f115_I_b16(void); + void f115_I_b16(void); + void f115_I_b16(void); + void f114_I_b8(void); -// ReadMid9 workspace at ws+4088 length ws+16 -void f131_ReadMid9(void) { +// ReadMid9 workspace at ws+4088 length ws+7 +void f130_ReadMid9(void) { - i8 v1843 = (i8)(intptr_t)(f116_I_b16); + i8 v1832 = (i8)(intptr_t)(f115_I_b16); - ((void(*)(void))(intptr_t)v1843)(); + ((void(*)(void))(intptr_t)v1832)(); - i2 v1844 = *(i2*)(intptr_t)(ws+4136); - i8 v1845 = (i8)(intptr_t)(ws+4088); - *(i2*)(intptr_t)v1845 = v1844; + i2 v1833 = *(i2*)(intptr_t)(ws+4136); + i8 v1834 = (i8)(intptr_t)(ws+4088); + *(i2*)(intptr_t)v1834 = v1833; - i8 v1846 = (i8)(intptr_t)(ws+4088); - i2 v1847 = *(i2*)(intptr_t)v1846; - *(i2*)(intptr_t)(ws+4256) = v1847; - i8 v1848 = (i8)(intptr_t)(f65_FindSubr); + i8 v1835 = (i8)(intptr_t)(ws+4088); + i2 v1836 = *(i2*)(intptr_t)v1835; + i8 v1837 = (i8)(intptr_t)(ws+4080); + i8 v1838 = *(i8*)(intptr_t)v1837; + *(i2*)(intptr_t)v1838 = v1836; - ((void(*)(void))(intptr_t)v1848)(); + i8 v1839 = (i8)(intptr_t)(f115_I_b16); - i8 v1849 = *(i8*)(intptr_t)(ws+4264); - i8 v1850 = (i8)(intptr_t)(ws+4096); - *(i8*)(intptr_t)v1850 = v1849; + ((void(*)(void))(intptr_t)v1839)(); - i8 v1851 = (i8)(intptr_t)(ws+4096); - i8 v1852 = *(i8*)(intptr_t)v1851; - i8 v1853 = (i8)(intptr_t)(ws+4080); - i8 v1854 = *(i8*)(intptr_t)v1853; - *(i8*)(intptr_t)v1854 = v1852; + i2 v1840 = *(i2*)(intptr_t)(ws+4136); + i8 v1841 = (i8)(intptr_t)(ws+4090); + *(i2*)(intptr_t)v1841 = v1840; -} - void f117_I_b32(void); - void f116_I_b16(void); + i8 v1842 = (i8)(intptr_t)(ws+4090); + i2 v1843 = *(i2*)(intptr_t)v1842; + i8 v1844 = (i8)(intptr_t)(ws+4080); + i8 v1845 = *(i8*)(intptr_t)v1844; + i8 v1846 = v1845+(+2); + *(i2*)(intptr_t)v1846 = v1843; + + i8 v1847 = (i8)(intptr_t)(f115_I_b16); + + ((void(*)(void))(intptr_t)v1847)(); + + i2 v1848 = *(i2*)(intptr_t)(ws+4136); + i8 v1849 = (i8)(intptr_t)(ws+4092); + *(i2*)(intptr_t)v1849 = v1848; -// ReadMid10 workspace at ws+4088 length ws+6 -void f132_ReadMid10(void) { + i8 v1850 = (i8)(intptr_t)(ws+4092); + i2 v1851 = *(i2*)(intptr_t)v1850; + i8 v1852 = (i8)(intptr_t)(ws+4080); + i8 v1853 = *(i8*)(intptr_t)v1852; + i8 v1854 = v1853+(+4); + *(i2*)(intptr_t)v1854 = v1851; - i8 v1855 = (i8)(intptr_t)(f117_I_b32); + i8 v1855 = (i8)(intptr_t)(f114_I_b8); ((void(*)(void))(intptr_t)v1855)(); - i4 v1856 = *(i4*)(intptr_t)(ws+4096); - i8 v1857 = (i8)(intptr_t)(ws+4088); - *(i4*)(intptr_t)v1857 = v1856; + i1 v1856 = *(i1*)(intptr_t)(ws+4152); + i8 v1857 = (i8)(intptr_t)(ws+4094); + *(i1*)(intptr_t)v1857 = v1856; - i8 v1858 = (i8)(intptr_t)(ws+4088); - i4 v1859 = *(i4*)(intptr_t)v1858; + i8 v1858 = (i8)(intptr_t)(ws+4094); + i1 v1859 = *(i1*)(intptr_t)v1858; i8 v1860 = (i8)(intptr_t)(ws+4080); i8 v1861 = *(i8*)(intptr_t)v1860; - *(i4*)(intptr_t)v1861 = v1859; + i8 v1862 = v1861+(+6); + *(i1*)(intptr_t)v1862 = v1859; - i8 v1862 = (i8)(intptr_t)(f116_I_b16); +} + void f115_I_b16(void); + +// ReadMid10 workspace at ws+4088 length ws+2 +void f131_ReadMid10(void) { + + i8 v1863 = (i8)(intptr_t)(f115_I_b16); - ((void(*)(void))(intptr_t)v1862)(); + ((void(*)(void))(intptr_t)v1863)(); - i2 v1863 = *(i2*)(intptr_t)(ws+4136); - i8 v1864 = (i8)(intptr_t)(ws+4092); - *(i2*)(intptr_t)v1864 = v1863; + i2 v1864 = *(i2*)(intptr_t)(ws+4136); + i8 v1865 = (i8)(intptr_t)(ws+4088); + *(i2*)(intptr_t)v1865 = v1864; - i8 v1865 = (i8)(intptr_t)(ws+4092); - i2 v1866 = *(i2*)(intptr_t)v1865; - i8 v1867 = (i8)(intptr_t)(ws+4080); - i8 v1868 = *(i8*)(intptr_t)v1867; - i8 v1869 = v1868+(+4); - *(i2*)(intptr_t)v1869 = v1866; + i8 v1866 = (i8)(intptr_t)(ws+4088); + i2 v1867 = *(i2*)(intptr_t)v1866; + i8 v1868 = (i8)(intptr_t)(ws+4080); + i8 v1869 = *(i8*)(intptr_t)v1868; + *(i2*)(intptr_t)v1869 = v1867; } - void f122_ReadMid0(void); - void f123_ReadMid1(void); - void f124_ReadMid2(void); - void f125_ReadMid3(void); - void f126_ReadMid4(void); - void f127_ReadMid5(void); - void f128_ReadMid6(void); - void f129_ReadMid7(void); - void f130_ReadMid8(void); - void f131_ReadMid9(void); - void f132_ReadMid10(void); -static data f3___main_s016f[] = { + void f121_ReadMid0(void); + void f122_ReadMid1(void); + void f123_ReadMid2(void); + void f124_ReadMid3(void); + void f125_ReadMid4(void); + void f126_ReadMid5(void); + void f127_ReadMid6(void); + void f128_ReadMid7(void); + void f129_ReadMid8(void); + void f130_ReadMid9(void); + void f131_ReadMid10(void); +static data f2___main_s016f[] = { - { .ptr = (void*)f122_ReadMid0 }, + { .ptr = (void*)f121_ReadMid0 }, - { .ptr = (void*)f123_ReadMid1 }, + { .ptr = (void*)f122_ReadMid1 }, - { .ptr = (void*)f124_ReadMid2 }, + { .ptr = (void*)f123_ReadMid2 }, - { .ptr = (void*)f125_ReadMid3 }, + { .ptr = (void*)f124_ReadMid3 }, - { .ptr = (void*)f126_ReadMid4 }, + { .ptr = (void*)f125_ReadMid4 }, - { .ptr = (void*)f127_ReadMid5 }, + { .ptr = (void*)f126_ReadMid5 }, - { .ptr = (void*)f128_ReadMid6 }, + { .ptr = (void*)f127_ReadMid6 }, - { .ptr = (void*)f129_ReadMid7 }, + { .ptr = (void*)f128_ReadMid7 }, - { .ptr = (void*)f130_ReadMid8 }, + { .ptr = (void*)f129_ReadMid8 }, - { .ptr = (void*)f131_ReadMid9 }, + { .ptr = (void*)f130_ReadMid9 }, - { .ptr = (void*)f132_ReadMid10 }, + { .ptr = (void*)f131_ReadMid10 }, }; -static data f3___main_s0170[] = { +static data f2___main_s0170[] = { @@ -4348,7 +4348,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x09,0x09,0x06,0x01,0x01}}, + { .i1 = { 0x06,0x06,0x06,0x00,0x00,0x03,0x07,0x07}}, @@ -4357,7 +4357,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x01,0x01,0x01,0x07,0x05,0x09,0x00,0x00}}, + { .i1 = { 0x07,0x07,0x07,0x01,0x04,0x00,0x06,0x06}}, @@ -4366,7 +4366,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x07,0x06,0x09,0x01,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x01,0x03,0x00,0x07,0x06,0x06}}, @@ -4375,7 +4375,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x03,0x03,0x00,0x09,0x08,0x08,0x08}}, + { .i1 = { 0x06,0x0a,0x0a,0x06,0x00,0x02,0x02,0x02}}, @@ -4384,7 +4384,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x01}}, + { .i1 = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x07}}, @@ -4393,7 +4393,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x07,0x05,0x09,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x01,0x04,0x00,0x06,0x06,0x06,0x06,0x06}}, @@ -4402,7 +4402,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x02}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x09,0x09,0x09}}, @@ -4411,7 +4411,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02}}, + { .i1 = { 0x09,0x09,0x09,0x09,0x09,0x09,0x09,0x09}}, @@ -4420,7 +4420,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00}}, + { .i1 = { 0x09,0x09,0x09,0x09,0x09,0x09,0x06,0x06}}, @@ -4429,7 +4429,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x0a,0x0a,0x0a,0x0a,0x0a}}, + { .i1 = { 0x06,0x06,0x06,0x08,0x08,0x08,0x08,0x08}}, @@ -4438,7 +4438,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x05,0x05,0x05}}, @@ -4447,7 +4447,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}}, + { .i1 = { 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05}}, @@ -4456,7 +4456,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x04}}, + { .i1 = { 0x05,0x05,0x05,0x05,0x05,0x05,0x05,0x05}}, @@ -4465,7 +4465,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x05,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4474,7 +4474,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4483,7 +4483,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4492,7 +4492,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4501,7 +4501,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4510,7 +4510,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4519,7 +4519,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4528,7 +4528,7 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, @@ -4537,15 +4537,15 @@ static data f3___main_s0170[] = { - { .i1 = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06,0x06,0x06,0x06,0x06}}, - { .i1 = { 0x00,0x00,0x00,0x00}}, + { .i1 = { 0x06,0x06,0x06,0x06}}, }; -static data f3___main_s0171[] = { +static data f2___main_s0171[] = { @@ -4751,11 +4751,11 @@ static data f3___main_s0171[] = { { .i1 = { 0x02,0x02,0x02,0x02}}, }; - void f23_MemZero(void); - void f23_MemZero(void); + void f22_MemZero(void); + void f22_MemZero(void); // AllocSubrId workspace at ws+4096 length ws+2 -void f146_AllocSubrId(void) { +void f145_AllocSubrId(void) { i8 v2318 = (i8)(intptr_t)(ws+50); i2 v2319 = *(i2*)(intptr_t)v2318; @@ -4769,18 +4769,18 @@ void f146_AllocSubrId(void) { *(i2*)(intptr_t)v2324 = v2323; } - void f7_MemSet(void); - void f70_InternalAlloc(void); + void f6_MemSet(void); + void f69_InternalAlloc(void); // AllocNewInstruction workspace at ws+4112 length ws+16 -void f147_AllocNewInstruction(void) { +void f146_AllocNewInstruction(void) { i8 v2327 = (i8)(intptr_t)(ws+3696); i8 v2328 = *(i8*)(intptr_t)v2327; i8 v2329 = (i8)+0; - if (v2328==v2329) goto c02_0215; else goto c02_0214; + if (v2328==v2329) goto c01_0215; else goto c01_0214; -c02_0214:; +c01_0214:; i8 v2330 = (i8)(intptr_t)(ws+3696); i8 v2331 = *(i8*)(intptr_t)v2330; @@ -4800,17 +4800,17 @@ c02_0214:; *(i1*)(intptr_t)(ws+4248) = v2339; i8 v2340 = (i8)+87; *(i8*)(intptr_t)(ws+4256) = v2340; - i8 v2341 = (i8)(intptr_t)(f7_MemSet); + i8 v2341 = (i8)(intptr_t)(f6_MemSet); ((void(*)(void))(intptr_t)v2341)(); - goto c02_0211; + goto c01_0211; -c02_0215:; +c01_0215:; i8 v2342 = (i8)+87; *(i8*)(intptr_t)(ws+4240) = v2342; - i8 v2343 = (i8)(intptr_t)(f70_InternalAlloc); + i8 v2343 = (i8)(intptr_t)(f69_InternalAlloc); ((void(*)(void))(intptr_t)v2343)(); @@ -4823,12 +4823,12 @@ c02_0215:; i8 v2348 = (i8)(intptr_t)(ws+4112); *(i8*)(intptr_t)v2348 = v2347; -c02_0211:; +c01_0211:; } // FreeInstruction workspace at ws+4120 length ws+8 -void f148_FreeInstruction(void) { +void f147_FreeInstruction(void) { i8 v2349 = (i8)(intptr_t)(ws+3696); i8 v2350 = *(i8*)(intptr_t)v2349; @@ -4842,19 +4842,19 @@ void f148_FreeInstruction(void) { *(i8*)(intptr_t)v2355 = v2354; } - void f34_Free(void); + void f33_Free(void); // PurgeAllFreeInstructions workspace at ws+4272 length ws+8 -void f72_PurgeAllFreeInstructions(void) { +void f71_PurgeAllFreeInstructions(void) { -c02_0216:; +c01_0216:; i8 v2356 = (i8)(intptr_t)(ws+3696); i8 v2357 = *(i8*)(intptr_t)v2356; i8 v2358 = (i8)+0; - if (v2357==v2358) goto c02_021b; else goto c02_021a; + if (v2357==v2358) goto c01_021b; else goto c01_021a; -c02_021a:; +c01_021a:; i8 v2359 = (i8)(intptr_t)(ws+3696); i8 v2360 = *(i8*)(intptr_t)v2359; @@ -4870,35 +4870,35 @@ c02_021a:; i8 v2366 = (i8)(intptr_t)(ws+4272); i8 v2367 = *(i8*)(intptr_t)v2366; *(i8*)(intptr_t)(ws+4280) = v2367; - i8 v2368 = (i8)(intptr_t)(f34_Free); + i8 v2368 = (i8)(intptr_t)(f33_Free); ((void(*)(void))(intptr_t)v2368)(); - goto c02_0216; + goto c01_0216; -c02_021b:; +c01_021b:; } // FindConflictingRegisters workspace at ws+4152 length ws+16 -void f149_FindConflictingRegisters(void) { +void f148_FindConflictingRegisters(void) { i1 v2369 = (i1)+0; i8 v2370 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v2370 = v2369; - i8 v2371 = (i8)(intptr_t)((i1*)f3___main_s00ff); + i8 v2371 = (i8)(intptr_t)((i1*)f2___main_s00ff); i8 v2372 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)v2372 = v2371; -c02_021c:; +c01_021c:; i8 v2373 = (i8)(intptr_t)(ws+4160); i8 v2374 = *(i8*)(intptr_t)v2373; - i8 v2375 = (i8)(intptr_t)((i1*)f3___main_s00ff+80); - if (v2374==v2375) goto c02_0221; else goto c02_0220; + i8 v2375 = (i8)(intptr_t)((i1*)f2___main_s00ff+80); + if (v2374==v2375) goto c01_0221; else goto c01_0220; -c02_0220:; +c01_0220:; i8 v2376 = (i8)(intptr_t)(ws+4160); i8 v2377 = *(i8*)(intptr_t)v2376; @@ -4908,9 +4908,9 @@ c02_0220:; i1 v2381 = *(i1*)(intptr_t)v2380; i1 v2382 = v2379&v2381; i1 v2383 = (i1)+0; - if (v2382==v2383) goto c02_0226; else goto c02_0225; + if (v2382==v2383) goto c01_0226; else goto c01_0225; -c02_0225:; +c01_0225:; i8 v2384 = (i8)(intptr_t)(ws+4153); i1 v2385 = *(i1*)(intptr_t)v2384; @@ -4922,9 +4922,9 @@ c02_0225:; i8 v2391 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v2391 = v2390; -c02_0226:; +c01_0226:; -c02_0222:; +c01_0222:; i8 v2392 = (i8)(intptr_t)(ws+4160); i8 v2393 = *(i8*)(intptr_t)v2392; @@ -4932,31 +4932,31 @@ c02_0222:; i8 v2395 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)v2395 = v2394; - goto c02_021c; + goto c01_021c; -c02_0221:; +c01_0221:; } // FindCompatibleRegisters workspace at ws+4152 length ws+16 -void f150_FindCompatibleRegisters(void) { +void f149_FindCompatibleRegisters(void) { i1 v2396 = (i1)-1; i8 v2397 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v2397 = v2396; - i8 v2398 = (i8)(intptr_t)((i1*)f3___main_s00ff); + i8 v2398 = (i8)(intptr_t)((i1*)f2___main_s00ff); i8 v2399 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)v2399 = v2398; -c02_0227:; +c01_0227:; i8 v2400 = (i8)(intptr_t)(ws+4160); i8 v2401 = *(i8*)(intptr_t)v2400; - i8 v2402 = (i8)(intptr_t)((i1*)f3___main_s00ff+80); - if (v2401==v2402) goto c02_022c; else goto c02_022b; + i8 v2402 = (i8)(intptr_t)((i1*)f2___main_s00ff+80); + if (v2401==v2402) goto c01_022c; else goto c01_022b; -c02_022b:; +c01_022b:; i8 v2403 = (i8)(intptr_t)(ws+4160); i8 v2404 = *(i8*)(intptr_t)v2403; @@ -4966,9 +4966,9 @@ c02_022b:; i1 v2408 = *(i1*)(intptr_t)v2407; i1 v2409 = v2406&v2408; i1 v2410 = (i1)+0; - if (v2409==v2410) goto c02_0231; else goto c02_0230; + if (v2409==v2410) goto c01_0231; else goto c01_0230; -c02_0230:; +c01_0230:; i8 v2411 = (i8)(intptr_t)(ws+4153); i1 v2412 = *(i1*)(intptr_t)v2411; @@ -4980,9 +4980,9 @@ c02_0230:; i8 v2418 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v2418 = v2417; -c02_0231:; +c01_0231:; -c02_022d:; +c01_022d:; i8 v2419 = (i8)(intptr_t)(ws+4160); i8 v2420 = *(i8*)(intptr_t)v2419; @@ -4990,27 +4990,27 @@ c02_022d:; i8 v2422 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)v2422 = v2421; - goto c02_0227; + goto c01_0227; -c02_022c:; +c01_022c:; } // FindFirst workspace at ws+4216 length ws+2 -void f151_FindFirst(void) { +void f150_FindFirst(void) { i1 v2423 = (i1)+1; i8 v2424 = (i8)(intptr_t)(ws+4217); *(i1*)(intptr_t)v2424 = v2423; -c02_0232:; +c01_0232:; i8 v2425 = (i8)(intptr_t)(ws+4217); i1 v2426 = *(i1*)(intptr_t)v2425; i1 v2427 = (i1)+0; - if (v2426==v2427) goto c02_0237; else goto c02_0236; + if (v2426==v2427) goto c01_0237; else goto c01_0236; -c02_0236:; +c01_0236:; i8 v2428 = (i8)(intptr_t)(ws+4216); i1 v2429 = *(i1*)(intptr_t)v2428; @@ -5018,15 +5018,15 @@ c02_0236:; i1 v2431 = *(i1*)(intptr_t)v2430; i1 v2432 = v2429&v2431; i1 v2433 = (i1)+0; - if (v2432==v2433) goto c02_023c; else goto c02_023b; + if (v2432==v2433) goto c01_023c; else goto c01_023b; -c02_023b:; +c01_023b:; return; -c02_023c:; +c01_023c:; -c02_0238:; +c01_0238:; i8 v2434 = (i8)(intptr_t)(ws+4217); i1 v2435 = *(i1*)(intptr_t)v2434; @@ -5035,86 +5035,86 @@ c02_0238:; i8 v2438 = (i8)(intptr_t)(ws+4217); *(i1*)(intptr_t)v2438 = v2437; - goto c02_0232; + goto c01_0232; -c02_0237:; +c01_0237:; i1 v2439 = (i1)+0; i8 v2440 = (i8)(intptr_t)(ws+4217); *(i1*)(intptr_t)v2440 = v2439; } - void f106_EmitterOpenStream(void); -const i1 c02_s00c2[] = { 0x09,0x76,0x6f,0x69,0x64,0x20,0 }; - void f92_E(void); - void f104_E_subref(void); -const i1 c02_s00c3[] = { 0x28,0x76,0x6f,0x69,0x64,0x29,0x3b,0x0a,0 }; - void f92_E(void); - void f107_EmitterCloseStream(void); - void f104_E_subref(void); + void f105_EmitterOpenStream(void); +const i1 c01_s00c2[] = { 0x09,0x76,0x6f,0x69,0x64,0x20,0 }; + void f91_E(void); + void f103_E_subref(void); +const i1 c01_s00c3[] = { 0x28,0x76,0x6f,0x69,0x64,0x29,0x3b,0x0a,0 }; + void f91_E(void); + void f106_EmitterCloseStream(void); + void f103_E_subref(void); // E_subref_sig workspace at ws+4232 length ws+8 -void f155_E_subref_sig(void) { +void f154_E_subref_sig(void) { i8 v2493 = (i8)(intptr_t)(ws+40); i8 v2494 = *(i8*)(intptr_t)v2493; *(i8*)(intptr_t)(ws+4248) = v2494; - i8 v2495 = (i8)(intptr_t)(f106_EmitterOpenStream); + i8 v2495 = (i8)(intptr_t)(f105_EmitterOpenStream); ((void(*)(void))(intptr_t)v2495)(); - i8 v2496 = (i8)(intptr_t)c02_s00c2; + i8 v2496 = (i8)(intptr_t)c01_s00c2; *(i8*)(intptr_t)(ws+4320) = v2496; - i8 v2497 = (i8)(intptr_t)(f92_E); + i8 v2497 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2497)(); i8 v2498 = (i8)(intptr_t)(ws+4232); i8 v2499 = *(i8*)(intptr_t)v2498; *(i8*)(intptr_t)(ws+4240) = v2499; - i8 v2500 = (i8)(intptr_t)(f104_E_subref); + i8 v2500 = (i8)(intptr_t)(f103_E_subref); ((void(*)(void))(intptr_t)v2500)(); - i8 v2501 = (i8)(intptr_t)c02_s00c3; + i8 v2501 = (i8)(intptr_t)c01_s00c3; *(i8*)(intptr_t)(ws+4320) = v2501; - i8 v2502 = (i8)(intptr_t)(f92_E); + i8 v2502 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2502)(); - i8 v2503 = (i8)(intptr_t)(f107_EmitterCloseStream); + i8 v2503 = (i8)(intptr_t)(f106_EmitterCloseStream); ((void(*)(void))(intptr_t)v2503)(); i8 v2504 = (i8)(intptr_t)(ws+4232); i8 v2505 = *(i8*)(intptr_t)v2504; *(i8*)(intptr_t)(ws+4240) = v2505; - i8 v2506 = (i8)(intptr_t)(f104_E_subref); + i8 v2506 = (i8)(intptr_t)(f103_E_subref); ((void(*)(void))(intptr_t)v2506)(); } -const i1 c02_s00c4[] = { 0x28,0x69,0x31,0x2a,0x29,0 }; - void f92_E(void); - void f105_E_wsref(void); - void f97_E_i16(void); - void f105_E_wsref(void); +const i1 c01_s00c4[] = { 0x28,0x69,0x31,0x2a,0x29,0 }; + void f91_E(void); + void f104_E_wsref(void); + void f96_E_i16(void); + void f104_E_wsref(void); // E_symref workspace at ws+4248 length ws+10 -void f156_E_symref(void) { +void f155_E_symref(void) { i8 v2507 = (i8)(intptr_t)(ws+4248); i8 v2508 = *(i8*)(intptr_t)v2507; i8 v2509 = v2508+(+10); i1 v2510 = *(i1*)(intptr_t)v2509; i1 v2511 = (i1)+255; - if (v2510==v2511) goto c02_0251; else goto c02_0252; + if (v2510==v2511) goto c01_0251; else goto c01_0252; -c02_0251:; +c01_0251:; - i8 v2512 = (i8)(intptr_t)c02_s00c4; + i8 v2512 = (i8)(intptr_t)c01_s00c4; *(i8*)(intptr_t)(ws+4320) = v2512; - i8 v2513 = (i8)(intptr_t)(f92_E); + i8 v2513 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2513)(); @@ -5134,31 +5134,31 @@ c02_0251:; i8 v2525 = v2524+(+12); i2 v2526 = *(i2*)(intptr_t)v2525; *(i2*)(intptr_t)(ws+4268) = v2526; - i8 v2527 = (i8)(intptr_t)(f105_E_wsref); + i8 v2527 = (i8)(intptr_t)(f104_E_wsref); ((void(*)(void))(intptr_t)v2527)(); i8 v2528 = (i8)(intptr_t)(ws+4256); i2 v2529 = *(i2*)(intptr_t)v2528; i2 v2530 = (i2)+0; - if (v2529==v2530) goto c02_0257; else goto c02_0256; + if (v2529==v2530) goto c01_0257; else goto c01_0256; -c02_0256:; +c01_0256:; i8 v2531 = (i8)(intptr_t)(ws+4256); i2 v2532 = *(i2*)(intptr_t)v2531; *(i2*)(intptr_t)(ws+4264) = v2532; - i8 v2533 = (i8)(intptr_t)(f97_E_i16); + i8 v2533 = (i8)(intptr_t)(f96_E_i16); ((void(*)(void))(intptr_t)v2533)(); -c02_0257:; +c01_0257:; -c02_0253:; +c01_0253:; - goto c02_024e; + goto c01_024e; -c02_0252:; +c01_0252:; i8 v2534 = (i8)(intptr_t)(ws+4248); i8 v2535 = *(i8*)(intptr_t)v2534; @@ -5179,50 +5179,50 @@ c02_0252:; i2 v2548 = *(i2*)(intptr_t)v2547; i2 v2549 = v2546+v2548; *(i2*)(intptr_t)(ws+4268) = v2549; - i8 v2550 = (i8)(intptr_t)(f105_E_wsref); + i8 v2550 = (i8)(intptr_t)(f104_E_wsref); ((void(*)(void))(intptr_t)v2550)(); -c02_024e:; +c01_024e:; } // ArchEndInstruction workspace at ws+4120 length ws+0 -void f157_ArchEndInstruction(void) { +void f156_ArchEndInstruction(void) { } - void f89_E_nl(void); + void f88_E_nl(void); // ArchEndGroup workspace at ws+4112 length ws+0 -void f158_ArchEndGroup(void) { +void f157_ArchEndGroup(void) { - i8 v2551 = (i8)(intptr_t)(f89_E_nl); + i8 v2551 = (i8)(intptr_t)(f88_E_nl); ((void(*)(void))(intptr_t)v2551)(); } -const i1 c02_s00c5[] = { 0x76,0x61,0x72,0x73,0x74,0x61,0x63,0x6b,0x20,0x6f,0x76,0x65,0x72,0x66,0x6c,0x6f,0x77,0 }; - void f68_SimpleError(void); +const i1 c01_s00c5[] = { 0x76,0x61,0x72,0x73,0x74,0x61,0x63,0x6b,0x20,0x6f,0x76,0x65,0x72,0x66,0x6c,0x6f,0x77,0 }; + void f67_SimpleError(void); // PushVid workspace at ws+4272 length ws+2 -void f159_PushVid(void) { +void f158_PushVid(void) { i8 v2552 = (i8)(intptr_t)(ws+3832); i1 v2553 = *(i1*)(intptr_t)v2552; i1 v2554 = (i1)+64; - if (v2553==v2554) goto c02_025b; else goto c02_025c; + if (v2553==v2554) goto c01_025b; else goto c01_025c; -c02_025b:; +c01_025b:; - i8 v2555 = (i8)(intptr_t)c02_s00c5; + i8 v2555 = (i8)(intptr_t)c01_s00c5; *(i8*)(intptr_t)(ws+4280) = v2555; - i8 v2556 = (i8)(intptr_t)(f68_SimpleError); + i8 v2556 = (i8)(intptr_t)(f67_SimpleError); ((void(*)(void))(intptr_t)v2556)(); -c02_025c:; +c01_025c:; -c02_0258:; +c01_0258:; i8 v2557 = (i8)(intptr_t)(ws+4272); i2 v2558 = *(i2*)(intptr_t)v2557; @@ -5242,10 +5242,10 @@ c02_0258:; *(i1*)(intptr_t)v2569 = v2568; } - void f159_PushVid(void); + void f158_PushVid(void); // Push workspace at ws+4264 length ws+2 -void f160_Push(void) { +void f159_Push(void) { i8 v2570 = (i8)(intptr_t)(ws+3834); i2 v2571 = *(i2*)(intptr_t)v2570; @@ -5261,41 +5261,41 @@ void f160_Push(void) { i8 v2577 = (i8)(intptr_t)(ws+4264); i2 v2578 = *(i2*)(intptr_t)v2577; *(i2*)(intptr_t)(ws+4272) = v2578; - i8 v2579 = (i8)(intptr_t)(f159_PushVid); + i8 v2579 = (i8)(intptr_t)(f158_PushVid); ((void(*)(void))(intptr_t)v2579)(); } -const i1 c02_s00c6[] = { 0x76,0x61,0x72,0x73,0x74,0x61,0x63,0x6b,0x20,0x75,0x6e,0x64,0x65,0x72,0x66,0x6c,0x6f,0x77,0 }; - void f68_SimpleError(void); +const i1 c01_s00c6[] = { 0x76,0x61,0x72,0x73,0x74,0x61,0x63,0x6b,0x20,0x75,0x6e,0x64,0x65,0x72,0x66,0x6c,0x6f,0x77,0 }; + void f67_SimpleError(void); // CheckVarstackUnderflow workspace at ws+4272 length ws+0 -void f161_CheckVarstackUnderflow(void) { +void f160_CheckVarstackUnderflow(void) { i8 v2580 = (i8)(intptr_t)(ws+3832); i1 v2581 = *(i1*)(intptr_t)v2580; i1 v2582 = (i1)+0; - if (v2581==v2582) goto c02_0260; else goto c02_0261; + if (v2581==v2582) goto c01_0260; else goto c01_0261; -c02_0260:; +c01_0260:; - i8 v2583 = (i8)(intptr_t)c02_s00c6; + i8 v2583 = (i8)(intptr_t)c01_s00c6; *(i8*)(intptr_t)(ws+4280) = v2583; - i8 v2584 = (i8)(intptr_t)(f68_SimpleError); + i8 v2584 = (i8)(intptr_t)(f67_SimpleError); ((void(*)(void))(intptr_t)v2584)(); -c02_0261:; +c01_0261:; -c02_025d:; +c01_025d:; } - void f161_CheckVarstackUnderflow(void); + void f160_CheckVarstackUnderflow(void); // Pop workspace at ws+4264 length ws+2 -void f162_Pop(void) { +void f161_Pop(void) { - i8 v2585 = (i8)(intptr_t)(f161_CheckVarstackUnderflow); + i8 v2585 = (i8)(intptr_t)(f160_CheckVarstackUnderflow); ((void(*)(void))(intptr_t)v2585)(); @@ -5319,24 +5319,24 @@ void f162_Pop(void) { } // ArchEmitMove workspace at ws+4152 length ws+2 -void f166_ArchEmitMove(void) { +void f165_ArchEmitMove(void) { } - void f65_FindSubr(void); - void f162_Pop(void); -const i1 c02_s00c8[] = { 0x0a,0x09,0x28,0x28,0x76,0x6f,0x69,0x64,0x28,0x2a,0x29,0x28,0x76,0x6f,0x69,0x64,0x29,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00c9[] = { 0x29,0x28,0x29,0x3b,0x0a,0 }; - void f92_E(void); + void f64_FindSubr(void); + void f161_Pop(void); +const i1 c01_s00c8[] = { 0x0a,0x09,0x28,0x28,0x76,0x6f,0x69,0x64,0x28,0x2a,0x29,0x28,0x76,0x6f,0x69,0x64,0x29,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00c9[] = { 0x29,0x28,0x29,0x3b,0x0a,0 }; + void f91_E(void); // Call workspace at ws+4224 length ws+28 -void f167_Call(void) { +void f166_Call(void) { i8 v2613 = (i8)(intptr_t)(ws+4224); i2 v2614 = *(i2*)(intptr_t)v2613; *(i2*)(intptr_t)(ws+4256) = v2614; - i8 v2615 = (i8)(intptr_t)(f65_FindSubr); + i8 v2615 = (i8)(intptr_t)(f64_FindSubr); ((void(*)(void))(intptr_t)v2615)(); @@ -5349,7 +5349,7 @@ void f167_Call(void) { i8 v2620 = (i8)(intptr_t)(ws+4240); *(i8*)(intptr_t)v2620 = v2619; - i8 v2621 = (i8)(intptr_t)(f162_Pop); + i8 v2621 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2621)(); @@ -5362,43 +5362,43 @@ void f167_Call(void) { i8 v2626 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v2626 = v2625; - i8 v2627 = (i8)(intptr_t)c02_s00c8; + i8 v2627 = (i8)(intptr_t)c01_s00c8; *(i8*)(intptr_t)(ws+4320) = v2627; - i8 v2628 = (i8)(intptr_t)(f92_E); + i8 v2628 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2628)(); i8 v2629 = (i8)(intptr_t)(ws+4250); i2 v2630 = *(i2*)(intptr_t)v2629; *(i2*)(intptr_t)(ws+4272) = v2630; - i8 v2631 = (i8)(intptr_t)(f94_E_u16); + i8 v2631 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2631)(); - i8 v2632 = (i8)(intptr_t)c02_s00c9; + i8 v2632 = (i8)(intptr_t)c01_s00c9; *(i8*)(intptr_t)(ws+4320) = v2632; - i8 v2633 = (i8)(intptr_t)(f92_E); + i8 v2633 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2633)(); } - void f162_Pop(void); -const i1 c02_s00ca[] = { 0x09,0x2a,0x28,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00cb[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; - void f92_E(void); - void f156_E_symref(void); -const i1 c02_s00cc[] = { 0x29,0x20,0x3d,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00cd[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); +const i1 c01_s00ca[] = { 0x09,0x2a,0x28,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00cb[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; + void f91_E(void); + void f155_E_symref(void); +const i1 c01_s00cc[] = { 0x29,0x20,0x3d,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00cd[] = { 0x3b,0x0a,0 }; + void f91_E(void); // PokeArg workspace at ws+4224 length ws+20 -void f168_PokeArg(void) { +void f167_PokeArg(void) { - i8 v2634 = (i8)(intptr_t)(f162_Pop); + i8 v2634 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2634)(); @@ -5411,22 +5411,22 @@ void f168_PokeArg(void) { i8 v2639 = (i8)(intptr_t)(ws+4242); *(i2*)(intptr_t)v2639 = v2638; - i8 v2640 = (i8)(intptr_t)c02_s00ca; + i8 v2640 = (i8)(intptr_t)c01_s00ca; *(i8*)(intptr_t)(ws+4320) = v2640; - i8 v2641 = (i8)(intptr_t)(f92_E); + i8 v2641 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2641)(); i8 v2642 = (i8)(intptr_t)(ws+4224); i1 v2643 = *(i1*)(intptr_t)v2642; *(i1*)(intptr_t)(ws+4264) = v2643; - i8 v2644 = (i8)(intptr_t)(f95_E_u8); + i8 v2644 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2644)(); - i8 v2645 = (i8)(intptr_t)c02_s00cb; + i8 v2645 = (i8)(intptr_t)c01_s00cb; *(i8*)(intptr_t)(ws+4320) = v2645; - i8 v2646 = (i8)(intptr_t)(f92_E); + i8 v2646 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2646)(); @@ -5435,50 +5435,50 @@ void f168_PokeArg(void) { *(i8*)(intptr_t)(ws+4248) = v2648; i2 v2649 = (i2)+0; *(i2*)(intptr_t)(ws+4256) = v2649; - i8 v2650 = (i8)(intptr_t)(f156_E_symref); + i8 v2650 = (i8)(intptr_t)(f155_E_symref); ((void(*)(void))(intptr_t)v2650)(); - i8 v2651 = (i8)(intptr_t)c02_s00cc; + i8 v2651 = (i8)(intptr_t)c01_s00cc; *(i8*)(intptr_t)(ws+4320) = v2651; - i8 v2652 = (i8)(intptr_t)(f92_E); + i8 v2652 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2652)(); i8 v2653 = (i8)(intptr_t)(ws+4242); i2 v2654 = *(i2*)(intptr_t)v2653; *(i2*)(intptr_t)(ws+4272) = v2654; - i8 v2655 = (i8)(intptr_t)(f94_E_u16); + i8 v2655 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2655)(); - i8 v2656 = (i8)(intptr_t)c02_s00cd; + i8 v2656 = (i8)(intptr_t)c01_s00cd; *(i8*)(intptr_t)(ws+4320) = v2656; - i8 v2657 = (i8)(intptr_t)(f92_E); + i8 v2657 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2657)(); } - void f160_Push(void); -const i1 c02_s00ce[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00cf[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00d0[] = { 0x20,0x3d,0x20,0x2a,0x28,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00d1[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; - void f92_E(void); - void f156_E_symref(void); -const i1 c02_s00d2[] = { 0x29,0x3b,0x0a,0 }; - void f92_E(void); + void f159_Push(void); +const i1 c01_s00ce[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00cf[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00d0[] = { 0x20,0x3d,0x20,0x2a,0x28,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00d1[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; + void f91_E(void); + void f155_E_symref(void); +const i1 c01_s00d2[] = { 0x29,0x3b,0x0a,0 }; + void f91_E(void); // PeekArg workspace at ws+4224 length ws+20 -void f169_PeekArg(void) { +void f168_PeekArg(void) { - i8 v2658 = (i8)(intptr_t)(f160_Push); + i8 v2658 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2658)(); @@ -5491,48 +5491,48 @@ void f169_PeekArg(void) { i8 v2663 = (i8)(intptr_t)(ws+4242); *(i2*)(intptr_t)v2663 = v2662; - i8 v2664 = (i8)(intptr_t)c02_s00ce; + i8 v2664 = (i8)(intptr_t)c01_s00ce; *(i8*)(intptr_t)(ws+4320) = v2664; - i8 v2665 = (i8)(intptr_t)(f92_E); + i8 v2665 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2665)(); i8 v2666 = (i8)(intptr_t)(ws+4224); i1 v2667 = *(i1*)(intptr_t)v2666; *(i1*)(intptr_t)(ws+4264) = v2667; - i8 v2668 = (i8)(intptr_t)(f95_E_u8); + i8 v2668 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2668)(); - i8 v2669 = (i8)(intptr_t)c02_s00cf; + i8 v2669 = (i8)(intptr_t)c01_s00cf; *(i8*)(intptr_t)(ws+4320) = v2669; - i8 v2670 = (i8)(intptr_t)(f92_E); + i8 v2670 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2670)(); i8 v2671 = (i8)(intptr_t)(ws+4242); i2 v2672 = *(i2*)(intptr_t)v2671; *(i2*)(intptr_t)(ws+4272) = v2672; - i8 v2673 = (i8)(intptr_t)(f94_E_u16); + i8 v2673 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2673)(); - i8 v2674 = (i8)(intptr_t)c02_s00d0; + i8 v2674 = (i8)(intptr_t)c01_s00d0; *(i8*)(intptr_t)(ws+4320) = v2674; - i8 v2675 = (i8)(intptr_t)(f92_E); + i8 v2675 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2675)(); i8 v2676 = (i8)(intptr_t)(ws+4224); i1 v2677 = *(i1*)(intptr_t)v2676; *(i1*)(intptr_t)(ws+4264) = v2677; - i8 v2678 = (i8)(intptr_t)(f95_E_u8); + i8 v2678 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2678)(); - i8 v2679 = (i8)(intptr_t)c02_s00d1; + i8 v2679 = (i8)(intptr_t)c01_s00d1; *(i8*)(intptr_t)(ws+4320) = v2679; - i8 v2680 = (i8)(intptr_t)(f92_E); + i8 v2680 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2680)(); @@ -5541,37 +5541,37 @@ void f169_PeekArg(void) { *(i8*)(intptr_t)(ws+4248) = v2682; i2 v2683 = (i2)+0; *(i2*)(intptr_t)(ws+4256) = v2683; - i8 v2684 = (i8)(intptr_t)(f156_E_symref); + i8 v2684 = (i8)(intptr_t)(f155_E_symref); ((void(*)(void))(intptr_t)v2684)(); - i8 v2685 = (i8)(intptr_t)c02_s00d2; + i8 v2685 = (i8)(intptr_t)c01_s00d2; *(i8*)(intptr_t)(ws+4320) = v2685; - i8 v2686 = (i8)(intptr_t)(f92_E); + i8 v2686 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2686)(); } - void f160_Push(void); -const i1 c02_s00d3[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00d4[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00d5[] = { 0x20,0x3d,0x20,0x28,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00d6[] = { 0x29,0 }; - void f92_E(void); - void f98_E_i32(void); -const i1 c02_s00d7[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f159_Push(void); +const i1 c01_s00d3[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00d4[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00d5[] = { 0x20,0x3d,0x20,0x28,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00d6[] = { 0x29,0 }; + void f91_E(void); + void f97_E_i32(void); +const i1 c01_s00d7[] = { 0x3b,0x0a,0 }; + void f91_E(void); // LoadConstant workspace at ws+4224 length ws+12 -void f170_LoadConstant(void) { +void f169_LoadConstant(void) { - i8 v2687 = (i8)(intptr_t)(f160_Push); + i8 v2687 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2687)(); @@ -5584,83 +5584,83 @@ void f170_LoadConstant(void) { i8 v2692 = (i8)(intptr_t)(ws+4234); *(i2*)(intptr_t)v2692 = v2691; - i8 v2693 = (i8)(intptr_t)c02_s00d3; + i8 v2693 = (i8)(intptr_t)c01_s00d3; *(i8*)(intptr_t)(ws+4320) = v2693; - i8 v2694 = (i8)(intptr_t)(f92_E); + i8 v2694 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2694)(); i8 v2695 = (i8)(intptr_t)(ws+4224); i1 v2696 = *(i1*)(intptr_t)v2695; *(i1*)(intptr_t)(ws+4264) = v2696; - i8 v2697 = (i8)(intptr_t)(f95_E_u8); + i8 v2697 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2697)(); - i8 v2698 = (i8)(intptr_t)c02_s00d4; + i8 v2698 = (i8)(intptr_t)c01_s00d4; *(i8*)(intptr_t)(ws+4320) = v2698; - i8 v2699 = (i8)(intptr_t)(f92_E); + i8 v2699 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2699)(); i8 v2700 = (i8)(intptr_t)(ws+4234); i2 v2701 = *(i2*)(intptr_t)v2700; *(i2*)(intptr_t)(ws+4272) = v2701; - i8 v2702 = (i8)(intptr_t)(f94_E_u16); + i8 v2702 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2702)(); - i8 v2703 = (i8)(intptr_t)c02_s00d5; + i8 v2703 = (i8)(intptr_t)c01_s00d5; *(i8*)(intptr_t)(ws+4320) = v2703; - i8 v2704 = (i8)(intptr_t)(f92_E); + i8 v2704 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2704)(); i8 v2705 = (i8)(intptr_t)(ws+4224); i1 v2706 = *(i1*)(intptr_t)v2705; *(i1*)(intptr_t)(ws+4264) = v2706; - i8 v2707 = (i8)(intptr_t)(f95_E_u8); + i8 v2707 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2707)(); - i8 v2708 = (i8)(intptr_t)c02_s00d6; + i8 v2708 = (i8)(intptr_t)c01_s00d6; *(i8*)(intptr_t)(ws+4320) = v2708; - i8 v2709 = (i8)(intptr_t)(f92_E); + i8 v2709 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2709)(); i8 v2710 = (i8)(intptr_t)(ws+4228); i4 v2711 = *(i4*)(intptr_t)v2710; *(i4*)(intptr_t)(ws+4256) = v2711; - i8 v2712 = (i8)(intptr_t)(f98_E_i32); + i8 v2712 = (i8)(intptr_t)(f97_E_i32); ((void(*)(void))(intptr_t)v2712)(); - i8 v2713 = (i8)(intptr_t)c02_s00d7; + i8 v2713 = (i8)(intptr_t)c01_s00d7; *(i8*)(intptr_t)(ws+4320) = v2713; - i8 v2714 = (i8)(intptr_t)(f92_E); + i8 v2714 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2714)(); } - void f162_Pop(void); - void f162_Pop(void); -const i1 c02_s00d8[] = { 0x09,0x2a,0x28,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00d9[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00da[] = { 0x20,0x3d,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00db[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f161_Pop(void); +const i1 c01_s00d8[] = { 0x09,0x2a,0x28,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00d9[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00da[] = { 0x20,0x3d,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00db[] = { 0x3b,0x0a,0 }; + void f91_E(void); // StoreVV workspace at ws+4224 length ws+10 -void f171_StoreVV(void) { +void f170_StoreVV(void) { - i8 v2715 = (i8)(intptr_t)(f162_Pop); + i8 v2715 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2715)(); @@ -5673,7 +5673,7 @@ void f171_StoreVV(void) { i8 v2720 = (i8)(intptr_t)(ws+4228); *(i2*)(intptr_t)v2720 = v2719; - i8 v2721 = (i8)(intptr_t)(f162_Pop); + i8 v2721 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2721)(); @@ -5686,73 +5686,73 @@ void f171_StoreVV(void) { i8 v2726 = (i8)(intptr_t)(ws+4232); *(i2*)(intptr_t)v2726 = v2725; - i8 v2727 = (i8)(intptr_t)c02_s00d8; + i8 v2727 = (i8)(intptr_t)c01_s00d8; *(i8*)(intptr_t)(ws+4320) = v2727; - i8 v2728 = (i8)(intptr_t)(f92_E); + i8 v2728 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2728)(); i8 v2729 = (i8)(intptr_t)(ws+4224); i1 v2730 = *(i1*)(intptr_t)v2729; *(i1*)(intptr_t)(ws+4264) = v2730; - i8 v2731 = (i8)(intptr_t)(f95_E_u8); + i8 v2731 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2731)(); - i8 v2732 = (i8)(intptr_t)c02_s00d9; + i8 v2732 = (i8)(intptr_t)c01_s00d9; *(i8*)(intptr_t)(ws+4320) = v2732; - i8 v2733 = (i8)(intptr_t)(f92_E); + i8 v2733 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2733)(); i8 v2734 = (i8)(intptr_t)(ws+4228); i2 v2735 = *(i2*)(intptr_t)v2734; *(i2*)(intptr_t)(ws+4272) = v2735; - i8 v2736 = (i8)(intptr_t)(f94_E_u16); + i8 v2736 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2736)(); - i8 v2737 = (i8)(intptr_t)c02_s00da; + i8 v2737 = (i8)(intptr_t)c01_s00da; *(i8*)(intptr_t)(ws+4320) = v2737; - i8 v2738 = (i8)(intptr_t)(f92_E); + i8 v2738 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2738)(); i8 v2739 = (i8)(intptr_t)(ws+4232); i2 v2740 = *(i2*)(intptr_t)v2739; *(i2*)(intptr_t)(ws+4272) = v2740; - i8 v2741 = (i8)(intptr_t)(f94_E_u16); + i8 v2741 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2741)(); - i8 v2742 = (i8)(intptr_t)c02_s00db; + i8 v2742 = (i8)(intptr_t)c01_s00db; *(i8*)(intptr_t)(ws+4320) = v2742; - i8 v2743 = (i8)(intptr_t)(f92_E); + i8 v2743 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2743)(); } - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00dc[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00dd[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00de[] = { 0x20,0x3d,0x20,0x2a,0x28,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00df[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00e0[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00dc[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00dd[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00de[] = { 0x20,0x3d,0x20,0x2a,0x28,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00df[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00e0[] = { 0x3b,0x0a,0 }; + void f91_E(void); // LoadVV workspace at ws+4224 length ws+10 -void f172_LoadVV(void) { +void f171_LoadVV(void) { - i8 v2744 = (i8)(intptr_t)(f162_Pop); + i8 v2744 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2744)(); @@ -5765,7 +5765,7 @@ void f172_LoadVV(void) { i8 v2749 = (i8)(intptr_t)(ws+4228); *(i2*)(intptr_t)v2749 = v2748; - i8 v2750 = (i8)(intptr_t)(f160_Push); + i8 v2750 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2750)(); @@ -5778,88 +5778,88 @@ void f172_LoadVV(void) { i8 v2755 = (i8)(intptr_t)(ws+4232); *(i2*)(intptr_t)v2755 = v2754; - i8 v2756 = (i8)(intptr_t)c02_s00dc; + i8 v2756 = (i8)(intptr_t)c01_s00dc; *(i8*)(intptr_t)(ws+4320) = v2756; - i8 v2757 = (i8)(intptr_t)(f92_E); + i8 v2757 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2757)(); i8 v2758 = (i8)(intptr_t)(ws+4224); i1 v2759 = *(i1*)(intptr_t)v2758; *(i1*)(intptr_t)(ws+4264) = v2759; - i8 v2760 = (i8)(intptr_t)(f95_E_u8); + i8 v2760 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2760)(); - i8 v2761 = (i8)(intptr_t)c02_s00dd; + i8 v2761 = (i8)(intptr_t)c01_s00dd; *(i8*)(intptr_t)(ws+4320) = v2761; - i8 v2762 = (i8)(intptr_t)(f92_E); + i8 v2762 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2762)(); i8 v2763 = (i8)(intptr_t)(ws+4232); i2 v2764 = *(i2*)(intptr_t)v2763; *(i2*)(intptr_t)(ws+4272) = v2764; - i8 v2765 = (i8)(intptr_t)(f94_E_u16); + i8 v2765 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2765)(); - i8 v2766 = (i8)(intptr_t)c02_s00de; + i8 v2766 = (i8)(intptr_t)c01_s00de; *(i8*)(intptr_t)(ws+4320) = v2766; - i8 v2767 = (i8)(intptr_t)(f92_E); + i8 v2767 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2767)(); i8 v2768 = (i8)(intptr_t)(ws+4224); i1 v2769 = *(i1*)(intptr_t)v2768; *(i1*)(intptr_t)(ws+4264) = v2769; - i8 v2770 = (i8)(intptr_t)(f95_E_u8); + i8 v2770 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2770)(); - i8 v2771 = (i8)(intptr_t)c02_s00df; + i8 v2771 = (i8)(intptr_t)c01_s00df; *(i8*)(intptr_t)(ws+4320) = v2771; - i8 v2772 = (i8)(intptr_t)(f92_E); + i8 v2772 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2772)(); i8 v2773 = (i8)(intptr_t)(ws+4228); i2 v2774 = *(i2*)(intptr_t)v2773; *(i2*)(intptr_t)(ws+4272) = v2774; - i8 v2775 = (i8)(intptr_t)(f94_E_u16); + i8 v2775 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2775)(); - i8 v2776 = (i8)(intptr_t)c02_s00e0; + i8 v2776 = (i8)(intptr_t)c01_s00e0; *(i8*)(intptr_t)(ws+4320) = v2776; - i8 v2777 = (i8)(intptr_t)(f92_E); + i8 v2777 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2777)(); } - void f162_Pop(void); - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00e1[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00e2[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00e3[] = { 0x20,0x3d,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); - void f92_E(void); -const i1 c02_s00e4[] = { 0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00e5[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00e1[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00e2[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00e3[] = { 0x20,0x3d,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); + void f91_E(void); +const i1 c01_s00e4[] = { 0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00e5[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Op2VV workspace at ws+4224 length ws+28 -void f173_Op2VV(void) { +void f172_Op2VV(void) { - i8 v2778 = (i8)(intptr_t)(f162_Pop); + i8 v2778 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2778)(); @@ -5872,7 +5872,7 @@ void f173_Op2VV(void) { i8 v2783 = (i8)(intptr_t)(ws+4242); *(i2*)(intptr_t)v2783 = v2782; - i8 v2784 = (i8)(intptr_t)(f162_Pop); + i8 v2784 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2784)(); @@ -5885,7 +5885,7 @@ void f173_Op2VV(void) { i8 v2789 = (i8)(intptr_t)(ws+4246); *(i2*)(intptr_t)v2789 = v2788; - i8 v2790 = (i8)(intptr_t)(f160_Push); + i8 v2790 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2790)(); @@ -5898,94 +5898,94 @@ void f173_Op2VV(void) { i8 v2795 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v2795 = v2794; - i8 v2796 = (i8)(intptr_t)c02_s00e1; + i8 v2796 = (i8)(intptr_t)c01_s00e1; *(i8*)(intptr_t)(ws+4320) = v2796; - i8 v2797 = (i8)(intptr_t)(f92_E); + i8 v2797 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2797)(); i8 v2798 = (i8)(intptr_t)(ws+4224); i1 v2799 = *(i1*)(intptr_t)v2798; *(i1*)(intptr_t)(ws+4264) = v2799; - i8 v2800 = (i8)(intptr_t)(f95_E_u8); + i8 v2800 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2800)(); - i8 v2801 = (i8)(intptr_t)c02_s00e2; + i8 v2801 = (i8)(intptr_t)c01_s00e2; *(i8*)(intptr_t)(ws+4320) = v2801; - i8 v2802 = (i8)(intptr_t)(f92_E); + i8 v2802 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2802)(); i8 v2803 = (i8)(intptr_t)(ws+4250); i2 v2804 = *(i2*)(intptr_t)v2803; *(i2*)(intptr_t)(ws+4272) = v2804; - i8 v2805 = (i8)(intptr_t)(f94_E_u16); + i8 v2805 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2805)(); - i8 v2806 = (i8)(intptr_t)c02_s00e3; + i8 v2806 = (i8)(intptr_t)c01_s00e3; *(i8*)(intptr_t)(ws+4320) = v2806; - i8 v2807 = (i8)(intptr_t)(f92_E); + i8 v2807 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2807)(); i8 v2808 = (i8)(intptr_t)(ws+4246); i2 v2809 = *(i2*)(intptr_t)v2808; *(i2*)(intptr_t)(ws+4272) = v2809; - i8 v2810 = (i8)(intptr_t)(f94_E_u16); + i8 v2810 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2810)(); i8 v2811 = (i8)(intptr_t)(ws+4232); i8 v2812 = *(i8*)(intptr_t)v2811; *(i8*)(intptr_t)(ws+4320) = v2812; - i8 v2813 = (i8)(intptr_t)(f92_E); + i8 v2813 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2813)(); - i8 v2814 = (i8)(intptr_t)c02_s00e4; + i8 v2814 = (i8)(intptr_t)c01_s00e4; *(i8*)(intptr_t)(ws+4320) = v2814; - i8 v2815 = (i8)(intptr_t)(f92_E); + i8 v2815 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2815)(); i8 v2816 = (i8)(intptr_t)(ws+4242); i2 v2817 = *(i2*)(intptr_t)v2816; *(i2*)(intptr_t)(ws+4272) = v2817; - i8 v2818 = (i8)(intptr_t)(f94_E_u16); + i8 v2818 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2818)(); - i8 v2819 = (i8)(intptr_t)c02_s00e5; + i8 v2819 = (i8)(intptr_t)c01_s00e5; *(i8*)(intptr_t)(ws+4320) = v2819; - i8 v2820 = (i8)(intptr_t)(f92_E); + i8 v2820 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2820)(); } - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00e6[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00e7[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00e8[] = { 0x20,0x3d,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); - void f92_E(void); -const i1 c02_s00e9[] = { 0x28,0 }; - void f92_E(void); - void f98_E_i32(void); -const i1 c02_s00ea[] = { 0x29,0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00e6[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00e7[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00e8[] = { 0x20,0x3d,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); + void f91_E(void); +const i1 c01_s00e9[] = { 0x28,0 }; + void f91_E(void); + void f97_E_i32(void); +const i1 c01_s00ea[] = { 0x29,0x3b,0x0a,0 }; + void f91_E(void); // Op2VC workspace at ws+4224 length ws+28 -void f174_Op2VC(void) { +void f173_Op2VC(void) { - i8 v2821 = (i8)(intptr_t)(f162_Pop); + i8 v2821 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2821)(); @@ -5998,7 +5998,7 @@ void f174_Op2VC(void) { i8 v2826 = (i8)(intptr_t)(ws+4246); *(i2*)(intptr_t)v2826 = v2825; - i8 v2827 = (i8)(intptr_t)(f160_Push); + i8 v2827 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2827)(); @@ -6011,101 +6011,101 @@ void f174_Op2VC(void) { i8 v2832 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v2832 = v2831; - i8 v2833 = (i8)(intptr_t)c02_s00e6; + i8 v2833 = (i8)(intptr_t)c01_s00e6; *(i8*)(intptr_t)(ws+4320) = v2833; - i8 v2834 = (i8)(intptr_t)(f92_E); + i8 v2834 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2834)(); i8 v2835 = (i8)(intptr_t)(ws+4224); i1 v2836 = *(i1*)(intptr_t)v2835; *(i1*)(intptr_t)(ws+4264) = v2836; - i8 v2837 = (i8)(intptr_t)(f95_E_u8); + i8 v2837 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2837)(); - i8 v2838 = (i8)(intptr_t)c02_s00e7; + i8 v2838 = (i8)(intptr_t)c01_s00e7; *(i8*)(intptr_t)(ws+4320) = v2838; - i8 v2839 = (i8)(intptr_t)(f92_E); + i8 v2839 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2839)(); i8 v2840 = (i8)(intptr_t)(ws+4250); i2 v2841 = *(i2*)(intptr_t)v2840; *(i2*)(intptr_t)(ws+4272) = v2841; - i8 v2842 = (i8)(intptr_t)(f94_E_u16); + i8 v2842 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2842)(); - i8 v2843 = (i8)(intptr_t)c02_s00e8; + i8 v2843 = (i8)(intptr_t)c01_s00e8; *(i8*)(intptr_t)(ws+4320) = v2843; - i8 v2844 = (i8)(intptr_t)(f92_E); + i8 v2844 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2844)(); i8 v2845 = (i8)(intptr_t)(ws+4246); i2 v2846 = *(i2*)(intptr_t)v2845; *(i2*)(intptr_t)(ws+4272) = v2846; - i8 v2847 = (i8)(intptr_t)(f94_E_u16); + i8 v2847 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2847)(); i8 v2848 = (i8)(intptr_t)(ws+4232); i8 v2849 = *(i8*)(intptr_t)v2848; *(i8*)(intptr_t)(ws+4320) = v2849; - i8 v2850 = (i8)(intptr_t)(f92_E); + i8 v2850 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2850)(); - i8 v2851 = (i8)(intptr_t)c02_s00e9; + i8 v2851 = (i8)(intptr_t)c01_s00e9; *(i8*)(intptr_t)(ws+4320) = v2851; - i8 v2852 = (i8)(intptr_t)(f92_E); + i8 v2852 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2852)(); i8 v2853 = (i8)(intptr_t)(ws+4240); i4 v2854 = *(i4*)(intptr_t)v2853; *(i4*)(intptr_t)(ws+4256) = v2854; - i8 v2855 = (i8)(intptr_t)(f98_E_i32); + i8 v2855 = (i8)(intptr_t)(f97_E_i32); ((void(*)(void))(intptr_t)v2855)(); - i8 v2856 = (i8)(intptr_t)c02_s00ea; + i8 v2856 = (i8)(intptr_t)c01_s00ea; *(i8*)(intptr_t)(ws+4320) = v2856; - i8 v2857 = (i8)(intptr_t)(f92_E); + i8 v2857 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2857)(); } - void f162_Pop(void); - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00eb[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00ec[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00ed[] = { 0x20,0x3d,0x20,0x28,0x73,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00ee[] = { 0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); - void f92_E(void); -const i1 c02_s00ef[] = { 0x28,0x73,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00f0[] = { 0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00f1[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00eb[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00ec[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00ed[] = { 0x20,0x3d,0x20,0x28,0x73,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00ee[] = { 0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); + void f91_E(void); +const i1 c01_s00ef[] = { 0x28,0x73,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00f0[] = { 0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00f1[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Op2VVSigned workspace at ws+4224 length ws+28 -void f175_Op2VVSigned(void) { +void f174_Op2VVSigned(void) { - i8 v2858 = (i8)(intptr_t)(f162_Pop); + i8 v2858 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2858)(); @@ -6118,7 +6118,7 @@ void f175_Op2VVSigned(void) { i8 v2863 = (i8)(intptr_t)(ws+4242); *(i2*)(intptr_t)v2863 = v2862; - i8 v2864 = (i8)(intptr_t)(f162_Pop); + i8 v2864 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2864)(); @@ -6131,7 +6131,7 @@ void f175_Op2VVSigned(void) { i8 v2869 = (i8)(intptr_t)(ws+4246); *(i2*)(intptr_t)v2869 = v2868; - i8 v2870 = (i8)(intptr_t)(f160_Push); + i8 v2870 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2870)(); @@ -6144,120 +6144,120 @@ void f175_Op2VVSigned(void) { i8 v2875 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v2875 = v2874; - i8 v2876 = (i8)(intptr_t)c02_s00eb; + i8 v2876 = (i8)(intptr_t)c01_s00eb; *(i8*)(intptr_t)(ws+4320) = v2876; - i8 v2877 = (i8)(intptr_t)(f92_E); + i8 v2877 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2877)(); i8 v2878 = (i8)(intptr_t)(ws+4224); i1 v2879 = *(i1*)(intptr_t)v2878; *(i1*)(intptr_t)(ws+4264) = v2879; - i8 v2880 = (i8)(intptr_t)(f95_E_u8); + i8 v2880 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2880)(); - i8 v2881 = (i8)(intptr_t)c02_s00ec; + i8 v2881 = (i8)(intptr_t)c01_s00ec; *(i8*)(intptr_t)(ws+4320) = v2881; - i8 v2882 = (i8)(intptr_t)(f92_E); + i8 v2882 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2882)(); i8 v2883 = (i8)(intptr_t)(ws+4250); i2 v2884 = *(i2*)(intptr_t)v2883; *(i2*)(intptr_t)(ws+4272) = v2884; - i8 v2885 = (i8)(intptr_t)(f94_E_u16); + i8 v2885 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2885)(); - i8 v2886 = (i8)(intptr_t)c02_s00ed; + i8 v2886 = (i8)(intptr_t)c01_s00ed; *(i8*)(intptr_t)(ws+4320) = v2886; - i8 v2887 = (i8)(intptr_t)(f92_E); + i8 v2887 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2887)(); i8 v2888 = (i8)(intptr_t)(ws+4224); i1 v2889 = *(i1*)(intptr_t)v2888; *(i1*)(intptr_t)(ws+4264) = v2889; - i8 v2890 = (i8)(intptr_t)(f95_E_u8); + i8 v2890 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2890)(); - i8 v2891 = (i8)(intptr_t)c02_s00ee; + i8 v2891 = (i8)(intptr_t)c01_s00ee; *(i8*)(intptr_t)(ws+4320) = v2891; - i8 v2892 = (i8)(intptr_t)(f92_E); + i8 v2892 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2892)(); i8 v2893 = (i8)(intptr_t)(ws+4246); i2 v2894 = *(i2*)(intptr_t)v2893; *(i2*)(intptr_t)(ws+4272) = v2894; - i8 v2895 = (i8)(intptr_t)(f94_E_u16); + i8 v2895 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2895)(); i8 v2896 = (i8)(intptr_t)(ws+4232); i8 v2897 = *(i8*)(intptr_t)v2896; *(i8*)(intptr_t)(ws+4320) = v2897; - i8 v2898 = (i8)(intptr_t)(f92_E); + i8 v2898 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2898)(); - i8 v2899 = (i8)(intptr_t)c02_s00ef; + i8 v2899 = (i8)(intptr_t)c01_s00ef; *(i8*)(intptr_t)(ws+4320) = v2899; - i8 v2900 = (i8)(intptr_t)(f92_E); + i8 v2900 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2900)(); i8 v2901 = (i8)(intptr_t)(ws+4224); i1 v2902 = *(i1*)(intptr_t)v2901; *(i1*)(intptr_t)(ws+4264) = v2902; - i8 v2903 = (i8)(intptr_t)(f95_E_u8); + i8 v2903 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2903)(); - i8 v2904 = (i8)(intptr_t)c02_s00f0; + i8 v2904 = (i8)(intptr_t)c01_s00f0; *(i8*)(intptr_t)(ws+4320) = v2904; - i8 v2905 = (i8)(intptr_t)(f92_E); + i8 v2905 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2905)(); i8 v2906 = (i8)(intptr_t)(ws+4242); i2 v2907 = *(i2*)(intptr_t)v2906; *(i2*)(intptr_t)(ws+4272) = v2907; - i8 v2908 = (i8)(intptr_t)(f94_E_u16); + i8 v2908 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2908)(); - i8 v2909 = (i8)(intptr_t)c02_s00f1; + i8 v2909 = (i8)(intptr_t)c01_s00f1; *(i8*)(intptr_t)(ws+4320) = v2909; - i8 v2910 = (i8)(intptr_t)(f92_E); + i8 v2910 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2910)(); } - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00f2[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00f3[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00f4[] = { 0x20,0x3d,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); - void f92_E(void); -const i1 c02_s00f5[] = { 0x28,0 }; - void f92_E(void); - void f98_E_i32(void); -const i1 c02_s00f6[] = { 0x29,0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00f2[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00f3[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00f4[] = { 0x20,0x3d,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); + void f91_E(void); +const i1 c01_s00f5[] = { 0x28,0 }; + void f91_E(void); + void f97_E_i32(void); +const i1 c01_s00f6[] = { 0x29,0x3b,0x0a,0 }; + void f91_E(void); // Op2VCSigned workspace at ws+4224 length ws+28 -void f176_Op2VCSigned(void) { +void f175_Op2VCSigned(void) { - i8 v2911 = (i8)(intptr_t)(f162_Pop); + i8 v2911 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2911)(); @@ -6270,7 +6270,7 @@ void f176_Op2VCSigned(void) { i8 v2916 = (i8)(intptr_t)(ws+4246); *(i2*)(intptr_t)v2916 = v2915; - i8 v2917 = (i8)(intptr_t)(f160_Push); + i8 v2917 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2917)(); @@ -6283,93 +6283,93 @@ void f176_Op2VCSigned(void) { i8 v2922 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v2922 = v2921; - i8 v2923 = (i8)(intptr_t)c02_s00f2; + i8 v2923 = (i8)(intptr_t)c01_s00f2; *(i8*)(intptr_t)(ws+4320) = v2923; - i8 v2924 = (i8)(intptr_t)(f92_E); + i8 v2924 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2924)(); i8 v2925 = (i8)(intptr_t)(ws+4224); i1 v2926 = *(i1*)(intptr_t)v2925; *(i1*)(intptr_t)(ws+4264) = v2926; - i8 v2927 = (i8)(intptr_t)(f95_E_u8); + i8 v2927 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2927)(); - i8 v2928 = (i8)(intptr_t)c02_s00f3; + i8 v2928 = (i8)(intptr_t)c01_s00f3; *(i8*)(intptr_t)(ws+4320) = v2928; - i8 v2929 = (i8)(intptr_t)(f92_E); + i8 v2929 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2929)(); i8 v2930 = (i8)(intptr_t)(ws+4250); i2 v2931 = *(i2*)(intptr_t)v2930; *(i2*)(intptr_t)(ws+4272) = v2931; - i8 v2932 = (i8)(intptr_t)(f94_E_u16); + i8 v2932 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2932)(); - i8 v2933 = (i8)(intptr_t)c02_s00f4; + i8 v2933 = (i8)(intptr_t)c01_s00f4; *(i8*)(intptr_t)(ws+4320) = v2933; - i8 v2934 = (i8)(intptr_t)(f92_E); + i8 v2934 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2934)(); i8 v2935 = (i8)(intptr_t)(ws+4246); i2 v2936 = *(i2*)(intptr_t)v2935; *(i2*)(intptr_t)(ws+4272) = v2936; - i8 v2937 = (i8)(intptr_t)(f94_E_u16); + i8 v2937 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2937)(); i8 v2938 = (i8)(intptr_t)(ws+4232); i8 v2939 = *(i8*)(intptr_t)v2938; *(i8*)(intptr_t)(ws+4320) = v2939; - i8 v2940 = (i8)(intptr_t)(f92_E); + i8 v2940 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2940)(); - i8 v2941 = (i8)(intptr_t)c02_s00f5; + i8 v2941 = (i8)(intptr_t)c01_s00f5; *(i8*)(intptr_t)(ws+4320) = v2941; - i8 v2942 = (i8)(intptr_t)(f92_E); + i8 v2942 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2942)(); i8 v2943 = (i8)(intptr_t)(ws+4240); i4 v2944 = *(i4*)(intptr_t)v2943; *(i4*)(intptr_t)(ws+4256) = v2944; - i8 v2945 = (i8)(intptr_t)(f98_E_i32); + i8 v2945 = (i8)(intptr_t)(f97_E_i32); ((void(*)(void))(intptr_t)v2945)(); - i8 v2946 = (i8)(intptr_t)c02_s00f6; + i8 v2946 = (i8)(intptr_t)c01_s00f6; *(i8*)(intptr_t)(ws+4320) = v2946; - i8 v2947 = (i8)(intptr_t)(f92_E); + i8 v2947 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2947)(); } - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00f7[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00f8[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00f9[] = { 0x20,0x3d,0x20,0 }; - void f92_E(void); - void f92_E(void); -const i1 c02_s00fa[] = { 0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00fb[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00f7[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00f8[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00f9[] = { 0x20,0x3d,0x20,0 }; + void f91_E(void); + void f91_E(void); +const i1 c01_s00fa[] = { 0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00fb[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Op1V workspace at ws+4224 length ws+24 -void f177_Op1V(void) { +void f176_Op1V(void) { - i8 v2948 = (i8)(intptr_t)(f162_Pop); + i8 v2948 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2948)(); @@ -6382,7 +6382,7 @@ void f177_Op1V(void) { i8 v2953 = (i8)(intptr_t)(ws+4242); *(i2*)(intptr_t)v2953 = v2952; - i8 v2954 = (i8)(intptr_t)(f160_Push); + i8 v2954 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2954)(); @@ -6395,93 +6395,93 @@ void f177_Op1V(void) { i8 v2959 = (i8)(intptr_t)(ws+4246); *(i2*)(intptr_t)v2959 = v2958; - i8 v2960 = (i8)(intptr_t)c02_s00f7; + i8 v2960 = (i8)(intptr_t)c01_s00f7; *(i8*)(intptr_t)(ws+4320) = v2960; - i8 v2961 = (i8)(intptr_t)(f92_E); + i8 v2961 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2961)(); i8 v2962 = (i8)(intptr_t)(ws+4224); i1 v2963 = *(i1*)(intptr_t)v2962; *(i1*)(intptr_t)(ws+4264) = v2963; - i8 v2964 = (i8)(intptr_t)(f95_E_u8); + i8 v2964 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v2964)(); - i8 v2965 = (i8)(intptr_t)c02_s00f8; + i8 v2965 = (i8)(intptr_t)c01_s00f8; *(i8*)(intptr_t)(ws+4320) = v2965; - i8 v2966 = (i8)(intptr_t)(f92_E); + i8 v2966 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2966)(); i8 v2967 = (i8)(intptr_t)(ws+4246); i2 v2968 = *(i2*)(intptr_t)v2967; *(i2*)(intptr_t)(ws+4272) = v2968; - i8 v2969 = (i8)(intptr_t)(f94_E_u16); + i8 v2969 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2969)(); - i8 v2970 = (i8)(intptr_t)c02_s00f9; + i8 v2970 = (i8)(intptr_t)c01_s00f9; *(i8*)(intptr_t)(ws+4320) = v2970; - i8 v2971 = (i8)(intptr_t)(f92_E); + i8 v2971 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2971)(); i8 v2972 = (i8)(intptr_t)(ws+4232); i8 v2973 = *(i8*)(intptr_t)v2972; *(i8*)(intptr_t)(ws+4320) = v2973; - i8 v2974 = (i8)(intptr_t)(f92_E); + i8 v2974 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2974)(); - i8 v2975 = (i8)(intptr_t)c02_s00fa; + i8 v2975 = (i8)(intptr_t)c01_s00fa; *(i8*)(intptr_t)(ws+4320) = v2975; - i8 v2976 = (i8)(intptr_t)(f92_E); + i8 v2976 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2976)(); i8 v2977 = (i8)(intptr_t)(ws+4242); i2 v2978 = *(i2*)(intptr_t)v2977; *(i2*)(intptr_t)(ws+4272) = v2978; - i8 v2979 = (i8)(intptr_t)(f94_E_u16); + i8 v2979 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v2979)(); - i8 v2980 = (i8)(intptr_t)c02_s00fb; + i8 v2980 = (i8)(intptr_t)c01_s00fb; *(i8*)(intptr_t)(ws+4320) = v2980; - i8 v2981 = (i8)(intptr_t)(f92_E); + i8 v2981 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v2981)(); } - void f162_Pop(void); - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s00fc[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s00fd[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s00fe[] = { 0x20,0x3d,0x20,0x28,0x28,0 }; - void f92_E(void); - void f92_E(void); -const i1 c02_s00ff[] = { 0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s0100[] = { 0x29,0 }; - void f92_E(void); - void f92_E(void); -const i1 c02_s0101[] = { 0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s0102[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s00fc[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s00fd[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s00fe[] = { 0x20,0x3d,0x20,0x28,0x28,0 }; + void f91_E(void); + void f91_E(void); +const i1 c01_s00ff[] = { 0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s0100[] = { 0x29,0 }; + void f91_E(void); + void f91_E(void); +const i1 c01_s0101[] = { 0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s0102[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Shift workspace at ws+4224 length ws+36 -void f178_Shift(void) { +void f177_Shift(void) { - i8 v2982 = (i8)(intptr_t)(f162_Pop); + i8 v2982 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2982)(); @@ -6494,7 +6494,7 @@ void f178_Shift(void) { i8 v2987 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v2987 = v2986; - i8 v2988 = (i8)(intptr_t)(f162_Pop); + i8 v2988 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v2988)(); @@ -6507,7 +6507,7 @@ void f178_Shift(void) { i8 v2993 = (i8)(intptr_t)(ws+4254); *(i2*)(intptr_t)v2993 = v2992; - i8 v2994 = (i8)(intptr_t)(f160_Push); + i8 v2994 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v2994)(); @@ -6520,113 +6520,113 @@ void f178_Shift(void) { i8 v2999 = (i8)(intptr_t)(ws+4258); *(i2*)(intptr_t)v2999 = v2998; - i8 v3000 = (i8)(intptr_t)c02_s00fc; + i8 v3000 = (i8)(intptr_t)c01_s00fc; *(i8*)(intptr_t)(ws+4320) = v3000; - i8 v3001 = (i8)(intptr_t)(f92_E); + i8 v3001 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3001)(); i8 v3002 = (i8)(intptr_t)(ws+4224); i1 v3003 = *(i1*)(intptr_t)v3002; *(i1*)(intptr_t)(ws+4264) = v3003; - i8 v3004 = (i8)(intptr_t)(f95_E_u8); + i8 v3004 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v3004)(); - i8 v3005 = (i8)(intptr_t)c02_s00fd; + i8 v3005 = (i8)(intptr_t)c01_s00fd; *(i8*)(intptr_t)(ws+4320) = v3005; - i8 v3006 = (i8)(intptr_t)(f92_E); + i8 v3006 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3006)(); i8 v3007 = (i8)(intptr_t)(ws+4258); i2 v3008 = *(i2*)(intptr_t)v3007; *(i2*)(intptr_t)(ws+4272) = v3008; - i8 v3009 = (i8)(intptr_t)(f94_E_u16); + i8 v3009 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3009)(); - i8 v3010 = (i8)(intptr_t)c02_s00fe; + i8 v3010 = (i8)(intptr_t)c01_s00fe; *(i8*)(intptr_t)(ws+4320) = v3010; - i8 v3011 = (i8)(intptr_t)(f92_E); + i8 v3011 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3011)(); i8 v3012 = (i8)(intptr_t)(ws+4232); i8 v3013 = *(i8*)(intptr_t)v3012; *(i8*)(intptr_t)(ws+4320) = v3013; - i8 v3014 = (i8)(intptr_t)(f92_E); + i8 v3014 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3014)(); - i8 v3015 = (i8)(intptr_t)c02_s00ff; + i8 v3015 = (i8)(intptr_t)c01_s00ff; *(i8*)(intptr_t)(ws+4320) = v3015; - i8 v3016 = (i8)(intptr_t)(f92_E); + i8 v3016 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3016)(); i8 v3017 = (i8)(intptr_t)(ws+4254); i2 v3018 = *(i2*)(intptr_t)v3017; *(i2*)(intptr_t)(ws+4272) = v3018; - i8 v3019 = (i8)(intptr_t)(f94_E_u16); + i8 v3019 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3019)(); - i8 v3020 = (i8)(intptr_t)c02_s0100; + i8 v3020 = (i8)(intptr_t)c01_s0100; *(i8*)(intptr_t)(ws+4320) = v3020; - i8 v3021 = (i8)(intptr_t)(f92_E); + i8 v3021 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3021)(); i8 v3022 = (i8)(intptr_t)(ws+4240); i8 v3023 = *(i8*)(intptr_t)v3022; *(i8*)(intptr_t)(ws+4320) = v3023; - i8 v3024 = (i8)(intptr_t)(f92_E); + i8 v3024 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3024)(); - i8 v3025 = (i8)(intptr_t)c02_s0101; + i8 v3025 = (i8)(intptr_t)c01_s0101; *(i8*)(intptr_t)(ws+4320) = v3025; - i8 v3026 = (i8)(intptr_t)(f92_E); + i8 v3026 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3026)(); i8 v3027 = (i8)(intptr_t)(ws+4250); i2 v3028 = *(i2*)(intptr_t)v3027; *(i2*)(intptr_t)(ws+4272) = v3028; - i8 v3029 = (i8)(intptr_t)(f94_E_u16); + i8 v3029 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3029)(); - i8 v3030 = (i8)(intptr_t)c02_s0102; + i8 v3030 = (i8)(intptr_t)c01_s0102; *(i8*)(intptr_t)(ws+4320) = v3030; - i8 v3031 = (i8)(intptr_t)(f92_E); + i8 v3031 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3031)(); } - void f162_Pop(void); - void f162_Pop(void); -const i1 c02_s0103[] = { 0x09,0x69,0x66,0x20,0x28,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); - void f92_E(void); -const i1 c02_s0104[] = { 0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s0105[] = { 0x29,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); -const i1 c02_s0106[] = { 0x3b,0x20,0x65,0x6c,0x73,0x65,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); -const i1 c02_s0107[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f161_Pop(void); +const i1 c01_s0103[] = { 0x09,0x69,0x66,0x20,0x28,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); + void f91_E(void); +const i1 c01_s0104[] = { 0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s0105[] = { 0x29,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); +const i1 c01_s0106[] = { 0x3b,0x20,0x65,0x6c,0x73,0x65,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); +const i1 c01_s0107[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Branch workspace at ws+4224 length ws+24 -void f179_Branch(void) { +void f178_Branch(void) { - i8 v3032 = (i8)(intptr_t)(f162_Pop); + i8 v3032 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v3032)(); @@ -6639,7 +6639,7 @@ void f179_Branch(void) { i8 v3037 = (i8)(intptr_t)(ws+4242); *(i2*)(intptr_t)v3037 = v3036; - i8 v3038 = (i8)(intptr_t)(f162_Pop); + i8 v3038 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v3038)(); @@ -6652,42 +6652,42 @@ void f179_Branch(void) { i8 v3043 = (i8)(intptr_t)(ws+4246); *(i2*)(intptr_t)v3043 = v3042; - i8 v3044 = (i8)(intptr_t)c02_s0103; + i8 v3044 = (i8)(intptr_t)c01_s0103; *(i8*)(intptr_t)(ws+4320) = v3044; - i8 v3045 = (i8)(intptr_t)(f92_E); + i8 v3045 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3045)(); i8 v3046 = (i8)(intptr_t)(ws+4246); i2 v3047 = *(i2*)(intptr_t)v3046; *(i2*)(intptr_t)(ws+4272) = v3047; - i8 v3048 = (i8)(intptr_t)(f94_E_u16); + i8 v3048 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3048)(); i8 v3049 = (i8)(intptr_t)(ws+4232); i8 v3050 = *(i8*)(intptr_t)v3049; *(i8*)(intptr_t)(ws+4320) = v3050; - i8 v3051 = (i8)(intptr_t)(f92_E); + i8 v3051 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3051)(); - i8 v3052 = (i8)(intptr_t)c02_s0104; + i8 v3052 = (i8)(intptr_t)c01_s0104; *(i8*)(intptr_t)(ws+4320) = v3052; - i8 v3053 = (i8)(intptr_t)(f92_E); + i8 v3053 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3053)(); i8 v3054 = (i8)(intptr_t)(ws+4242); i2 v3055 = *(i2*)(intptr_t)v3054; *(i2*)(intptr_t)(ws+4272) = v3055; - i8 v3056 = (i8)(intptr_t)(f94_E_u16); + i8 v3056 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3056)(); - i8 v3057 = (i8)(intptr_t)c02_s0105; + i8 v3057 = (i8)(intptr_t)c01_s0105; *(i8*)(intptr_t)(ws+4320) = v3057; - i8 v3058 = (i8)(intptr_t)(f92_E); + i8 v3058 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3058)(); @@ -6695,13 +6695,13 @@ void f179_Branch(void) { i8 v3060 = *(i8*)(intptr_t)v3059; i2 v3061 = *(i2*)(intptr_t)v3060; *(i2*)(intptr_t)(ws+4256) = v3061; - i8 v3062 = (i8)(intptr_t)(f103_E_labelref); + i8 v3062 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3062)(); - i8 v3063 = (i8)(intptr_t)c02_s0106; + i8 v3063 = (i8)(intptr_t)c01_s0106; *(i8*)(intptr_t)(ws+4320) = v3063; - i8 v3064 = (i8)(intptr_t)(f92_E); + i8 v3064 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3064)(); @@ -6710,45 +6710,45 @@ void f179_Branch(void) { i8 v3067 = v3066+(+2); i2 v3068 = *(i2*)(intptr_t)v3067; *(i2*)(intptr_t)(ws+4256) = v3068; - i8 v3069 = (i8)(intptr_t)(f103_E_labelref); + i8 v3069 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3069)(); - i8 v3070 = (i8)(intptr_t)c02_s0107; + i8 v3070 = (i8)(intptr_t)c01_s0107; *(i8*)(intptr_t)(ws+4320) = v3070; - i8 v3071 = (i8)(intptr_t)(f92_E); + i8 v3071 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3071)(); } - void f162_Pop(void); - void f162_Pop(void); -const i1 c02_s0108[] = { 0x09,0x69,0x66,0x20,0x28,0x28,0x73,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s0109[] = { 0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); - void f92_E(void); -const i1 c02_s010a[] = { 0x28,0x73,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s010b[] = { 0x29,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s010c[] = { 0x29,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); -const i1 c02_s010d[] = { 0x3b,0x20,0x65,0x6c,0x73,0x65,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); -const i1 c02_s010e[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f161_Pop(void); +const i1 c01_s0108[] = { 0x09,0x69,0x66,0x20,0x28,0x28,0x73,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s0109[] = { 0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); + void f91_E(void); +const i1 c01_s010a[] = { 0x28,0x73,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s010b[] = { 0x29,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s010c[] = { 0x29,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); +const i1 c01_s010d[] = { 0x3b,0x20,0x65,0x6c,0x73,0x65,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); +const i1 c01_s010e[] = { 0x3b,0x0a,0 }; + void f91_E(void); // BranchSigned workspace at ws+4224 length ws+32 -void f180_BranchSigned(void) { +void f179_BranchSigned(void) { - i8 v3072 = (i8)(intptr_t)(f162_Pop); + i8 v3072 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v3072)(); @@ -6761,7 +6761,7 @@ void f180_BranchSigned(void) { i8 v3077 = (i8)(intptr_t)(ws+4250); *(i2*)(intptr_t)v3077 = v3076; - i8 v3078 = (i8)(intptr_t)(f162_Pop); + i8 v3078 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v3078)(); @@ -6774,68 +6774,68 @@ void f180_BranchSigned(void) { i8 v3083 = (i8)(intptr_t)(ws+4254); *(i2*)(intptr_t)v3083 = v3082; - i8 v3084 = (i8)(intptr_t)c02_s0108; + i8 v3084 = (i8)(intptr_t)c01_s0108; *(i8*)(intptr_t)(ws+4320) = v3084; - i8 v3085 = (i8)(intptr_t)(f92_E); + i8 v3085 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3085)(); i8 v3086 = (i8)(intptr_t)(ws+4232); i1 v3087 = *(i1*)(intptr_t)v3086; *(i1*)(intptr_t)(ws+4264) = v3087; - i8 v3088 = (i8)(intptr_t)(f95_E_u8); + i8 v3088 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v3088)(); - i8 v3089 = (i8)(intptr_t)c02_s0109; + i8 v3089 = (i8)(intptr_t)c01_s0109; *(i8*)(intptr_t)(ws+4320) = v3089; - i8 v3090 = (i8)(intptr_t)(f92_E); + i8 v3090 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3090)(); i8 v3091 = (i8)(intptr_t)(ws+4254); i2 v3092 = *(i2*)(intptr_t)v3091; *(i2*)(intptr_t)(ws+4272) = v3092; - i8 v3093 = (i8)(intptr_t)(f94_E_u16); + i8 v3093 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3093)(); i8 v3094 = (i8)(intptr_t)(ws+4240); i8 v3095 = *(i8*)(intptr_t)v3094; *(i8*)(intptr_t)(ws+4320) = v3095; - i8 v3096 = (i8)(intptr_t)(f92_E); + i8 v3096 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3096)(); - i8 v3097 = (i8)(intptr_t)c02_s010a; + i8 v3097 = (i8)(intptr_t)c01_s010a; *(i8*)(intptr_t)(ws+4320) = v3097; - i8 v3098 = (i8)(intptr_t)(f92_E); + i8 v3098 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3098)(); i8 v3099 = (i8)(intptr_t)(ws+4232); i1 v3100 = *(i1*)(intptr_t)v3099; *(i1*)(intptr_t)(ws+4264) = v3100; - i8 v3101 = (i8)(intptr_t)(f95_E_u8); + i8 v3101 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v3101)(); - i8 v3102 = (i8)(intptr_t)c02_s010b; + i8 v3102 = (i8)(intptr_t)c01_s010b; *(i8*)(intptr_t)(ws+4320) = v3102; - i8 v3103 = (i8)(intptr_t)(f92_E); + i8 v3103 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3103)(); i8 v3104 = (i8)(intptr_t)(ws+4250); i2 v3105 = *(i2*)(intptr_t)v3104; *(i2*)(intptr_t)(ws+4272) = v3105; - i8 v3106 = (i8)(intptr_t)(f94_E_u16); + i8 v3106 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3106)(); - i8 v3107 = (i8)(intptr_t)c02_s010c; + i8 v3107 = (i8)(intptr_t)c01_s010c; *(i8*)(intptr_t)(ws+4320) = v3107; - i8 v3108 = (i8)(intptr_t)(f92_E); + i8 v3108 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3108)(); @@ -6843,13 +6843,13 @@ void f180_BranchSigned(void) { i8 v3110 = *(i8*)(intptr_t)v3109; i2 v3111 = *(i2*)(intptr_t)v3110; *(i2*)(intptr_t)(ws+4256) = v3111; - i8 v3112 = (i8)(intptr_t)(f103_E_labelref); + i8 v3112 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3112)(); - i8 v3113 = (i8)(intptr_t)c02_s010d; + i8 v3113 = (i8)(intptr_t)c01_s010d; *(i8*)(intptr_t)(ws+4320) = v3113; - i8 v3114 = (i8)(intptr_t)(f92_E); + i8 v3114 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3114)(); @@ -6858,30 +6858,30 @@ void f180_BranchSigned(void) { i8 v3117 = v3116+(+2); i2 v3118 = *(i2*)(intptr_t)v3117; *(i2*)(intptr_t)(ws+4256) = v3118; - i8 v3119 = (i8)(intptr_t)(f103_E_labelref); + i8 v3119 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3119)(); - i8 v3120 = (i8)(intptr_t)c02_s010e; + i8 v3120 = (i8)(intptr_t)c01_s010e; *(i8*)(intptr_t)(ws+4320) = v3120; - i8 v3121 = (i8)(intptr_t)(f92_E); + i8 v3121 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3121)(); } -const i1 c02_s010f[] = { 0x09,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); - void f103_E_labelref(void); -const i1 c02_s0110[] = { 0x3b,0x0a,0 }; - void f92_E(void); +const i1 c01_s010f[] = { 0x09,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); + void f102_E_labelref(void); +const i1 c01_s0110[] = { 0x3b,0x0a,0 }; + void f91_E(void); // BranchConstant workspace at ws+4224 length ws+16 -void f181_BranchConstant(void) { +void f180_BranchConstant(void) { - i8 v3122 = (i8)(intptr_t)c02_s010f; + i8 v3122 = (i8)(intptr_t)c01_s010f; *(i8*)(intptr_t)(ws+4320) = v3122; - i8 v3123 = (i8)(intptr_t)(f92_E); + i8 v3123 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3123)(); @@ -6889,54 +6889,54 @@ void f181_BranchConstant(void) { i4 v3125 = *(i4*)(intptr_t)v3124; i8 v3126 = (i8)(intptr_t)(ws+4236); i4 v3127 = *(i4*)(intptr_t)v3126; - if (v3125==v3127) goto c02_0265; else goto c02_0266; + if (v3125==v3127) goto c01_0265; else goto c01_0266; -c02_0265:; +c01_0265:; i8 v3128 = (i8)(intptr_t)(ws+4224); i8 v3129 = *(i8*)(intptr_t)v3128; i2 v3130 = *(i2*)(intptr_t)v3129; *(i2*)(intptr_t)(ws+4256) = v3130; - i8 v3131 = (i8)(intptr_t)(f103_E_labelref); + i8 v3131 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3131)(); - goto c02_0262; + goto c01_0262; -c02_0266:; +c01_0266:; i8 v3132 = (i8)(intptr_t)(ws+4224); i8 v3133 = *(i8*)(intptr_t)v3132; i8 v3134 = v3133+(+2); i2 v3135 = *(i2*)(intptr_t)v3134; *(i2*)(intptr_t)(ws+4256) = v3135; - i8 v3136 = (i8)(intptr_t)(f103_E_labelref); + i8 v3136 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3136)(); -c02_0262:; +c01_0262:; - i8 v3137 = (i8)(intptr_t)c02_s0110; + i8 v3137 = (i8)(intptr_t)c01_s0110; *(i8*)(intptr_t)(ws+4320) = v3137; - i8 v3138 = (i8)(intptr_t)(f92_E); + i8 v3138 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3138)(); } -const i1 c02_s0111[] = { 0x09,0x69,0x66,0x20,0x28,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s0112[] = { 0x20,0x21,0x3d,0x20,0 }; - void f92_E(void); - void f98_E_i32(void); -const i1 c02_s0113[] = { 0x29,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); -const i1 c02_s0114[] = { 0x3b,0x0a,0 }; - void f92_E(void); +const i1 c01_s0111[] = { 0x09,0x69,0x66,0x20,0x28,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s0112[] = { 0x20,0x21,0x3d,0x20,0 }; + void f91_E(void); + void f97_E_i32(void); +const i1 c01_s0113[] = { 0x29,0x20,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); +const i1 c01_s0114[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Whencase workspace at ws+4224 length ws+8 -void f182_Whencase(void) { +void f181_Whencase(void) { i8 v3139 = (i8)(intptr_t)(ws+3704); i8 v3140 = (i8)(intptr_t)(ws+3832); @@ -6950,80 +6950,80 @@ void f182_Whencase(void) { i8 v3148 = (i8)(intptr_t)(ws+4230); *(i2*)(intptr_t)v3148 = v3147; - i8 v3149 = (i8)(intptr_t)c02_s0111; + i8 v3149 = (i8)(intptr_t)c01_s0111; *(i8*)(intptr_t)(ws+4320) = v3149; - i8 v3150 = (i8)(intptr_t)(f92_E); + i8 v3150 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3150)(); i8 v3151 = (i8)(intptr_t)(ws+4230); i2 v3152 = *(i2*)(intptr_t)v3151; *(i2*)(intptr_t)(ws+4272) = v3152; - i8 v3153 = (i8)(intptr_t)(f94_E_u16); + i8 v3153 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3153)(); - i8 v3154 = (i8)(intptr_t)c02_s0112; + i8 v3154 = (i8)(intptr_t)c01_s0112; *(i8*)(intptr_t)(ws+4320) = v3154; - i8 v3155 = (i8)(intptr_t)(f92_E); + i8 v3155 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3155)(); i8 v3156 = (i8)(intptr_t)(ws+4224); i4 v3157 = *(i4*)(intptr_t)v3156; *(i4*)(intptr_t)(ws+4256) = v3157; - i8 v3158 = (i8)(intptr_t)(f98_E_i32); + i8 v3158 = (i8)(intptr_t)(f97_E_i32); ((void(*)(void))(intptr_t)v3158)(); - i8 v3159 = (i8)(intptr_t)c02_s0113; + i8 v3159 = (i8)(intptr_t)c01_s0113; *(i8*)(intptr_t)(ws+4320) = v3159; - i8 v3160 = (i8)(intptr_t)(f92_E); + i8 v3160 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3160)(); i8 v3161 = (i8)(intptr_t)(ws+4228); i2 v3162 = *(i2*)(intptr_t)v3161; *(i2*)(intptr_t)(ws+4256) = v3162; - i8 v3163 = (i8)(intptr_t)(f103_E_labelref); + i8 v3163 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3163)(); - i8 v3164 = (i8)(intptr_t)c02_s0114; + i8 v3164 = (i8)(intptr_t)c01_s0114; *(i8*)(intptr_t)(ws+4320) = v3164; - i8 v3165 = (i8)(intptr_t)(f92_E); + i8 v3165 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3165)(); } - void f162_Pop(void); - void f160_Push(void); -const i1 c02_s0115[] = { 0x09,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s0116[] = { 0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s0117[] = { 0x20,0x3d,0x20,0 }; - void f92_E(void); -const i1 c02_s0118[] = { 0x28,0x73,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s0119[] = { 0x29,0x28,0x73,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s011a[] = { 0x29,0 }; - void f92_E(void); -const i1 c02_s011b[] = { 0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s011c[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f161_Pop(void); + void f159_Push(void); +const i1 c01_s0115[] = { 0x09,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s0116[] = { 0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s0117[] = { 0x20,0x3d,0x20,0 }; + void f91_E(void); +const i1 c01_s0118[] = { 0x28,0x73,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s0119[] = { 0x29,0x28,0x73,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s011a[] = { 0x29,0 }; + void f91_E(void); +const i1 c01_s011b[] = { 0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s011c[] = { 0x3b,0x0a,0 }; + void f91_E(void); // Cast workspace at ws+4224 length ws+12 -void f183_Cast(void) { +void f182_Cast(void) { - i8 v3166 = (i8)(intptr_t)(f162_Pop); + i8 v3166 = (i8)(intptr_t)(f161_Pop); ((void(*)(void))(intptr_t)v3166)(); @@ -7036,7 +7036,7 @@ void f183_Cast(void) { i8 v3171 = (i8)(intptr_t)(ws+4230); *(i2*)(intptr_t)v3171 = v3170; - i8 v3172 = (i8)(intptr_t)(f160_Push); + i8 v3172 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v3172)(); @@ -7049,120 +7049,120 @@ void f183_Cast(void) { i8 v3177 = (i8)(intptr_t)(ws+4234); *(i2*)(intptr_t)v3177 = v3176; - i8 v3178 = (i8)(intptr_t)c02_s0115; + i8 v3178 = (i8)(intptr_t)c01_s0115; *(i8*)(intptr_t)(ws+4320) = v3178; - i8 v3179 = (i8)(intptr_t)(f92_E); + i8 v3179 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3179)(); i8 v3180 = (i8)(intptr_t)(ws+4225); i1 v3181 = *(i1*)(intptr_t)v3180; *(i1*)(intptr_t)(ws+4264) = v3181; - i8 v3182 = (i8)(intptr_t)(f95_E_u8); + i8 v3182 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v3182)(); - i8 v3183 = (i8)(intptr_t)c02_s0116; + i8 v3183 = (i8)(intptr_t)c01_s0116; *(i8*)(intptr_t)(ws+4320) = v3183; - i8 v3184 = (i8)(intptr_t)(f92_E); + i8 v3184 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3184)(); i8 v3185 = (i8)(intptr_t)(ws+4234); i2 v3186 = *(i2*)(intptr_t)v3185; *(i2*)(intptr_t)(ws+4272) = v3186; - i8 v3187 = (i8)(intptr_t)(f94_E_u16); + i8 v3187 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3187)(); - i8 v3188 = (i8)(intptr_t)c02_s0117; + i8 v3188 = (i8)(intptr_t)c01_s0117; *(i8*)(intptr_t)(ws+4320) = v3188; - i8 v3189 = (i8)(intptr_t)(f92_E); + i8 v3189 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3189)(); i8 v3190 = (i8)(intptr_t)(ws+4226); i1 v3191 = *(i1*)(intptr_t)v3190; i1 v3192 = (i1)+0; - if (v3191==v3192) goto c02_026b; else goto c02_026a; + if (v3191==v3192) goto c01_026b; else goto c01_026a; -c02_026a:; +c01_026a:; - i8 v3193 = (i8)(intptr_t)c02_s0118; + i8 v3193 = (i8)(intptr_t)c01_s0118; *(i8*)(intptr_t)(ws+4320) = v3193; - i8 v3194 = (i8)(intptr_t)(f92_E); + i8 v3194 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3194)(); i8 v3195 = (i8)(intptr_t)(ws+4225); i1 v3196 = *(i1*)(intptr_t)v3195; *(i1*)(intptr_t)(ws+4264) = v3196; - i8 v3197 = (i8)(intptr_t)(f95_E_u8); + i8 v3197 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v3197)(); - i8 v3198 = (i8)(intptr_t)c02_s0119; + i8 v3198 = (i8)(intptr_t)c01_s0119; *(i8*)(intptr_t)(ws+4320) = v3198; - i8 v3199 = (i8)(intptr_t)(f92_E); + i8 v3199 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3199)(); i8 v3200 = (i8)(intptr_t)(ws+4224); i1 v3201 = *(i1*)(intptr_t)v3200; *(i1*)(intptr_t)(ws+4264) = v3201; - i8 v3202 = (i8)(intptr_t)(f95_E_u8); + i8 v3202 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v3202)(); - i8 v3203 = (i8)(intptr_t)c02_s011a; + i8 v3203 = (i8)(intptr_t)c01_s011a; *(i8*)(intptr_t)(ws+4320) = v3203; - i8 v3204 = (i8)(intptr_t)(f92_E); + i8 v3204 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3204)(); -c02_026b:; +c01_026b:; -c02_0267:; +c01_0267:; - i8 v3205 = (i8)(intptr_t)c02_s011b; + i8 v3205 = (i8)(intptr_t)c01_s011b; *(i8*)(intptr_t)(ws+4320) = v3205; - i8 v3206 = (i8)(intptr_t)(f92_E); + i8 v3206 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3206)(); i8 v3207 = (i8)(intptr_t)(ws+4230); i2 v3208 = *(i2*)(intptr_t)v3207; *(i2*)(intptr_t)(ws+4272) = v3208; - i8 v3209 = (i8)(intptr_t)(f94_E_u16); + i8 v3209 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3209)(); - i8 v3210 = (i8)(intptr_t)c02_s011c; + i8 v3210 = (i8)(intptr_t)c01_s011c; *(i8*)(intptr_t)(ws+4320) = v3210; - i8 v3211 = (i8)(intptr_t)(f92_E); + i8 v3211 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3211)(); } - void f106_EmitterOpenStream(void); -const i1 c02_s011d[] = { 0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x31,0x20,0 }; - void f92_E(void); - void f83_E_b8(void); - void f83_E_b8(void); - void f101_E_h16(void); -const i1 c02_s011e[] = { 0x5b,0x5d,0x20,0x3d,0x20,0x7b,0x20,0 }; - void f92_E(void); - void f87_E_comma(void); -const i1 c02_s011f[] = { 0x30,0x78,0 }; - void f92_E(void); - void f100_E_h8(void); - void f87_E_comma(void); -const i1 c02_s0120[] = { 0x30,0x20,0x7d,0x3b,0x0a,0 }; - void f92_E(void); - void f107_EmitterCloseStream(void); + void f105_EmitterOpenStream(void); +const i1 c01_s011d[] = { 0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x31,0x20,0 }; + void f91_E(void); + void f82_E_b8(void); + void f82_E_b8(void); + void f100_E_h16(void); +const i1 c01_s011e[] = { 0x5b,0x5d,0x20,0x3d,0x20,0x7b,0x20,0 }; + void f91_E(void); + void f86_E_comma(void); +const i1 c01_s011f[] = { 0x30,0x78,0 }; + void f91_E(void); + void f99_E_h8(void); + void f86_E_comma(void); +const i1 c01_s0120[] = { 0x30,0x20,0x7d,0x3b,0x0a,0 }; + void f91_E(void); + void f106_EmitterCloseStream(void); // E_string workspace at ws+4232 length ws+12 -void f184_E_string(void) { +void f183_E_string(void) { i8 v3214 = (i8)(intptr_t)(ws+3836); i2 v3215 = *(i2*)(intptr_t)v3214; @@ -7178,38 +7178,38 @@ void f184_E_string(void) { i8 v3221 = (i8)(intptr_t)(ws+40); i8 v3222 = *(i8*)(intptr_t)v3221; *(i8*)(intptr_t)(ws+4248) = v3222; - i8 v3223 = (i8)(intptr_t)(f106_EmitterOpenStream); + i8 v3223 = (i8)(intptr_t)(f105_EmitterOpenStream); ((void(*)(void))(intptr_t)v3223)(); - i8 v3224 = (i8)(intptr_t)c02_s011d; + i8 v3224 = (i8)(intptr_t)c01_s011d; *(i8*)(intptr_t)(ws+4320) = v3224; - i8 v3225 = (i8)(intptr_t)(f92_E); + i8 v3225 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3225)(); i1 v3226 = (i1)+3; *(i1*)(intptr_t)(ws+4336) = v3226; - i8 v3227 = (i8)(intptr_t)(f83_E_b8); + i8 v3227 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v3227)(); i1 v3228 = (i1)+115; *(i1*)(intptr_t)(ws+4336) = v3228; - i8 v3229 = (i8)(intptr_t)(f83_E_b8); + i8 v3229 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v3229)(); i8 v3230 = (i8)(intptr_t)(ws+4240); i2 v3231 = *(i2*)(intptr_t)v3230; *(i2*)(intptr_t)(ws+4272) = v3231; - i8 v3232 = (i8)(intptr_t)(f101_E_h16); + i8 v3232 = (i8)(intptr_t)(f100_E_h16); ((void(*)(void))(intptr_t)v3232)(); - i8 v3233 = (i8)(intptr_t)c02_s011e; + i8 v3233 = (i8)(intptr_t)c01_s011e; *(i8*)(intptr_t)(ws+4320) = v3233; - i8 v3234 = (i8)(intptr_t)(f92_E); + i8 v3234 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3234)(); @@ -7217,7 +7217,7 @@ void f184_E_string(void) { i8 v3236 = (i8)(intptr_t)(ws+4242); *(i1*)(intptr_t)v3236 = v3235; -c02_026c:; +c01_026c:; i8 v3237 = (i8)(intptr_t)(ws+4232); i8 v3238 = *(i8*)(intptr_t)v3237; @@ -7234,100 +7234,100 @@ c02_026c:; i8 v3245 = (i8)(intptr_t)(ws+4243); i1 v3246 = *(i1*)(intptr_t)v3245; i1 v3247 = (i1)+0; - if (v3246==v3247) goto c02_0271; else goto c02_0272; + if (v3246==v3247) goto c01_0271; else goto c01_0272; -c02_0271:; +c01_0271:; - goto c02_026d; + goto c01_026d; -c02_0272:; +c01_0272:; -c02_026e:; +c01_026e:; i8 v3248 = (i8)(intptr_t)(ws+4242); i1 v3249 = *(i1*)(intptr_t)v3248; i1 v3250 = (i1)+0; - if (v3249==v3250) goto c02_0276; else goto c02_0277; + if (v3249==v3250) goto c01_0276; else goto c01_0277; -c02_0276:; +c01_0276:; - i8 v3251 = (i8)(intptr_t)(f87_E_comma); + i8 v3251 = (i8)(intptr_t)(f86_E_comma); ((void(*)(void))(intptr_t)v3251)(); -c02_0277:; +c01_0277:; -c02_0273:; +c01_0273:; i1 v3252 = (i1)+0; i8 v3253 = (i8)(intptr_t)(ws+4242); *(i1*)(intptr_t)v3253 = v3252; - i8 v3254 = (i8)(intptr_t)c02_s011f; + i8 v3254 = (i8)(intptr_t)c01_s011f; *(i8*)(intptr_t)(ws+4320) = v3254; - i8 v3255 = (i8)(intptr_t)(f92_E); + i8 v3255 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3255)(); i8 v3256 = (i8)(intptr_t)(ws+4243); i1 v3257 = *(i1*)(intptr_t)v3256; *(i1*)(intptr_t)(ws+4248) = v3257; - i8 v3258 = (i8)(intptr_t)(f100_E_h8); + i8 v3258 = (i8)(intptr_t)(f99_E_h8); ((void(*)(void))(intptr_t)v3258)(); - goto c02_026c; + goto c01_026c; -c02_026d:; +c01_026d:; i8 v3259 = (i8)(intptr_t)(ws+4242); i1 v3260 = *(i1*)(intptr_t)v3259; i1 v3261 = (i1)+0; - if (v3260==v3261) goto c02_027b; else goto c02_027c; + if (v3260==v3261) goto c01_027b; else goto c01_027c; -c02_027b:; +c01_027b:; - i8 v3262 = (i8)(intptr_t)(f87_E_comma); + i8 v3262 = (i8)(intptr_t)(f86_E_comma); ((void(*)(void))(intptr_t)v3262)(); -c02_027c:; +c01_027c:; -c02_0278:; +c01_0278:; - i8 v3263 = (i8)(intptr_t)c02_s0120; + i8 v3263 = (i8)(intptr_t)c01_s0120; *(i8*)(intptr_t)(ws+4320) = v3263; - i8 v3264 = (i8)(intptr_t)(f92_E); + i8 v3264 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3264)(); - i8 v3265 = (i8)(intptr_t)(f107_EmitterCloseStream); + i8 v3265 = (i8)(intptr_t)(f106_EmitterCloseStream); ((void(*)(void))(intptr_t)v3265)(); } -const i1 c02_s0121[] = { 0x09,0x7b,0x20,0x2e,0x69,0x31,0x20,0x3d,0x20,0x7b,0x20,0 }; - void f92_E(void); - void f87_E_comma(void); -const i1 c02_s0122[] = { 0x30,0x78,0 }; - void f92_E(void); - void f100_E_h8(void); -const i1 c02_s0123[] = { 0x7d,0x7d,0x2c,0x0a,0 }; - void f92_E(void); +const i1 c01_s0121[] = { 0x09,0x7b,0x20,0x2e,0x69,0x31,0x20,0x3d,0x20,0x7b,0x20,0 }; + void f91_E(void); + void f86_E_comma(void); +const i1 c01_s0122[] = { 0x30,0x78,0 }; + void f91_E(void); + void f99_E_h8(void); +const i1 c01_s0123[] = { 0x7d,0x7d,0x2c,0x0a,0 }; + void f91_E(void); // FlushInitialiserBuffer workspace at ws+4240 length ws+1 -void f185_FlushInitialiserBuffer(void) { +void f184_FlushInitialiserBuffer(void) { i8 v3268 = (i8)(intptr_t)(ws+3846); i1 v3269 = *(i1*)(intptr_t)v3268; i1 v3270 = (i1)+0; - if (v3269==v3270) goto c02_0281; else goto c02_0280; + if (v3269==v3270) goto c01_0281; else goto c01_0280; -c02_0280:; +c01_0280:; - i8 v3271 = (i8)(intptr_t)c02_s0121; + i8 v3271 = (i8)(intptr_t)c01_s0121; *(i8*)(intptr_t)(ws+4320) = v3271; - i8 v3272 = (i8)(intptr_t)(f92_E); + i8 v3272 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3272)(); @@ -7335,34 +7335,34 @@ c02_0280:; i8 v3274 = (i8)(intptr_t)(ws+4240); *(i1*)(intptr_t)v3274 = v3273; -c02_0282:; +c01_0282:; i8 v3275 = (i8)(intptr_t)(ws+4240); i1 v3276 = *(i1*)(intptr_t)v3275; i8 v3277 = (i8)(intptr_t)(ws+3846); i1 v3278 = *(i1*)(intptr_t)v3277; - if (v3276==v3278) goto c02_0287; else goto c02_0286; + if (v3276==v3278) goto c01_0287; else goto c01_0286; -c02_0286:; +c01_0286:; i8 v3279 = (i8)(intptr_t)(ws+4240); i1 v3280 = *(i1*)(intptr_t)v3279; i1 v3281 = (i1)+0; - if (v3280==v3281) goto c02_028c; else goto c02_028b; + if (v3280==v3281) goto c01_028c; else goto c01_028b; -c02_028b:; +c01_028b:; - i8 v3282 = (i8)(intptr_t)(f87_E_comma); + i8 v3282 = (i8)(intptr_t)(f86_E_comma); ((void(*)(void))(intptr_t)v3282)(); -c02_028c:; +c01_028c:; -c02_0288:; +c01_0288:; - i8 v3283 = (i8)(intptr_t)c02_s0122; + i8 v3283 = (i8)(intptr_t)c01_s0122; *(i8*)(intptr_t)(ws+4320) = v3283; - i8 v3284 = (i8)(intptr_t)(f92_E); + i8 v3284 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3284)(); @@ -7373,7 +7373,7 @@ c02_0288:; i8 v3289 = v3285+v3288; i1 v3290 = *(i1*)(intptr_t)v3289; *(i1*)(intptr_t)(ws+4248) = v3290; - i8 v3291 = (i8)(intptr_t)(f100_E_h8); + i8 v3291 = (i8)(intptr_t)(f99_E_h8); ((void(*)(void))(intptr_t)v3291)(); @@ -7383,13 +7383,13 @@ c02_0288:; i8 v3295 = (i8)(intptr_t)(ws+4240); *(i1*)(intptr_t)v3295 = v3294; - goto c02_0282; + goto c01_0282; -c02_0287:; +c01_0287:; - i8 v3296 = (i8)(intptr_t)c02_s0123; + i8 v3296 = (i8)(intptr_t)c01_s0123; *(i8*)(intptr_t)(ws+4320) = v3296; - i8 v3297 = (i8)(intptr_t)(f92_E); + i8 v3297 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3297)(); @@ -7397,24 +7397,24 @@ c02_0287:; i8 v3299 = (i8)(intptr_t)(ws+3846); *(i1*)(intptr_t)v3299 = v3298; -c02_0281:; +c01_0281:; -c02_027d:; +c01_027d:; } - void f185_FlushInitialiserBuffer(void); + void f184_FlushInitialiserBuffer(void); // E_bytes workspace at ws+4224 length ws+9 -void f186_E_bytes(void) { +void f185_E_bytes(void) { -c02_028d:; +c01_028d:; i8 v3300 = (i8)(intptr_t)(ws+4232); i1 v3301 = *(i1*)(intptr_t)v3300; i1 v3302 = (i1)+0; - if (v3301==v3302) goto c02_0292; else goto c02_0291; + if (v3301==v3302) goto c01_0292; else goto c01_0291; -c02_0291:; +c01_0291:; i8 v3303 = (i8)(intptr_t)(ws+4224); i8 v3304 = *(i8*)(intptr_t)v3303; @@ -7441,17 +7441,17 @@ c02_0291:; i8 v3319 = (i8)(intptr_t)(ws+3846); i1 v3320 = *(i1*)(intptr_t)v3319; i1 v3321 = (i1)+8; - if (v3320==v3321) goto c02_0296; else goto c02_0297; + if (v3320==v3321) goto c01_0296; else goto c01_0297; -c02_0296:; +c01_0296:; - i8 v3322 = (i8)(intptr_t)(f185_FlushInitialiserBuffer); + i8 v3322 = (i8)(intptr_t)(f184_FlushInitialiserBuffer); ((void(*)(void))(intptr_t)v3322)(); -c02_0297:; +c01_0297:; -c02_0293:; +c01_0293:; i8 v3323 = (i8)(intptr_t)(ws+4232); i1 v3324 = *(i1*)(intptr_t)v3323; @@ -7459,57 +7459,57 @@ c02_0293:; i8 v3326 = (i8)(intptr_t)(ws+4232); *(i1*)(intptr_t)v3326 = v3325; - goto c02_028d; + goto c01_028d; -c02_0292:; +c01_0292:; } - void f66_StartError(void); -const i1 c02_s0124[] = { 0x62,0x61,0x64,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x69,0x73,0x65,0x72,0x20,0x61,0x6c,0x69,0x67,0x6e,0x6d,0x65,0x6e,0x74,0x3a,0x20,0 }; - void f12_print(void); - void f18_print_i8(void); - void f67_EndError(void); + void f65_StartError(void); +const i1 c01_s0124[] = { 0x62,0x61,0x64,0x20,0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x69,0x73,0x65,0x72,0x20,0x61,0x6c,0x69,0x67,0x6e,0x6d,0x65,0x6e,0x74,0x3a,0x20,0 }; + void f11_print(void); + void f17_print_i8(void); + void f66_EndError(void); // CheckBufferAlignment workspace at ws+4232 length ws+0 -void f187_CheckBufferAlignment(void) { +void f186_CheckBufferAlignment(void) { i8 v3327 = (i8)(intptr_t)(ws+3846); i1 v3328 = *(i1*)(intptr_t)v3327; i1 v3329 = (i1)+0; - if (v3328==v3329) goto c02_029c; else goto c02_029b; + if (v3328==v3329) goto c01_029c; else goto c01_029b; -c02_029b:; +c01_029b:; - i8 v3330 = (i8)(intptr_t)(f66_StartError); + i8 v3330 = (i8)(intptr_t)(f65_StartError); ((void(*)(void))(intptr_t)v3330)(); - i8 v3331 = (i8)(intptr_t)c02_s0124; + i8 v3331 = (i8)(intptr_t)c01_s0124; *(i8*)(intptr_t)(ws+4288) = v3331; - i8 v3332 = (i8)(intptr_t)(f12_print); + i8 v3332 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v3332)(); i8 v3333 = (i8)(intptr_t)(ws+3846); i1 v3334 = *(i1*)(intptr_t)v3333; *(i1*)(intptr_t)(ws+4232) = v3334; - i8 v3335 = (i8)(intptr_t)(f18_print_i8); + i8 v3335 = (i8)(intptr_t)(f17_print_i8); ((void(*)(void))(intptr_t)v3335)(); - i8 v3336 = (i8)(intptr_t)(f67_EndError); + i8 v3336 = (i8)(intptr_t)(f66_EndError); ((void(*)(void))(intptr_t)v3336)(); -c02_029c:; +c01_029c:; -c02_0298:; +c01_0298:; } - void f31_MemCopy(void); + void f30_MemCopy(void); // MatchPredicate workspace at ws+4208 length ws+56 -void f188_MatchPredicate(void) { +void f187_MatchPredicate(void) { i8 v3337 = (i8)(intptr_t)(ws+4216); i8 v3338 = *(i8*)(intptr_t)v3337; @@ -7518,7 +7518,7 @@ void f188_MatchPredicate(void) { *(i8*)(intptr_t)(ws+4272) = v3339; i8 v3340 = (i8)(intptr_t)(ws+4232); *(i8*)(intptr_t)(ws+4280) = v3340; - i8 v3341 = (i8)(intptr_t)(f31_MemCopy); + i8 v3341 = (i8)(intptr_t)(f30_MemCopy); ((void(*)(void))(intptr_t)v3341)(); @@ -7529,19 +7529,19 @@ void f188_MatchPredicate(void) { i8 v3344 = (i8)(intptr_t)(ws+4208); i1 v3345 = *(i1*)(intptr_t)v3344; -c02_029d:; +c01_029d:; } // Emitter workspace at ws+4224 length ws+0 -void f190_Emitter(void) { +void f189_Emitter(void) { } - void f181_BranchConstant(void); + void f180_BranchConstant(void); // emit_0 workspace at ws+4224 length ws+0 -void f191_emit_0(void) { +void f190_emit_0(void) { i8 v3391 = (i8)(intptr_t)(ws+4128); i8 v3392 = *(i8*)(intptr_t)v3391; @@ -7556,853 +7556,853 @@ void f191_emit_0(void) { i8 v3399 = *(i8*)(intptr_t)v3398; i4 v3400 = *(i4*)(intptr_t)v3399; *(i4*)(intptr_t)(ws+4236) = v3400; - i8 v3401 = (i8)(intptr_t)(f181_BranchConstant); + i8 v3401 = (i8)(intptr_t)(f180_BranchConstant); ((void(*)(void))(intptr_t)v3401)(); } - void f171_StoreVV(void); + void f170_StoreVV(void); // emit_1 workspace at ws+4224 length ws+0 -void f192_emit_1(void) { +void f191_emit_1(void) { i1 v3402 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3402; - i8 v3403 = (i8)(intptr_t)(f171_StoreVV); + i8 v3403 = (i8)(intptr_t)(f170_StoreVV); ((void(*)(void))(intptr_t)v3403)(); } - void f171_StoreVV(void); + void f170_StoreVV(void); // emit_2 workspace at ws+4224 length ws+0 -void f193_emit_2(void) { +void f192_emit_2(void) { i1 v3404 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3404; - i8 v3405 = (i8)(intptr_t)(f171_StoreVV); + i8 v3405 = (i8)(intptr_t)(f170_StoreVV); ((void(*)(void))(intptr_t)v3405)(); } - void f171_StoreVV(void); + void f170_StoreVV(void); // emit_3 workspace at ws+4224 length ws+0 -void f194_emit_3(void) { +void f193_emit_3(void) { i1 v3406 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3406; - i8 v3407 = (i8)(intptr_t)(f171_StoreVV); + i8 v3407 = (i8)(intptr_t)(f170_StoreVV); ((void(*)(void))(intptr_t)v3407)(); } - void f171_StoreVV(void); + void f170_StoreVV(void); // emit_4 workspace at ws+4224 length ws+0 -void f195_emit_4(void) { +void f194_emit_4(void) { i1 v3408 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3408; - i8 v3409 = (i8)(intptr_t)(f171_StoreVV); + i8 v3409 = (i8)(intptr_t)(f170_StoreVV); ((void(*)(void))(intptr_t)v3409)(); } -const i1 c02_s0125[] = { 0x2b,0 }; - void f174_Op2VC(void); +const i1 c01_s0125[] = { 0x2b,0 }; + void f173_Op2VC(void); // emit_5 workspace at ws+4224 length ws+0 -void f196_emit_5(void) { +void f195_emit_5(void) { i1 v3410 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3410; - i8 v3411 = (i8)(intptr_t)c02_s0125; + i8 v3411 = (i8)(intptr_t)c01_s0125; *(i8*)(intptr_t)(ws+4232) = v3411; i8 v3412 = (i8)(intptr_t)(ws+4168); i8 v3413 = *(i8*)(intptr_t)v3412; i4 v3414 = *(i4*)(intptr_t)v3413; *(i4*)(intptr_t)(ws+4240) = v3414; - i8 v3415 = (i8)(intptr_t)(f174_Op2VC); + i8 v3415 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3415)(); } -const i1 c02_s0126[] = { 0x2b,0 }; - void f174_Op2VC(void); +const i1 c01_s0126[] = { 0x2b,0 }; + void f173_Op2VC(void); // emit_6 workspace at ws+4224 length ws+0 -void f197_emit_6(void) { +void f196_emit_6(void) { i1 v3416 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3416; - i8 v3417 = (i8)(intptr_t)c02_s0126; + i8 v3417 = (i8)(intptr_t)c01_s0126; *(i8*)(intptr_t)(ws+4232) = v3417; i8 v3418 = (i8)(intptr_t)(ws+4168); i8 v3419 = *(i8*)(intptr_t)v3418; i4 v3420 = *(i4*)(intptr_t)v3419; *(i4*)(intptr_t)(ws+4240) = v3420; - i8 v3421 = (i8)(intptr_t)(f174_Op2VC); + i8 v3421 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3421)(); } -const i1 c02_s0127[] = { 0x2b,0 }; - void f174_Op2VC(void); +const i1 c01_s0127[] = { 0x2b,0 }; + void f173_Op2VC(void); // emit_7 workspace at ws+4224 length ws+0 -void f198_emit_7(void) { +void f197_emit_7(void) { i1 v3422 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3422; - i8 v3423 = (i8)(intptr_t)c02_s0127; + i8 v3423 = (i8)(intptr_t)c01_s0127; *(i8*)(intptr_t)(ws+4232) = v3423; i8 v3424 = (i8)(intptr_t)(ws+4168); i8 v3425 = *(i8*)(intptr_t)v3424; i4 v3426 = *(i4*)(intptr_t)v3425; *(i4*)(intptr_t)(ws+4240) = v3426; - i8 v3427 = (i8)(intptr_t)(f174_Op2VC); + i8 v3427 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3427)(); } -const i1 c02_s0128[] = { 0x2b,0 }; - void f174_Op2VC(void); +const i1 c01_s0128[] = { 0x2b,0 }; + void f173_Op2VC(void); // emit_8 workspace at ws+4224 length ws+0 -void f199_emit_8(void) { +void f198_emit_8(void) { i1 v3428 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3428; - i8 v3429 = (i8)(intptr_t)c02_s0128; + i8 v3429 = (i8)(intptr_t)c01_s0128; *(i8*)(intptr_t)(ws+4232) = v3429; i8 v3430 = (i8)(intptr_t)(ws+4168); i8 v3431 = *(i8*)(intptr_t)v3430; i4 v3432 = *(i4*)(intptr_t)v3431; *(i4*)(intptr_t)(ws+4240) = v3432; - i8 v3433 = (i8)(intptr_t)(f174_Op2VC); + i8 v3433 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3433)(); } -const i1 c02_s0129[] = { 0x2d,0 }; - void f174_Op2VC(void); +const i1 c01_s0129[] = { 0x2d,0 }; + void f173_Op2VC(void); // emit_9 workspace at ws+4224 length ws+0 -void f200_emit_9(void) { +void f199_emit_9(void) { i1 v3434 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3434; - i8 v3435 = (i8)(intptr_t)c02_s0129; + i8 v3435 = (i8)(intptr_t)c01_s0129; *(i8*)(intptr_t)(ws+4232) = v3435; i8 v3436 = (i8)(intptr_t)(ws+4168); i8 v3437 = *(i8*)(intptr_t)v3436; i4 v3438 = *(i4*)(intptr_t)v3437; *(i4*)(intptr_t)(ws+4240) = v3438; - i8 v3439 = (i8)(intptr_t)(f174_Op2VC); + i8 v3439 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3439)(); } -const i1 c02_s012a[] = { 0x2d,0 }; - void f174_Op2VC(void); +const i1 c01_s012a[] = { 0x2d,0 }; + void f173_Op2VC(void); // emit_10 workspace at ws+4224 length ws+0 -void f201_emit_10(void) { +void f200_emit_10(void) { i1 v3440 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3440; - i8 v3441 = (i8)(intptr_t)c02_s012a; + i8 v3441 = (i8)(intptr_t)c01_s012a; *(i8*)(intptr_t)(ws+4232) = v3441; i8 v3442 = (i8)(intptr_t)(ws+4168); i8 v3443 = *(i8*)(intptr_t)v3442; i4 v3444 = *(i4*)(intptr_t)v3443; *(i4*)(intptr_t)(ws+4240) = v3444; - i8 v3445 = (i8)(intptr_t)(f174_Op2VC); + i8 v3445 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3445)(); } -const i1 c02_s012b[] = { 0x2d,0 }; - void f174_Op2VC(void); +const i1 c01_s012b[] = { 0x2d,0 }; + void f173_Op2VC(void); // emit_11 workspace at ws+4224 length ws+0 -void f202_emit_11(void) { +void f201_emit_11(void) { i1 v3446 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3446; - i8 v3447 = (i8)(intptr_t)c02_s012b; + i8 v3447 = (i8)(intptr_t)c01_s012b; *(i8*)(intptr_t)(ws+4232) = v3447; i8 v3448 = (i8)(intptr_t)(ws+4168); i8 v3449 = *(i8*)(intptr_t)v3448; i4 v3450 = *(i4*)(intptr_t)v3449; *(i4*)(intptr_t)(ws+4240) = v3450; - i8 v3451 = (i8)(intptr_t)(f174_Op2VC); + i8 v3451 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3451)(); } -const i1 c02_s012c[] = { 0x2d,0 }; - void f174_Op2VC(void); +const i1 c01_s012c[] = { 0x2d,0 }; + void f173_Op2VC(void); // emit_12 workspace at ws+4224 length ws+0 -void f203_emit_12(void) { +void f202_emit_12(void) { i1 v3452 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3452; - i8 v3453 = (i8)(intptr_t)c02_s012c; + i8 v3453 = (i8)(intptr_t)c01_s012c; *(i8*)(intptr_t)(ws+4232) = v3453; i8 v3454 = (i8)(intptr_t)(ws+4168); i8 v3455 = *(i8*)(intptr_t)v3454; i4 v3456 = *(i4*)(intptr_t)v3455; *(i4*)(intptr_t)(ws+4240) = v3456; - i8 v3457 = (i8)(intptr_t)(f174_Op2VC); + i8 v3457 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3457)(); } -const i1 c02_s012d[] = { 0x2a,0 }; - void f174_Op2VC(void); +const i1 c01_s012d[] = { 0x2a,0 }; + void f173_Op2VC(void); // emit_13 workspace at ws+4224 length ws+0 -void f204_emit_13(void) { +void f203_emit_13(void) { i1 v3458 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3458; - i8 v3459 = (i8)(intptr_t)c02_s012d; + i8 v3459 = (i8)(intptr_t)c01_s012d; *(i8*)(intptr_t)(ws+4232) = v3459; i8 v3460 = (i8)(intptr_t)(ws+4168); i8 v3461 = *(i8*)(intptr_t)v3460; i4 v3462 = *(i4*)(intptr_t)v3461; *(i4*)(intptr_t)(ws+4240) = v3462; - i8 v3463 = (i8)(intptr_t)(f174_Op2VC); + i8 v3463 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3463)(); } -const i1 c02_s012e[] = { 0x2a,0 }; - void f174_Op2VC(void); +const i1 c01_s012e[] = { 0x2a,0 }; + void f173_Op2VC(void); // emit_14 workspace at ws+4224 length ws+0 -void f205_emit_14(void) { +void f204_emit_14(void) { i1 v3464 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3464; - i8 v3465 = (i8)(intptr_t)c02_s012e; + i8 v3465 = (i8)(intptr_t)c01_s012e; *(i8*)(intptr_t)(ws+4232) = v3465; i8 v3466 = (i8)(intptr_t)(ws+4168); i8 v3467 = *(i8*)(intptr_t)v3466; i4 v3468 = *(i4*)(intptr_t)v3467; *(i4*)(intptr_t)(ws+4240) = v3468; - i8 v3469 = (i8)(intptr_t)(f174_Op2VC); + i8 v3469 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3469)(); } -const i1 c02_s012f[] = { 0x2a,0 }; - void f174_Op2VC(void); +const i1 c01_s012f[] = { 0x2a,0 }; + void f173_Op2VC(void); // emit_15 workspace at ws+4224 length ws+0 -void f206_emit_15(void) { +void f205_emit_15(void) { i1 v3470 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3470; - i8 v3471 = (i8)(intptr_t)c02_s012f; + i8 v3471 = (i8)(intptr_t)c01_s012f; *(i8*)(intptr_t)(ws+4232) = v3471; i8 v3472 = (i8)(intptr_t)(ws+4168); i8 v3473 = *(i8*)(intptr_t)v3472; i4 v3474 = *(i4*)(intptr_t)v3473; *(i4*)(intptr_t)(ws+4240) = v3474; - i8 v3475 = (i8)(intptr_t)(f174_Op2VC); + i8 v3475 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3475)(); } -const i1 c02_s0130[] = { 0x2a,0 }; - void f174_Op2VC(void); +const i1 c01_s0130[] = { 0x2a,0 }; + void f173_Op2VC(void); // emit_16 workspace at ws+4224 length ws+0 -void f207_emit_16(void) { +void f206_emit_16(void) { i1 v3476 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3476; - i8 v3477 = (i8)(intptr_t)c02_s0130; + i8 v3477 = (i8)(intptr_t)c01_s0130; *(i8*)(intptr_t)(ws+4232) = v3477; i8 v3478 = (i8)(intptr_t)(ws+4168); i8 v3479 = *(i8*)(intptr_t)v3478; i4 v3480 = *(i4*)(intptr_t)v3479; *(i4*)(intptr_t)(ws+4240) = v3480; - i8 v3481 = (i8)(intptr_t)(f174_Op2VC); + i8 v3481 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3481)(); } -const i1 c02_s0131[] = { 0x2f,0 }; - void f174_Op2VC(void); +const i1 c01_s0131[] = { 0x2f,0 }; + void f173_Op2VC(void); // emit_17 workspace at ws+4224 length ws+0 -void f208_emit_17(void) { +void f207_emit_17(void) { i1 v3482 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3482; - i8 v3483 = (i8)(intptr_t)c02_s0131; + i8 v3483 = (i8)(intptr_t)c01_s0131; *(i8*)(intptr_t)(ws+4232) = v3483; i8 v3484 = (i8)(intptr_t)(ws+4168); i8 v3485 = *(i8*)(intptr_t)v3484; i4 v3486 = *(i4*)(intptr_t)v3485; *(i4*)(intptr_t)(ws+4240) = v3486; - i8 v3487 = (i8)(intptr_t)(f174_Op2VC); + i8 v3487 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3487)(); } -const i1 c02_s0132[] = { 0x2f,0 }; - void f174_Op2VC(void); +const i1 c01_s0132[] = { 0x2f,0 }; + void f173_Op2VC(void); // emit_18 workspace at ws+4224 length ws+0 -void f209_emit_18(void) { +void f208_emit_18(void) { i1 v3488 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3488; - i8 v3489 = (i8)(intptr_t)c02_s0132; + i8 v3489 = (i8)(intptr_t)c01_s0132; *(i8*)(intptr_t)(ws+4232) = v3489; i8 v3490 = (i8)(intptr_t)(ws+4168); i8 v3491 = *(i8*)(intptr_t)v3490; i4 v3492 = *(i4*)(intptr_t)v3491; *(i4*)(intptr_t)(ws+4240) = v3492; - i8 v3493 = (i8)(intptr_t)(f174_Op2VC); + i8 v3493 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3493)(); } -const i1 c02_s0133[] = { 0x2f,0 }; - void f174_Op2VC(void); +const i1 c01_s0133[] = { 0x2f,0 }; + void f173_Op2VC(void); // emit_19 workspace at ws+4224 length ws+0 -void f210_emit_19(void) { +void f209_emit_19(void) { i1 v3494 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3494; - i8 v3495 = (i8)(intptr_t)c02_s0133; + i8 v3495 = (i8)(intptr_t)c01_s0133; *(i8*)(intptr_t)(ws+4232) = v3495; i8 v3496 = (i8)(intptr_t)(ws+4168); i8 v3497 = *(i8*)(intptr_t)v3496; i4 v3498 = *(i4*)(intptr_t)v3497; *(i4*)(intptr_t)(ws+4240) = v3498; - i8 v3499 = (i8)(intptr_t)(f174_Op2VC); + i8 v3499 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3499)(); } -const i1 c02_s0134[] = { 0x2f,0 }; - void f174_Op2VC(void); +const i1 c01_s0134[] = { 0x2f,0 }; + void f173_Op2VC(void); // emit_20 workspace at ws+4224 length ws+0 -void f211_emit_20(void) { +void f210_emit_20(void) { i1 v3500 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3500; - i8 v3501 = (i8)(intptr_t)c02_s0134; + i8 v3501 = (i8)(intptr_t)c01_s0134; *(i8*)(intptr_t)(ws+4232) = v3501; i8 v3502 = (i8)(intptr_t)(ws+4168); i8 v3503 = *(i8*)(intptr_t)v3502; i4 v3504 = *(i4*)(intptr_t)v3503; *(i4*)(intptr_t)(ws+4240) = v3504; - i8 v3505 = (i8)(intptr_t)(f174_Op2VC); + i8 v3505 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3505)(); } -const i1 c02_s0135[] = { 0x25,0 }; - void f174_Op2VC(void); +const i1 c01_s0135[] = { 0x25,0 }; + void f173_Op2VC(void); // emit_21 workspace at ws+4224 length ws+0 -void f212_emit_21(void) { +void f211_emit_21(void) { i1 v3506 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3506; - i8 v3507 = (i8)(intptr_t)c02_s0135; + i8 v3507 = (i8)(intptr_t)c01_s0135; *(i8*)(intptr_t)(ws+4232) = v3507; i8 v3508 = (i8)(intptr_t)(ws+4168); i8 v3509 = *(i8*)(intptr_t)v3508; i4 v3510 = *(i4*)(intptr_t)v3509; *(i4*)(intptr_t)(ws+4240) = v3510; - i8 v3511 = (i8)(intptr_t)(f174_Op2VC); + i8 v3511 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3511)(); } -const i1 c02_s0136[] = { 0x25,0 }; - void f174_Op2VC(void); +const i1 c01_s0136[] = { 0x25,0 }; + void f173_Op2VC(void); // emit_22 workspace at ws+4224 length ws+0 -void f213_emit_22(void) { +void f212_emit_22(void) { i1 v3512 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3512; - i8 v3513 = (i8)(intptr_t)c02_s0136; + i8 v3513 = (i8)(intptr_t)c01_s0136; *(i8*)(intptr_t)(ws+4232) = v3513; i8 v3514 = (i8)(intptr_t)(ws+4168); i8 v3515 = *(i8*)(intptr_t)v3514; i4 v3516 = *(i4*)(intptr_t)v3515; *(i4*)(intptr_t)(ws+4240) = v3516; - i8 v3517 = (i8)(intptr_t)(f174_Op2VC); + i8 v3517 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3517)(); } -const i1 c02_s0137[] = { 0x25,0 }; - void f174_Op2VC(void); +const i1 c01_s0137[] = { 0x25,0 }; + void f173_Op2VC(void); // emit_23 workspace at ws+4224 length ws+0 -void f214_emit_23(void) { +void f213_emit_23(void) { i1 v3518 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3518; - i8 v3519 = (i8)(intptr_t)c02_s0137; + i8 v3519 = (i8)(intptr_t)c01_s0137; *(i8*)(intptr_t)(ws+4232) = v3519; i8 v3520 = (i8)(intptr_t)(ws+4168); i8 v3521 = *(i8*)(intptr_t)v3520; i4 v3522 = *(i4*)(intptr_t)v3521; *(i4*)(intptr_t)(ws+4240) = v3522; - i8 v3523 = (i8)(intptr_t)(f174_Op2VC); + i8 v3523 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3523)(); } -const i1 c02_s0138[] = { 0x25,0 }; - void f174_Op2VC(void); +const i1 c01_s0138[] = { 0x25,0 }; + void f173_Op2VC(void); // emit_24 workspace at ws+4224 length ws+0 -void f215_emit_24(void) { +void f214_emit_24(void) { i1 v3524 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3524; - i8 v3525 = (i8)(intptr_t)c02_s0138; + i8 v3525 = (i8)(intptr_t)c01_s0138; *(i8*)(intptr_t)(ws+4232) = v3525; i8 v3526 = (i8)(intptr_t)(ws+4168); i8 v3527 = *(i8*)(intptr_t)v3526; i4 v3528 = *(i4*)(intptr_t)v3527; *(i4*)(intptr_t)(ws+4240) = v3528; - i8 v3529 = (i8)(intptr_t)(f174_Op2VC); + i8 v3529 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3529)(); } -const i1 c02_s0139[] = { 0x2f,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s0139[] = { 0x2f,0 }; + void f175_Op2VCSigned(void); // emit_25 workspace at ws+4224 length ws+0 -void f216_emit_25(void) { +void f215_emit_25(void) { i1 v3530 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3530; - i8 v3531 = (i8)(intptr_t)c02_s0139; + i8 v3531 = (i8)(intptr_t)c01_s0139; *(i8*)(intptr_t)(ws+4232) = v3531; i8 v3532 = (i8)(intptr_t)(ws+4168); i8 v3533 = *(i8*)(intptr_t)v3532; i4 v3534 = *(i4*)(intptr_t)v3533; *(i4*)(intptr_t)(ws+4240) = v3534; - i8 v3535 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3535 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3535)(); } -const i1 c02_s013a[] = { 0x2f,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s013a[] = { 0x2f,0 }; + void f175_Op2VCSigned(void); // emit_26 workspace at ws+4224 length ws+0 -void f217_emit_26(void) { +void f216_emit_26(void) { i1 v3536 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3536; - i8 v3537 = (i8)(intptr_t)c02_s013a; + i8 v3537 = (i8)(intptr_t)c01_s013a; *(i8*)(intptr_t)(ws+4232) = v3537; i8 v3538 = (i8)(intptr_t)(ws+4168); i8 v3539 = *(i8*)(intptr_t)v3538; i4 v3540 = *(i4*)(intptr_t)v3539; *(i4*)(intptr_t)(ws+4240) = v3540; - i8 v3541 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3541 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3541)(); } -const i1 c02_s013b[] = { 0x2f,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s013b[] = { 0x2f,0 }; + void f175_Op2VCSigned(void); // emit_27 workspace at ws+4224 length ws+0 -void f218_emit_27(void) { +void f217_emit_27(void) { i1 v3542 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3542; - i8 v3543 = (i8)(intptr_t)c02_s013b; + i8 v3543 = (i8)(intptr_t)c01_s013b; *(i8*)(intptr_t)(ws+4232) = v3543; i8 v3544 = (i8)(intptr_t)(ws+4168); i8 v3545 = *(i8*)(intptr_t)v3544; i4 v3546 = *(i4*)(intptr_t)v3545; *(i4*)(intptr_t)(ws+4240) = v3546; - i8 v3547 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3547 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3547)(); } -const i1 c02_s013c[] = { 0x2f,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s013c[] = { 0x2f,0 }; + void f175_Op2VCSigned(void); // emit_28 workspace at ws+4224 length ws+0 -void f219_emit_28(void) { +void f218_emit_28(void) { i1 v3548 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3548; - i8 v3549 = (i8)(intptr_t)c02_s013c; + i8 v3549 = (i8)(intptr_t)c01_s013c; *(i8*)(intptr_t)(ws+4232) = v3549; i8 v3550 = (i8)(intptr_t)(ws+4168); i8 v3551 = *(i8*)(intptr_t)v3550; i4 v3552 = *(i4*)(intptr_t)v3551; *(i4*)(intptr_t)(ws+4240) = v3552; - i8 v3553 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3553 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3553)(); } -const i1 c02_s013d[] = { 0x25,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s013d[] = { 0x25,0 }; + void f175_Op2VCSigned(void); // emit_29 workspace at ws+4224 length ws+0 -void f220_emit_29(void) { +void f219_emit_29(void) { i1 v3554 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3554; - i8 v3555 = (i8)(intptr_t)c02_s013d; + i8 v3555 = (i8)(intptr_t)c01_s013d; *(i8*)(intptr_t)(ws+4232) = v3555; i8 v3556 = (i8)(intptr_t)(ws+4168); i8 v3557 = *(i8*)(intptr_t)v3556; i4 v3558 = *(i4*)(intptr_t)v3557; *(i4*)(intptr_t)(ws+4240) = v3558; - i8 v3559 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3559 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3559)(); } -const i1 c02_s013e[] = { 0x25,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s013e[] = { 0x25,0 }; + void f175_Op2VCSigned(void); // emit_30 workspace at ws+4224 length ws+0 -void f221_emit_30(void) { +void f220_emit_30(void) { i1 v3560 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3560; - i8 v3561 = (i8)(intptr_t)c02_s013e; + i8 v3561 = (i8)(intptr_t)c01_s013e; *(i8*)(intptr_t)(ws+4232) = v3561; i8 v3562 = (i8)(intptr_t)(ws+4168); i8 v3563 = *(i8*)(intptr_t)v3562; i4 v3564 = *(i4*)(intptr_t)v3563; *(i4*)(intptr_t)(ws+4240) = v3564; - i8 v3565 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3565 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3565)(); } -const i1 c02_s013f[] = { 0x25,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s013f[] = { 0x25,0 }; + void f175_Op2VCSigned(void); // emit_31 workspace at ws+4224 length ws+0 -void f222_emit_31(void) { +void f221_emit_31(void) { i1 v3566 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3566; - i8 v3567 = (i8)(intptr_t)c02_s013f; + i8 v3567 = (i8)(intptr_t)c01_s013f; *(i8*)(intptr_t)(ws+4232) = v3567; i8 v3568 = (i8)(intptr_t)(ws+4168); i8 v3569 = *(i8*)(intptr_t)v3568; i4 v3570 = *(i4*)(intptr_t)v3569; *(i4*)(intptr_t)(ws+4240) = v3570; - i8 v3571 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3571 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3571)(); } -const i1 c02_s0140[] = { 0x25,0 }; - void f176_Op2VCSigned(void); +const i1 c01_s0140[] = { 0x25,0 }; + void f175_Op2VCSigned(void); // emit_32 workspace at ws+4224 length ws+0 -void f223_emit_32(void) { +void f222_emit_32(void) { i1 v3572 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3572; - i8 v3573 = (i8)(intptr_t)c02_s0140; + i8 v3573 = (i8)(intptr_t)c01_s0140; *(i8*)(intptr_t)(ws+4232) = v3573; i8 v3574 = (i8)(intptr_t)(ws+4168); i8 v3575 = *(i8*)(intptr_t)v3574; i4 v3576 = *(i4*)(intptr_t)v3575; *(i4*)(intptr_t)(ws+4240) = v3576; - i8 v3577 = (i8)(intptr_t)(f176_Op2VCSigned); + i8 v3577 = (i8)(intptr_t)(f175_Op2VCSigned); ((void(*)(void))(intptr_t)v3577)(); } -const i1 c02_s0141[] = { 0x26,0 }; - void f174_Op2VC(void); +const i1 c01_s0141[] = { 0x26,0 }; + void f173_Op2VC(void); // emit_33 workspace at ws+4224 length ws+0 -void f224_emit_33(void) { +void f223_emit_33(void) { i1 v3578 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3578; - i8 v3579 = (i8)(intptr_t)c02_s0141; + i8 v3579 = (i8)(intptr_t)c01_s0141; *(i8*)(intptr_t)(ws+4232) = v3579; i8 v3580 = (i8)(intptr_t)(ws+4168); i8 v3581 = *(i8*)(intptr_t)v3580; i4 v3582 = *(i4*)(intptr_t)v3581; *(i4*)(intptr_t)(ws+4240) = v3582; - i8 v3583 = (i8)(intptr_t)(f174_Op2VC); + i8 v3583 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3583)(); } -const i1 c02_s0142[] = { 0x26,0 }; - void f174_Op2VC(void); +const i1 c01_s0142[] = { 0x26,0 }; + void f173_Op2VC(void); // emit_34 workspace at ws+4224 length ws+0 -void f225_emit_34(void) { +void f224_emit_34(void) { i1 v3584 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3584; - i8 v3585 = (i8)(intptr_t)c02_s0142; + i8 v3585 = (i8)(intptr_t)c01_s0142; *(i8*)(intptr_t)(ws+4232) = v3585; i8 v3586 = (i8)(intptr_t)(ws+4168); i8 v3587 = *(i8*)(intptr_t)v3586; i4 v3588 = *(i4*)(intptr_t)v3587; *(i4*)(intptr_t)(ws+4240) = v3588; - i8 v3589 = (i8)(intptr_t)(f174_Op2VC); + i8 v3589 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3589)(); } -const i1 c02_s0143[] = { 0x26,0 }; - void f174_Op2VC(void); +const i1 c01_s0143[] = { 0x26,0 }; + void f173_Op2VC(void); // emit_35 workspace at ws+4224 length ws+0 -void f226_emit_35(void) { +void f225_emit_35(void) { i1 v3590 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3590; - i8 v3591 = (i8)(intptr_t)c02_s0143; + i8 v3591 = (i8)(intptr_t)c01_s0143; *(i8*)(intptr_t)(ws+4232) = v3591; i8 v3592 = (i8)(intptr_t)(ws+4168); i8 v3593 = *(i8*)(intptr_t)v3592; i4 v3594 = *(i4*)(intptr_t)v3593; *(i4*)(intptr_t)(ws+4240) = v3594; - i8 v3595 = (i8)(intptr_t)(f174_Op2VC); + i8 v3595 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3595)(); } -const i1 c02_s0144[] = { 0x26,0 }; - void f174_Op2VC(void); +const i1 c01_s0144[] = { 0x26,0 }; + void f173_Op2VC(void); // emit_36 workspace at ws+4224 length ws+0 -void f227_emit_36(void) { +void f226_emit_36(void) { i1 v3596 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3596; - i8 v3597 = (i8)(intptr_t)c02_s0144; + i8 v3597 = (i8)(intptr_t)c01_s0144; *(i8*)(intptr_t)(ws+4232) = v3597; i8 v3598 = (i8)(intptr_t)(ws+4168); i8 v3599 = *(i8*)(intptr_t)v3598; i4 v3600 = *(i4*)(intptr_t)v3599; *(i4*)(intptr_t)(ws+4240) = v3600; - i8 v3601 = (i8)(intptr_t)(f174_Op2VC); + i8 v3601 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3601)(); } -const i1 c02_s0145[] = { 0x7c,0 }; - void f174_Op2VC(void); +const i1 c01_s0145[] = { 0x7c,0 }; + void f173_Op2VC(void); // emit_37 workspace at ws+4224 length ws+0 -void f228_emit_37(void) { +void f227_emit_37(void) { i1 v3602 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3602; - i8 v3603 = (i8)(intptr_t)c02_s0145; + i8 v3603 = (i8)(intptr_t)c01_s0145; *(i8*)(intptr_t)(ws+4232) = v3603; i8 v3604 = (i8)(intptr_t)(ws+4168); i8 v3605 = *(i8*)(intptr_t)v3604; i4 v3606 = *(i4*)(intptr_t)v3605; *(i4*)(intptr_t)(ws+4240) = v3606; - i8 v3607 = (i8)(intptr_t)(f174_Op2VC); + i8 v3607 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3607)(); } -const i1 c02_s0146[] = { 0x7c,0 }; - void f174_Op2VC(void); +const i1 c01_s0146[] = { 0x7c,0 }; + void f173_Op2VC(void); // emit_38 workspace at ws+4224 length ws+0 -void f229_emit_38(void) { +void f228_emit_38(void) { i1 v3608 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3608; - i8 v3609 = (i8)(intptr_t)c02_s0146; + i8 v3609 = (i8)(intptr_t)c01_s0146; *(i8*)(intptr_t)(ws+4232) = v3609; i8 v3610 = (i8)(intptr_t)(ws+4168); i8 v3611 = *(i8*)(intptr_t)v3610; i4 v3612 = *(i4*)(intptr_t)v3611; *(i4*)(intptr_t)(ws+4240) = v3612; - i8 v3613 = (i8)(intptr_t)(f174_Op2VC); + i8 v3613 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3613)(); } -const i1 c02_s0147[] = { 0x7c,0 }; - void f174_Op2VC(void); +const i1 c01_s0147[] = { 0x7c,0 }; + void f173_Op2VC(void); // emit_39 workspace at ws+4224 length ws+0 -void f230_emit_39(void) { +void f229_emit_39(void) { i1 v3614 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3614; - i8 v3615 = (i8)(intptr_t)c02_s0147; + i8 v3615 = (i8)(intptr_t)c01_s0147; *(i8*)(intptr_t)(ws+4232) = v3615; i8 v3616 = (i8)(intptr_t)(ws+4168); i8 v3617 = *(i8*)(intptr_t)v3616; i4 v3618 = *(i4*)(intptr_t)v3617; *(i4*)(intptr_t)(ws+4240) = v3618; - i8 v3619 = (i8)(intptr_t)(f174_Op2VC); + i8 v3619 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3619)(); } -const i1 c02_s0148[] = { 0x7c,0 }; - void f174_Op2VC(void); +const i1 c01_s0148[] = { 0x7c,0 }; + void f173_Op2VC(void); // emit_40 workspace at ws+4224 length ws+0 -void f231_emit_40(void) { +void f230_emit_40(void) { i1 v3620 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3620; - i8 v3621 = (i8)(intptr_t)c02_s0148; + i8 v3621 = (i8)(intptr_t)c01_s0148; *(i8*)(intptr_t)(ws+4232) = v3621; i8 v3622 = (i8)(intptr_t)(ws+4168); i8 v3623 = *(i8*)(intptr_t)v3622; i4 v3624 = *(i4*)(intptr_t)v3623; *(i4*)(intptr_t)(ws+4240) = v3624; - i8 v3625 = (i8)(intptr_t)(f174_Op2VC); + i8 v3625 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3625)(); } -const i1 c02_s0149[] = { 0x5e,0 }; - void f174_Op2VC(void); +const i1 c01_s0149[] = { 0x5e,0 }; + void f173_Op2VC(void); // emit_41 workspace at ws+4224 length ws+0 -void f232_emit_41(void) { +void f231_emit_41(void) { i1 v3626 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3626; - i8 v3627 = (i8)(intptr_t)c02_s0149; + i8 v3627 = (i8)(intptr_t)c01_s0149; *(i8*)(intptr_t)(ws+4232) = v3627; i8 v3628 = (i8)(intptr_t)(ws+4168); i8 v3629 = *(i8*)(intptr_t)v3628; i4 v3630 = *(i4*)(intptr_t)v3629; *(i4*)(intptr_t)(ws+4240) = v3630; - i8 v3631 = (i8)(intptr_t)(f174_Op2VC); + i8 v3631 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3631)(); } -const i1 c02_s014a[] = { 0x5e,0 }; - void f174_Op2VC(void); +const i1 c01_s014a[] = { 0x5e,0 }; + void f173_Op2VC(void); // emit_42 workspace at ws+4224 length ws+0 -void f233_emit_42(void) { +void f232_emit_42(void) { i1 v3632 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3632; - i8 v3633 = (i8)(intptr_t)c02_s014a; + i8 v3633 = (i8)(intptr_t)c01_s014a; *(i8*)(intptr_t)(ws+4232) = v3633; i8 v3634 = (i8)(intptr_t)(ws+4168); i8 v3635 = *(i8*)(intptr_t)v3634; i4 v3636 = *(i4*)(intptr_t)v3635; *(i4*)(intptr_t)(ws+4240) = v3636; - i8 v3637 = (i8)(intptr_t)(f174_Op2VC); + i8 v3637 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3637)(); } -const i1 c02_s014b[] = { 0x5e,0 }; - void f174_Op2VC(void); +const i1 c01_s014b[] = { 0x5e,0 }; + void f173_Op2VC(void); // emit_43 workspace at ws+4224 length ws+0 -void f234_emit_43(void) { +void f233_emit_43(void) { i1 v3638 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3638; - i8 v3639 = (i8)(intptr_t)c02_s014b; + i8 v3639 = (i8)(intptr_t)c01_s014b; *(i8*)(intptr_t)(ws+4232) = v3639; i8 v3640 = (i8)(intptr_t)(ws+4168); i8 v3641 = *(i8*)(intptr_t)v3640; i4 v3642 = *(i4*)(intptr_t)v3641; *(i4*)(intptr_t)(ws+4240) = v3642; - i8 v3643 = (i8)(intptr_t)(f174_Op2VC); + i8 v3643 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3643)(); } -const i1 c02_s014c[] = { 0x5e,0 }; - void f174_Op2VC(void); +const i1 c01_s014c[] = { 0x5e,0 }; + void f173_Op2VC(void); // emit_44 workspace at ws+4224 length ws+0 -void f235_emit_44(void) { +void f234_emit_44(void) { i1 v3644 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3644; - i8 v3645 = (i8)(intptr_t)c02_s014c; + i8 v3645 = (i8)(intptr_t)c01_s014c; *(i8*)(intptr_t)(ws+4232) = v3645; i8 v3646 = (i8)(intptr_t)(ws+4168); i8 v3647 = *(i8*)(intptr_t)v3646; i4 v3648 = *(i4*)(intptr_t)v3647; *(i4*)(intptr_t)(ws+4240) = v3648; - i8 v3649 = (i8)(intptr_t)(f174_Op2VC); + i8 v3649 = (i8)(intptr_t)(f173_Op2VC); ((void(*)(void))(intptr_t)v3649)(); } - void f103_E_labelref(void); -const i1 c02_s014d[] = { 0x3a,0x3b,0x0a,0 }; - void f92_E(void); + void f102_E_labelref(void); +const i1 c01_s014d[] = { 0x3a,0x3b,0x0a,0 }; + void f91_E(void); // emit_47 workspace at ws+4224 length ws+0 -void f236_emit_47(void) { +void f235_emit_47(void) { i8 v3650 = (i8)(intptr_t)(ws+4136); i8 v3651 = *(i8*)(intptr_t)v3650; i2 v3652 = *(i2*)(intptr_t)v3651; *(i2*)(intptr_t)(ws+4256) = v3652; - i8 v3653 = (i8)(intptr_t)(f103_E_labelref); + i8 v3653 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3653)(); - i8 v3654 = (i8)(intptr_t)c02_s014d; + i8 v3654 = (i8)(intptr_t)c01_s014d; *(i8*)(intptr_t)(ws+4320) = v3654; - i8 v3655 = (i8)(intptr_t)(f92_E); + i8 v3655 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3655)(); } -const i1 c02_s014e[] = { 0x09,0x67,0x6f,0x74,0x6f,0x20,0 }; - void f92_E(void); - void f103_E_labelref(void); -const i1 c02_s014f[] = { 0x3b,0x0a,0 }; - void f92_E(void); +const i1 c01_s014e[] = { 0x09,0x67,0x6f,0x74,0x6f,0x20,0 }; + void f91_E(void); + void f102_E_labelref(void); +const i1 c01_s014f[] = { 0x3b,0x0a,0 }; + void f91_E(void); // emit_48 workspace at ws+4224 length ws+0 -void f237_emit_48(void) { +void f236_emit_48(void) { - i8 v3656 = (i8)(intptr_t)c02_s014e; + i8 v3656 = (i8)(intptr_t)c01_s014e; *(i8*)(intptr_t)(ws+4320) = v3656; - i8 v3657 = (i8)(intptr_t)(f92_E); + i8 v3657 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3657)(); @@ -8410,64 +8410,64 @@ void f237_emit_48(void) { i8 v3659 = *(i8*)(intptr_t)v3658; i2 v3660 = *(i2*)(intptr_t)v3659; *(i2*)(intptr_t)(ws+4256) = v3660; - i8 v3661 = (i8)(intptr_t)(f103_E_labelref); + i8 v3661 = (i8)(intptr_t)(f102_E_labelref); ((void(*)(void))(intptr_t)v3661)(); - i8 v3662 = (i8)(intptr_t)c02_s014f; + i8 v3662 = (i8)(intptr_t)c01_s014f; *(i8*)(intptr_t)(ws+4320) = v3662; - i8 v3663 = (i8)(intptr_t)(f92_E); + i8 v3663 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3663)(); } -const i1 c02_s0150[] = { 0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0 }; - void f92_E(void); +const i1 c01_s0150[] = { 0x09,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0 }; + void f91_E(void); // emit_49 workspace at ws+4224 length ws+0 -void f238_emit_49(void) { +void f237_emit_49(void) { - i8 v3664 = (i8)(intptr_t)c02_s0150; + i8 v3664 = (i8)(intptr_t)c01_s0150; *(i8*)(intptr_t)(ws+4320) = v3664; - i8 v3665 = (i8)(intptr_t)(f92_E); + i8 v3665 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3665)(); } - void f106_EmitterOpenStream(void); -const i1 c02_s0151[] = { 0x0a,0x2f,0x2f,0x20,0 }; - void f92_E(void); - void f92_E(void); -const i1 c02_s0152[] = { 0x20,0x77,0x6f,0x72,0x6b,0x73,0x70,0x61,0x63,0x65,0x20,0x61,0x74,0x20,0 }; - void f92_E(void); - void f83_E_b8(void); - void f84_E_b16(void); - void f83_E_b8(void); - void f84_E_b16(void); -const i1 c02_s0153[] = { 0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x20,0 }; - void f92_E(void); - void f83_E_b8(void); - void f84_E_b16(void); - void f83_E_b8(void); -const i1 c02_s0154[] = { 0x0a,0x76,0x6f,0x69,0x64,0x20,0 }; - void f92_E(void); - void f104_E_subref(void); -const i1 c02_s0155[] = { 0x28,0x76,0x6f,0x69,0x64,0x29,0x20,0x7b,0x0a,0 }; - void f92_E(void); + void f105_EmitterOpenStream(void); +const i1 c01_s0151[] = { 0x0a,0x2f,0x2f,0x20,0 }; + void f91_E(void); + void f91_E(void); +const i1 c01_s0152[] = { 0x20,0x77,0x6f,0x72,0x6b,0x73,0x70,0x61,0x63,0x65,0x20,0x61,0x74,0x20,0 }; + void f91_E(void); + void f82_E_b8(void); + void f83_E_b16(void); + void f82_E_b8(void); + void f83_E_b16(void); +const i1 c01_s0153[] = { 0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x20,0 }; + void f91_E(void); + void f82_E_b8(void); + void f83_E_b16(void); + void f82_E_b8(void); +const i1 c01_s0154[] = { 0x0a,0x76,0x6f,0x69,0x64,0x20,0 }; + void f91_E(void); + void f103_E_subref(void); +const i1 c01_s0155[] = { 0x28,0x76,0x6f,0x69,0x64,0x29,0x20,0x7b,0x0a,0 }; + void f91_E(void); // emit_50 workspace at ws+4224 length ws+0 -void f239_emit_50(void) { +void f238_emit_50(void) { i8 v3666 = (i8)(intptr_t)(ws+40); i8 v3667 = *(i8*)(intptr_t)v3666; *(i8*)(intptr_t)(ws+4248) = v3667; - i8 v3668 = (i8)(intptr_t)(f106_EmitterOpenStream); + i8 v3668 = (i8)(intptr_t)(f105_EmitterOpenStream); ((void(*)(void))(intptr_t)v3668)(); - i8 v3669 = (i8)(intptr_t)c02_s0151; + i8 v3669 = (i8)(intptr_t)c01_s0151; *(i8*)(intptr_t)(ws+4320) = v3669; - i8 v3670 = (i8)(intptr_t)(f92_E); + i8 v3670 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3670)(); @@ -8475,19 +8475,19 @@ void f239_emit_50(void) { i8 v3672 = *(i8*)(intptr_t)v3671; i8 v3673 = *(i8*)(intptr_t)v3672; *(i8*)(intptr_t)(ws+4320) = v3673; - i8 v3674 = (i8)(intptr_t)(f92_E); + i8 v3674 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3674)(); - i8 v3675 = (i8)(intptr_t)c02_s0152; + i8 v3675 = (i8)(intptr_t)c01_s0152; *(i8*)(intptr_t)(ws+4320) = v3675; - i8 v3676 = (i8)(intptr_t)(f92_E); + i8 v3676 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3676)(); i1 v3677 = (i1)+2; *(i1*)(intptr_t)(ws+4336) = v3677; - i8 v3678 = (i8)(intptr_t)(f83_E_b8); + i8 v3678 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v3678)(); @@ -8496,31 +8496,31 @@ void f239_emit_50(void) { i8 v3681 = v3680+(+8); i2 v3682 = *(i2*)(intptr_t)v3681; *(i2*)(intptr_t)(ws+4272) = v3682; - i8 v3683 = (i8)(intptr_t)(f84_E_b16); + i8 v3683 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v3683)(); i1 v3684 = (i1)+0; *(i1*)(intptr_t)(ws+4336) = v3684; - i8 v3685 = (i8)(intptr_t)(f83_E_b8); + i8 v3685 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v3685)(); i2 v3686 = (i2)+0; *(i2*)(intptr_t)(ws+4272) = v3686; - i8 v3687 = (i8)(intptr_t)(f84_E_b16); + i8 v3687 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v3687)(); - i8 v3688 = (i8)(intptr_t)c02_s0153; + i8 v3688 = (i8)(intptr_t)c01_s0153; *(i8*)(intptr_t)(ws+4320) = v3688; - i8 v3689 = (i8)(intptr_t)(f92_E); + i8 v3689 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3689)(); i1 v3690 = (i1)+5; *(i1*)(intptr_t)(ws+4336) = v3690; - i8 v3691 = (i8)(intptr_t)(f83_E_b8); + i8 v3691 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v3691)(); @@ -8529,58 +8529,58 @@ void f239_emit_50(void) { i8 v3694 = v3693+(+8); i2 v3695 = *(i2*)(intptr_t)v3694; *(i2*)(intptr_t)(ws+4272) = v3695; - i8 v3696 = (i8)(intptr_t)(f84_E_b16); + i8 v3696 = (i8)(intptr_t)(f83_E_b16); ((void(*)(void))(intptr_t)v3696)(); i1 v3697 = (i1)+0; *(i1*)(intptr_t)(ws+4336) = v3697; - i8 v3698 = (i8)(intptr_t)(f83_E_b8); + i8 v3698 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v3698)(); - i8 v3699 = (i8)(intptr_t)c02_s0154; + i8 v3699 = (i8)(intptr_t)c01_s0154; *(i8*)(intptr_t)(ws+4320) = v3699; - i8 v3700 = (i8)(intptr_t)(f92_E); + i8 v3700 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3700)(); i8 v3701 = (i8)(intptr_t)(ws+40); i8 v3702 = *(i8*)(intptr_t)v3701; *(i8*)(intptr_t)(ws+4240) = v3702; - i8 v3703 = (i8)(intptr_t)(f104_E_subref); + i8 v3703 = (i8)(intptr_t)(f103_E_subref); ((void(*)(void))(intptr_t)v3703)(); - i8 v3704 = (i8)(intptr_t)c02_s0155; + i8 v3704 = (i8)(intptr_t)c01_s0155; *(i8*)(intptr_t)(ws+4320) = v3704; - i8 v3705 = (i8)(intptr_t)(f92_E); + i8 v3705 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3705)(); } -const i1 c02_s0156[] = { 0x7d,0x0a,0 }; - void f92_E(void); - void f107_EmitterCloseStream(void); +const i1 c01_s0156[] = { 0x7d,0x0a,0 }; + void f91_E(void); + void f106_EmitterCloseStream(void); // emit_51 workspace at ws+4224 length ws+0 -void f240_emit_51(void) { +void f239_emit_51(void) { - i8 v3706 = (i8)(intptr_t)c02_s0156; + i8 v3706 = (i8)(intptr_t)c01_s0156; *(i8*)(intptr_t)(ws+4320) = v3706; - i8 v3707 = (i8)(intptr_t)(f92_E); + i8 v3707 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3707)(); - i8 v3708 = (i8)(intptr_t)(f107_EmitterCloseStream); + i8 v3708 = (i8)(intptr_t)(f106_EmitterCloseStream); ((void(*)(void))(intptr_t)v3708)(); } - void f167_Call(void); + void f166_Call(void); // emit_52 workspace at ws+4224 length ws+0 -void f241_emit_52(void) { +void f240_emit_52(void) { i8 v3709 = (i8)(intptr_t)(ws+4136); i8 v3710 = *(i8*)(intptr_t)v3709; @@ -8588,15 +8588,15 @@ void f241_emit_52(void) { i8 v3712 = v3711+(+8); i2 v3713 = *(i2*)(intptr_t)v3712; *(i2*)(intptr_t)(ws+4224) = v3713; - i8 v3714 = (i8)(intptr_t)(f167_Call); + i8 v3714 = (i8)(intptr_t)(f166_Call); ((void(*)(void))(intptr_t)v3714)(); } - void f168_PokeArg(void); + void f167_PokeArg(void); // emit_54 workspace at ws+4224 length ws+0 -void f242_emit_54(void) { +void f241_emit_54(void) { i1 v3715 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3715; @@ -8604,15 +8604,15 @@ void f242_emit_54(void) { i8 v3717 = *(i8*)(intptr_t)v3716; i8 v3718 = v3717+(+8); *(i8*)(intptr_t)(ws+4232) = v3718; - i8 v3719 = (i8)(intptr_t)(f168_PokeArg); + i8 v3719 = (i8)(intptr_t)(f167_PokeArg); ((void(*)(void))(intptr_t)v3719)(); } - void f168_PokeArg(void); + void f167_PokeArg(void); // emit_55 workspace at ws+4224 length ws+0 -void f243_emit_55(void) { +void f242_emit_55(void) { i1 v3720 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3720; @@ -8620,15 +8620,15 @@ void f243_emit_55(void) { i8 v3722 = *(i8*)(intptr_t)v3721; i8 v3723 = v3722+(+8); *(i8*)(intptr_t)(ws+4232) = v3723; - i8 v3724 = (i8)(intptr_t)(f168_PokeArg); + i8 v3724 = (i8)(intptr_t)(f167_PokeArg); ((void(*)(void))(intptr_t)v3724)(); } - void f168_PokeArg(void); + void f167_PokeArg(void); // emit_56 workspace at ws+4224 length ws+0 -void f244_emit_56(void) { +void f243_emit_56(void) { i1 v3725 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3725; @@ -8636,15 +8636,15 @@ void f244_emit_56(void) { i8 v3727 = *(i8*)(intptr_t)v3726; i8 v3728 = v3727+(+8); *(i8*)(intptr_t)(ws+4232) = v3728; - i8 v3729 = (i8)(intptr_t)(f168_PokeArg); + i8 v3729 = (i8)(intptr_t)(f167_PokeArg); ((void(*)(void))(intptr_t)v3729)(); } - void f168_PokeArg(void); + void f167_PokeArg(void); // emit_57 workspace at ws+4224 length ws+0 -void f245_emit_57(void) { +void f244_emit_57(void) { i1 v3730 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3730; @@ -8652,15 +8652,15 @@ void f245_emit_57(void) { i8 v3732 = *(i8*)(intptr_t)v3731; i8 v3733 = v3732+(+8); *(i8*)(intptr_t)(ws+4232) = v3733; - i8 v3734 = (i8)(intptr_t)(f168_PokeArg); + i8 v3734 = (i8)(intptr_t)(f167_PokeArg); ((void(*)(void))(intptr_t)v3734)(); } - void f169_PeekArg(void); + void f168_PeekArg(void); // emit_58 workspace at ws+4224 length ws+0 -void f246_emit_58(void) { +void f245_emit_58(void) { i1 v3735 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3735; @@ -8668,15 +8668,15 @@ void f246_emit_58(void) { i8 v3737 = *(i8*)(intptr_t)v3736; i8 v3738 = v3737+(+8); *(i8*)(intptr_t)(ws+4232) = v3738; - i8 v3739 = (i8)(intptr_t)(f169_PeekArg); + i8 v3739 = (i8)(intptr_t)(f168_PeekArg); ((void(*)(void))(intptr_t)v3739)(); } - void f169_PeekArg(void); + void f168_PeekArg(void); // emit_59 workspace at ws+4224 length ws+0 -void f247_emit_59(void) { +void f246_emit_59(void) { i1 v3740 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3740; @@ -8684,15 +8684,15 @@ void f247_emit_59(void) { i8 v3742 = *(i8*)(intptr_t)v3741; i8 v3743 = v3742+(+8); *(i8*)(intptr_t)(ws+4232) = v3743; - i8 v3744 = (i8)(intptr_t)(f169_PeekArg); + i8 v3744 = (i8)(intptr_t)(f168_PeekArg); ((void(*)(void))(intptr_t)v3744)(); } - void f169_PeekArg(void); + void f168_PeekArg(void); // emit_60 workspace at ws+4224 length ws+0 -void f248_emit_60(void) { +void f247_emit_60(void) { i1 v3745 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3745; @@ -8700,15 +8700,15 @@ void f248_emit_60(void) { i8 v3747 = *(i8*)(intptr_t)v3746; i8 v3748 = v3747+(+8); *(i8*)(intptr_t)(ws+4232) = v3748; - i8 v3749 = (i8)(intptr_t)(f169_PeekArg); + i8 v3749 = (i8)(intptr_t)(f168_PeekArg); ((void(*)(void))(intptr_t)v3749)(); } - void f169_PeekArg(void); + void f168_PeekArg(void); // emit_61 workspace at ws+4224 length ws+0 -void f249_emit_61(void) { +void f248_emit_61(void) { i1 v3750 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3750; @@ -8716,15 +8716,15 @@ void f249_emit_61(void) { i8 v3752 = *(i8*)(intptr_t)v3751; i8 v3753 = v3752+(+8); *(i8*)(intptr_t)(ws+4232) = v3753; - i8 v3754 = (i8)(intptr_t)(f169_PeekArg); + i8 v3754 = (i8)(intptr_t)(f168_PeekArg); ((void(*)(void))(intptr_t)v3754)(); } - void f170_LoadConstant(void); + void f169_LoadConstant(void); // emit_62 workspace at ws+4224 length ws+0 -void f250_emit_62(void) { +void f249_emit_62(void) { i1 v3755 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3755; @@ -8732,15 +8732,15 @@ void f250_emit_62(void) { i8 v3757 = *(i8*)(intptr_t)v3756; i4 v3758 = *(i4*)(intptr_t)v3757; *(i4*)(intptr_t)(ws+4228) = v3758; - i8 v3759 = (i8)(intptr_t)(f170_LoadConstant); + i8 v3759 = (i8)(intptr_t)(f169_LoadConstant); ((void(*)(void))(intptr_t)v3759)(); } - void f170_LoadConstant(void); + void f169_LoadConstant(void); // emit_63 workspace at ws+4224 length ws+0 -void f251_emit_63(void) { +void f250_emit_63(void) { i1 v3760 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3760; @@ -8748,15 +8748,15 @@ void f251_emit_63(void) { i8 v3762 = *(i8*)(intptr_t)v3761; i4 v3763 = *(i4*)(intptr_t)v3762; *(i4*)(intptr_t)(ws+4228) = v3763; - i8 v3764 = (i8)(intptr_t)(f170_LoadConstant); + i8 v3764 = (i8)(intptr_t)(f169_LoadConstant); ((void(*)(void))(intptr_t)v3764)(); } - void f170_LoadConstant(void); + void f169_LoadConstant(void); // emit_64 workspace at ws+4224 length ws+0 -void f252_emit_64(void) { +void f251_emit_64(void) { i1 v3765 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3765; @@ -8764,15 +8764,15 @@ void f252_emit_64(void) { i8 v3767 = *(i8*)(intptr_t)v3766; i4 v3768 = *(i4*)(intptr_t)v3767; *(i4*)(intptr_t)(ws+4228) = v3768; - i8 v3769 = (i8)(intptr_t)(f170_LoadConstant); + i8 v3769 = (i8)(intptr_t)(f169_LoadConstant); ((void(*)(void))(intptr_t)v3769)(); } - void f170_LoadConstant(void); + void f169_LoadConstant(void); // emit_65 workspace at ws+4224 length ws+0 -void f253_emit_65(void) { +void f252_emit_65(void) { i1 v3770 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3770; @@ -8780,25 +8780,25 @@ void f253_emit_65(void) { i8 v3772 = *(i8*)(intptr_t)v3771; i4 v3773 = *(i4*)(intptr_t)v3772; *(i4*)(intptr_t)(ws+4228) = v3773; - i8 v3774 = (i8)(intptr_t)(f170_LoadConstant); + i8 v3774 = (i8)(intptr_t)(f169_LoadConstant); ((void(*)(void))(intptr_t)v3774)(); } - void f160_Push(void); -const i1 c02_s0157[] = { 0x09,0x69,0x38,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s0158[] = { 0x20,0x3d,0x20,0x28,0x69,0x38,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; - void f92_E(void); - void f156_E_symref(void); -const i1 c02_s0159[] = { 0x29,0x3b,0x0a,0 }; - void f92_E(void); + void f159_Push(void); +const i1 c01_s0157[] = { 0x09,0x69,0x38,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s0158[] = { 0x20,0x3d,0x20,0x28,0x69,0x38,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; + void f91_E(void); + void f155_E_symref(void); +const i1 c01_s0159[] = { 0x29,0x3b,0x0a,0 }; + void f91_E(void); // emit_66 workspace at ws+4224 length ws+4 -void f254_emit_66(void) { +void f253_emit_66(void) { - i8 v3775 = (i8)(intptr_t)(f160_Push); + i8 v3775 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v3775)(); @@ -8811,22 +8811,22 @@ void f254_emit_66(void) { i8 v3780 = (i8)(intptr_t)(ws+4226); *(i2*)(intptr_t)v3780 = v3779; - i8 v3781 = (i8)(intptr_t)c02_s0157; + i8 v3781 = (i8)(intptr_t)c01_s0157; *(i8*)(intptr_t)(ws+4320) = v3781; - i8 v3782 = (i8)(intptr_t)(f92_E); + i8 v3782 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3782)(); i8 v3783 = (i8)(intptr_t)(ws+4226); i2 v3784 = *(i2*)(intptr_t)v3783; *(i2*)(intptr_t)(ws+4272) = v3784; - i8 v3785 = (i8)(intptr_t)(f94_E_u16); + i8 v3785 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3785)(); - i8 v3786 = (i8)(intptr_t)c02_s0158; + i8 v3786 = (i8)(intptr_t)c01_s0158; *(i8*)(intptr_t)(ws+4320) = v3786; - i8 v3787 = (i8)(intptr_t)(f92_E); + i8 v3787 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3787)(); @@ -8838,31 +8838,31 @@ void f254_emit_66(void) { i8 v3792 = v3791+(+16); i2 v3793 = *(i2*)(intptr_t)v3792; *(i2*)(intptr_t)(ws+4256) = v3793; - i8 v3794 = (i8)(intptr_t)(f156_E_symref); + i8 v3794 = (i8)(intptr_t)(f155_E_symref); ((void(*)(void))(intptr_t)v3794)(); - i8 v3795 = (i8)(intptr_t)c02_s0159; + i8 v3795 = (i8)(intptr_t)c01_s0159; *(i8*)(intptr_t)(ws+4320) = v3795; - i8 v3796 = (i8)(intptr_t)(f92_E); + i8 v3796 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3796)(); } - void f160_Push(void); -const i1 c02_s015a[] = { 0x09,0x69,0x38,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s015b[] = { 0x20,0x3d,0x20,0x28,0x69,0x38,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; - void f92_E(void); - void f155_E_subref_sig(void); -const i1 c02_s015c[] = { 0x29,0x3b,0x0a,0 }; - void f92_E(void); + void f159_Push(void); +const i1 c01_s015a[] = { 0x09,0x69,0x38,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s015b[] = { 0x20,0x3d,0x20,0x28,0x69,0x38,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; + void f91_E(void); + void f154_E_subref_sig(void); +const i1 c01_s015c[] = { 0x29,0x3b,0x0a,0 }; + void f91_E(void); // emit_67 workspace at ws+4224 length ws+4 -void f255_emit_67(void) { +void f254_emit_67(void) { - i8 v3797 = (i8)(intptr_t)(f160_Push); + i8 v3797 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v3797)(); @@ -8875,22 +8875,22 @@ void f255_emit_67(void) { i8 v3802 = (i8)(intptr_t)(ws+4226); *(i2*)(intptr_t)v3802 = v3801; - i8 v3803 = (i8)(intptr_t)c02_s015a; + i8 v3803 = (i8)(intptr_t)c01_s015a; *(i8*)(intptr_t)(ws+4320) = v3803; - i8 v3804 = (i8)(intptr_t)(f92_E); + i8 v3804 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3804)(); i8 v3805 = (i8)(intptr_t)(ws+4226); i2 v3806 = *(i2*)(intptr_t)v3805; *(i2*)(intptr_t)(ws+4272) = v3806; - i8 v3807 = (i8)(intptr_t)(f94_E_u16); + i8 v3807 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v3807)(); - i8 v3808 = (i8)(intptr_t)c02_s015b; + i8 v3808 = (i8)(intptr_t)c01_s015b; *(i8*)(intptr_t)(ws+4320) = v3808; - i8 v3809 = (i8)(intptr_t)(f92_E); + i8 v3809 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3809)(); @@ -8898,1150 +8898,1150 @@ void f255_emit_67(void) { i8 v3811 = *(i8*)(intptr_t)v3810; i8 v3812 = *(i8*)(intptr_t)v3811; *(i8*)(intptr_t)(ws+4232) = v3812; - i8 v3813 = (i8)(intptr_t)(f155_E_subref_sig); + i8 v3813 = (i8)(intptr_t)(f154_E_subref_sig); ((void(*)(void))(intptr_t)v3813)(); - i8 v3814 = (i8)(intptr_t)c02_s015c; + i8 v3814 = (i8)(intptr_t)c01_s015c; *(i8*)(intptr_t)(ws+4320) = v3814; - i8 v3815 = (i8)(intptr_t)(f92_E); + i8 v3815 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v3815)(); } - void f172_LoadVV(void); + void f171_LoadVV(void); // emit_68 workspace at ws+4224 length ws+0 -void f256_emit_68(void) { +void f255_emit_68(void) { i1 v3816 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3816; - i8 v3817 = (i8)(intptr_t)(f172_LoadVV); + i8 v3817 = (i8)(intptr_t)(f171_LoadVV); ((void(*)(void))(intptr_t)v3817)(); } - void f172_LoadVV(void); + void f171_LoadVV(void); // emit_69 workspace at ws+4224 length ws+0 -void f257_emit_69(void) { +void f256_emit_69(void) { i1 v3818 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3818; - i8 v3819 = (i8)(intptr_t)(f172_LoadVV); + i8 v3819 = (i8)(intptr_t)(f171_LoadVV); ((void(*)(void))(intptr_t)v3819)(); } - void f172_LoadVV(void); + void f171_LoadVV(void); // emit_70 workspace at ws+4224 length ws+0 -void f258_emit_70(void) { +void f257_emit_70(void) { i1 v3820 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3820; - i8 v3821 = (i8)(intptr_t)(f172_LoadVV); + i8 v3821 = (i8)(intptr_t)(f171_LoadVV); ((void(*)(void))(intptr_t)v3821)(); } - void f172_LoadVV(void); + void f171_LoadVV(void); // emit_71 workspace at ws+4224 length ws+0 -void f259_emit_71(void) { +void f258_emit_71(void) { i1 v3822 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3822; - i8 v3823 = (i8)(intptr_t)(f172_LoadVV); + i8 v3823 = (i8)(intptr_t)(f171_LoadVV); ((void(*)(void))(intptr_t)v3823)(); } -const i1 c02_s015d[] = { 0x2b,0 }; - void f173_Op2VV(void); +const i1 c01_s015d[] = { 0x2b,0 }; + void f172_Op2VV(void); // emit_72 workspace at ws+4224 length ws+0 -void f260_emit_72(void) { +void f259_emit_72(void) { i1 v3824 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3824; - i8 v3825 = (i8)(intptr_t)c02_s015d; + i8 v3825 = (i8)(intptr_t)c01_s015d; *(i8*)(intptr_t)(ws+4232) = v3825; - i8 v3826 = (i8)(intptr_t)(f173_Op2VV); + i8 v3826 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3826)(); } -const i1 c02_s015e[] = { 0x2b,0 }; - void f173_Op2VV(void); +const i1 c01_s015e[] = { 0x2b,0 }; + void f172_Op2VV(void); // emit_73 workspace at ws+4224 length ws+0 -void f261_emit_73(void) { +void f260_emit_73(void) { i1 v3827 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3827; - i8 v3828 = (i8)(intptr_t)c02_s015e; + i8 v3828 = (i8)(intptr_t)c01_s015e; *(i8*)(intptr_t)(ws+4232) = v3828; - i8 v3829 = (i8)(intptr_t)(f173_Op2VV); + i8 v3829 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3829)(); } -const i1 c02_s015f[] = { 0x2b,0 }; - void f173_Op2VV(void); +const i1 c01_s015f[] = { 0x2b,0 }; + void f172_Op2VV(void); // emit_74 workspace at ws+4224 length ws+0 -void f262_emit_74(void) { +void f261_emit_74(void) { i1 v3830 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3830; - i8 v3831 = (i8)(intptr_t)c02_s015f; + i8 v3831 = (i8)(intptr_t)c01_s015f; *(i8*)(intptr_t)(ws+4232) = v3831; - i8 v3832 = (i8)(intptr_t)(f173_Op2VV); + i8 v3832 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3832)(); } -const i1 c02_s0160[] = { 0x2b,0 }; - void f173_Op2VV(void); +const i1 c01_s0160[] = { 0x2b,0 }; + void f172_Op2VV(void); // emit_75 workspace at ws+4224 length ws+0 -void f263_emit_75(void) { +void f262_emit_75(void) { i1 v3833 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3833; - i8 v3834 = (i8)(intptr_t)c02_s0160; + i8 v3834 = (i8)(intptr_t)c01_s0160; *(i8*)(intptr_t)(ws+4232) = v3834; - i8 v3835 = (i8)(intptr_t)(f173_Op2VV); + i8 v3835 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3835)(); } -const i1 c02_s0161[] = { 0x2d,0 }; - void f173_Op2VV(void); +const i1 c01_s0161[] = { 0x2d,0 }; + void f172_Op2VV(void); // emit_76 workspace at ws+4224 length ws+0 -void f264_emit_76(void) { +void f263_emit_76(void) { i1 v3836 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3836; - i8 v3837 = (i8)(intptr_t)c02_s0161; + i8 v3837 = (i8)(intptr_t)c01_s0161; *(i8*)(intptr_t)(ws+4232) = v3837; - i8 v3838 = (i8)(intptr_t)(f173_Op2VV); + i8 v3838 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3838)(); } -const i1 c02_s0162[] = { 0x2d,0 }; - void f173_Op2VV(void); +const i1 c01_s0162[] = { 0x2d,0 }; + void f172_Op2VV(void); // emit_77 workspace at ws+4224 length ws+0 -void f265_emit_77(void) { +void f264_emit_77(void) { i1 v3839 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3839; - i8 v3840 = (i8)(intptr_t)c02_s0162; + i8 v3840 = (i8)(intptr_t)c01_s0162; *(i8*)(intptr_t)(ws+4232) = v3840; - i8 v3841 = (i8)(intptr_t)(f173_Op2VV); + i8 v3841 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3841)(); } -const i1 c02_s0163[] = { 0x2d,0 }; - void f173_Op2VV(void); +const i1 c01_s0163[] = { 0x2d,0 }; + void f172_Op2VV(void); // emit_78 workspace at ws+4224 length ws+0 -void f266_emit_78(void) { +void f265_emit_78(void) { i1 v3842 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3842; - i8 v3843 = (i8)(intptr_t)c02_s0163; + i8 v3843 = (i8)(intptr_t)c01_s0163; *(i8*)(intptr_t)(ws+4232) = v3843; - i8 v3844 = (i8)(intptr_t)(f173_Op2VV); + i8 v3844 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3844)(); } -const i1 c02_s0164[] = { 0x2d,0 }; - void f173_Op2VV(void); +const i1 c01_s0164[] = { 0x2d,0 }; + void f172_Op2VV(void); // emit_79 workspace at ws+4224 length ws+0 -void f267_emit_79(void) { +void f266_emit_79(void) { i1 v3845 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3845; - i8 v3846 = (i8)(intptr_t)c02_s0164; + i8 v3846 = (i8)(intptr_t)c01_s0164; *(i8*)(intptr_t)(ws+4232) = v3846; - i8 v3847 = (i8)(intptr_t)(f173_Op2VV); + i8 v3847 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3847)(); } -const i1 c02_s0165[] = { 0x2a,0 }; - void f173_Op2VV(void); +const i1 c01_s0165[] = { 0x2a,0 }; + void f172_Op2VV(void); // emit_80 workspace at ws+4224 length ws+0 -void f268_emit_80(void) { +void f267_emit_80(void) { i1 v3848 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3848; - i8 v3849 = (i8)(intptr_t)c02_s0165; + i8 v3849 = (i8)(intptr_t)c01_s0165; *(i8*)(intptr_t)(ws+4232) = v3849; - i8 v3850 = (i8)(intptr_t)(f173_Op2VV); + i8 v3850 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3850)(); } -const i1 c02_s0166[] = { 0x2a,0 }; - void f173_Op2VV(void); +const i1 c01_s0166[] = { 0x2a,0 }; + void f172_Op2VV(void); // emit_81 workspace at ws+4224 length ws+0 -void f269_emit_81(void) { +void f268_emit_81(void) { i1 v3851 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3851; - i8 v3852 = (i8)(intptr_t)c02_s0166; + i8 v3852 = (i8)(intptr_t)c01_s0166; *(i8*)(intptr_t)(ws+4232) = v3852; - i8 v3853 = (i8)(intptr_t)(f173_Op2VV); + i8 v3853 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3853)(); } -const i1 c02_s0167[] = { 0x2a,0 }; - void f173_Op2VV(void); +const i1 c01_s0167[] = { 0x2a,0 }; + void f172_Op2VV(void); // emit_82 workspace at ws+4224 length ws+0 -void f270_emit_82(void) { +void f269_emit_82(void) { i1 v3854 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3854; - i8 v3855 = (i8)(intptr_t)c02_s0167; + i8 v3855 = (i8)(intptr_t)c01_s0167; *(i8*)(intptr_t)(ws+4232) = v3855; - i8 v3856 = (i8)(intptr_t)(f173_Op2VV); + i8 v3856 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3856)(); } -const i1 c02_s0168[] = { 0x2a,0 }; - void f173_Op2VV(void); +const i1 c01_s0168[] = { 0x2a,0 }; + void f172_Op2VV(void); // emit_83 workspace at ws+4224 length ws+0 -void f271_emit_83(void) { +void f270_emit_83(void) { i1 v3857 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3857; - i8 v3858 = (i8)(intptr_t)c02_s0168; + i8 v3858 = (i8)(intptr_t)c01_s0168; *(i8*)(intptr_t)(ws+4232) = v3858; - i8 v3859 = (i8)(intptr_t)(f173_Op2VV); + i8 v3859 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3859)(); } -const i1 c02_s0169[] = { 0x2f,0 }; - void f173_Op2VV(void); +const i1 c01_s0169[] = { 0x2f,0 }; + void f172_Op2VV(void); // emit_84 workspace at ws+4224 length ws+0 -void f272_emit_84(void) { +void f271_emit_84(void) { i1 v3860 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3860; - i8 v3861 = (i8)(intptr_t)c02_s0169; + i8 v3861 = (i8)(intptr_t)c01_s0169; *(i8*)(intptr_t)(ws+4232) = v3861; - i8 v3862 = (i8)(intptr_t)(f173_Op2VV); + i8 v3862 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3862)(); } -const i1 c02_s016a[] = { 0x2f,0 }; - void f173_Op2VV(void); +const i1 c01_s016a[] = { 0x2f,0 }; + void f172_Op2VV(void); // emit_85 workspace at ws+4224 length ws+0 -void f273_emit_85(void) { +void f272_emit_85(void) { i1 v3863 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3863; - i8 v3864 = (i8)(intptr_t)c02_s016a; + i8 v3864 = (i8)(intptr_t)c01_s016a; *(i8*)(intptr_t)(ws+4232) = v3864; - i8 v3865 = (i8)(intptr_t)(f173_Op2VV); + i8 v3865 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3865)(); } -const i1 c02_s016b[] = { 0x2f,0 }; - void f173_Op2VV(void); +const i1 c01_s016b[] = { 0x2f,0 }; + void f172_Op2VV(void); // emit_86 workspace at ws+4224 length ws+0 -void f274_emit_86(void) { +void f273_emit_86(void) { i1 v3866 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3866; - i8 v3867 = (i8)(intptr_t)c02_s016b; + i8 v3867 = (i8)(intptr_t)c01_s016b; *(i8*)(intptr_t)(ws+4232) = v3867; - i8 v3868 = (i8)(intptr_t)(f173_Op2VV); + i8 v3868 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3868)(); } -const i1 c02_s016c[] = { 0x2f,0 }; - void f173_Op2VV(void); +const i1 c01_s016c[] = { 0x2f,0 }; + void f172_Op2VV(void); // emit_87 workspace at ws+4224 length ws+0 -void f275_emit_87(void) { +void f274_emit_87(void) { i1 v3869 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3869; - i8 v3870 = (i8)(intptr_t)c02_s016c; + i8 v3870 = (i8)(intptr_t)c01_s016c; *(i8*)(intptr_t)(ws+4232) = v3870; - i8 v3871 = (i8)(intptr_t)(f173_Op2VV); + i8 v3871 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3871)(); } -const i1 c02_s016d[] = { 0x25,0 }; - void f173_Op2VV(void); +const i1 c01_s016d[] = { 0x25,0 }; + void f172_Op2VV(void); // emit_88 workspace at ws+4224 length ws+0 -void f276_emit_88(void) { +void f275_emit_88(void) { i1 v3872 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3872; - i8 v3873 = (i8)(intptr_t)c02_s016d; + i8 v3873 = (i8)(intptr_t)c01_s016d; *(i8*)(intptr_t)(ws+4232) = v3873; - i8 v3874 = (i8)(intptr_t)(f173_Op2VV); + i8 v3874 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3874)(); } -const i1 c02_s016e[] = { 0x25,0 }; - void f173_Op2VV(void); +const i1 c01_s016e[] = { 0x25,0 }; + void f172_Op2VV(void); // emit_89 workspace at ws+4224 length ws+0 -void f277_emit_89(void) { +void f276_emit_89(void) { i1 v3875 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3875; - i8 v3876 = (i8)(intptr_t)c02_s016e; + i8 v3876 = (i8)(intptr_t)c01_s016e; *(i8*)(intptr_t)(ws+4232) = v3876; - i8 v3877 = (i8)(intptr_t)(f173_Op2VV); + i8 v3877 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3877)(); } -const i1 c02_s016f[] = { 0x25,0 }; - void f173_Op2VV(void); +const i1 c01_s016f[] = { 0x25,0 }; + void f172_Op2VV(void); // emit_90 workspace at ws+4224 length ws+0 -void f278_emit_90(void) { +void f277_emit_90(void) { i1 v3878 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3878; - i8 v3879 = (i8)(intptr_t)c02_s016f; + i8 v3879 = (i8)(intptr_t)c01_s016f; *(i8*)(intptr_t)(ws+4232) = v3879; - i8 v3880 = (i8)(intptr_t)(f173_Op2VV); + i8 v3880 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3880)(); } -const i1 c02_s0170[] = { 0x25,0 }; - void f173_Op2VV(void); +const i1 c01_s0170[] = { 0x25,0 }; + void f172_Op2VV(void); // emit_91 workspace at ws+4224 length ws+0 -void f279_emit_91(void) { +void f278_emit_91(void) { i1 v3881 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3881; - i8 v3882 = (i8)(intptr_t)c02_s0170; + i8 v3882 = (i8)(intptr_t)c01_s0170; *(i8*)(intptr_t)(ws+4232) = v3882; - i8 v3883 = (i8)(intptr_t)(f173_Op2VV); + i8 v3883 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3883)(); } -const i1 c02_s0171[] = { 0x2f,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0171[] = { 0x2f,0 }; + void f174_Op2VVSigned(void); // emit_92 workspace at ws+4224 length ws+0 -void f280_emit_92(void) { +void f279_emit_92(void) { i1 v3884 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3884; - i8 v3885 = (i8)(intptr_t)c02_s0171; + i8 v3885 = (i8)(intptr_t)c01_s0171; *(i8*)(intptr_t)(ws+4232) = v3885; - i8 v3886 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3886 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3886)(); } -const i1 c02_s0172[] = { 0x2f,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0172[] = { 0x2f,0 }; + void f174_Op2VVSigned(void); // emit_93 workspace at ws+4224 length ws+0 -void f281_emit_93(void) { +void f280_emit_93(void) { i1 v3887 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3887; - i8 v3888 = (i8)(intptr_t)c02_s0172; + i8 v3888 = (i8)(intptr_t)c01_s0172; *(i8*)(intptr_t)(ws+4232) = v3888; - i8 v3889 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3889 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3889)(); } -const i1 c02_s0173[] = { 0x2f,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0173[] = { 0x2f,0 }; + void f174_Op2VVSigned(void); // emit_94 workspace at ws+4224 length ws+0 -void f282_emit_94(void) { +void f281_emit_94(void) { i1 v3890 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3890; - i8 v3891 = (i8)(intptr_t)c02_s0173; + i8 v3891 = (i8)(intptr_t)c01_s0173; *(i8*)(intptr_t)(ws+4232) = v3891; - i8 v3892 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3892 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3892)(); } -const i1 c02_s0174[] = { 0x2f,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0174[] = { 0x2f,0 }; + void f174_Op2VVSigned(void); // emit_95 workspace at ws+4224 length ws+0 -void f283_emit_95(void) { +void f282_emit_95(void) { i1 v3893 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3893; - i8 v3894 = (i8)(intptr_t)c02_s0174; + i8 v3894 = (i8)(intptr_t)c01_s0174; *(i8*)(intptr_t)(ws+4232) = v3894; - i8 v3895 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3895 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3895)(); } -const i1 c02_s0175[] = { 0x25,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0175[] = { 0x25,0 }; + void f174_Op2VVSigned(void); // emit_96 workspace at ws+4224 length ws+0 -void f284_emit_96(void) { +void f283_emit_96(void) { i1 v3896 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3896; - i8 v3897 = (i8)(intptr_t)c02_s0175; + i8 v3897 = (i8)(intptr_t)c01_s0175; *(i8*)(intptr_t)(ws+4232) = v3897; - i8 v3898 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3898 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3898)(); } -const i1 c02_s0176[] = { 0x25,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0176[] = { 0x25,0 }; + void f174_Op2VVSigned(void); // emit_97 workspace at ws+4224 length ws+0 -void f285_emit_97(void) { +void f284_emit_97(void) { i1 v3899 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3899; - i8 v3900 = (i8)(intptr_t)c02_s0176; + i8 v3900 = (i8)(intptr_t)c01_s0176; *(i8*)(intptr_t)(ws+4232) = v3900; - i8 v3901 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3901 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3901)(); } -const i1 c02_s0177[] = { 0x25,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0177[] = { 0x25,0 }; + void f174_Op2VVSigned(void); // emit_98 workspace at ws+4224 length ws+0 -void f286_emit_98(void) { +void f285_emit_98(void) { i1 v3902 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3902; - i8 v3903 = (i8)(intptr_t)c02_s0177; + i8 v3903 = (i8)(intptr_t)c01_s0177; *(i8*)(intptr_t)(ws+4232) = v3903; - i8 v3904 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3904 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3904)(); } -const i1 c02_s0178[] = { 0x25,0 }; - void f175_Op2VVSigned(void); +const i1 c01_s0178[] = { 0x25,0 }; + void f174_Op2VVSigned(void); // emit_99 workspace at ws+4224 length ws+0 -void f287_emit_99(void) { +void f286_emit_99(void) { i1 v3905 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3905; - i8 v3906 = (i8)(intptr_t)c02_s0178; + i8 v3906 = (i8)(intptr_t)c01_s0178; *(i8*)(intptr_t)(ws+4232) = v3906; - i8 v3907 = (i8)(intptr_t)(f175_Op2VVSigned); + i8 v3907 = (i8)(intptr_t)(f174_Op2VVSigned); ((void(*)(void))(intptr_t)v3907)(); } -const i1 c02_s0179[] = { 0x26,0 }; - void f173_Op2VV(void); +const i1 c01_s0179[] = { 0x26,0 }; + void f172_Op2VV(void); // emit_100 workspace at ws+4224 length ws+0 -void f288_emit_100(void) { +void f287_emit_100(void) { i1 v3908 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3908; - i8 v3909 = (i8)(intptr_t)c02_s0179; + i8 v3909 = (i8)(intptr_t)c01_s0179; *(i8*)(intptr_t)(ws+4232) = v3909; - i8 v3910 = (i8)(intptr_t)(f173_Op2VV); + i8 v3910 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3910)(); } -const i1 c02_s017a[] = { 0x26,0 }; - void f173_Op2VV(void); +const i1 c01_s017a[] = { 0x26,0 }; + void f172_Op2VV(void); // emit_101 workspace at ws+4224 length ws+0 -void f289_emit_101(void) { +void f288_emit_101(void) { i1 v3911 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3911; - i8 v3912 = (i8)(intptr_t)c02_s017a; + i8 v3912 = (i8)(intptr_t)c01_s017a; *(i8*)(intptr_t)(ws+4232) = v3912; - i8 v3913 = (i8)(intptr_t)(f173_Op2VV); + i8 v3913 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3913)(); } -const i1 c02_s017b[] = { 0x26,0 }; - void f173_Op2VV(void); +const i1 c01_s017b[] = { 0x26,0 }; + void f172_Op2VV(void); // emit_102 workspace at ws+4224 length ws+0 -void f290_emit_102(void) { +void f289_emit_102(void) { i1 v3914 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3914; - i8 v3915 = (i8)(intptr_t)c02_s017b; + i8 v3915 = (i8)(intptr_t)c01_s017b; *(i8*)(intptr_t)(ws+4232) = v3915; - i8 v3916 = (i8)(intptr_t)(f173_Op2VV); + i8 v3916 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3916)(); } -const i1 c02_s017c[] = { 0x26,0 }; - void f173_Op2VV(void); +const i1 c01_s017c[] = { 0x26,0 }; + void f172_Op2VV(void); // emit_103 workspace at ws+4224 length ws+0 -void f291_emit_103(void) { +void f290_emit_103(void) { i1 v3917 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3917; - i8 v3918 = (i8)(intptr_t)c02_s017c; + i8 v3918 = (i8)(intptr_t)c01_s017c; *(i8*)(intptr_t)(ws+4232) = v3918; - i8 v3919 = (i8)(intptr_t)(f173_Op2VV); + i8 v3919 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3919)(); } -const i1 c02_s017d[] = { 0x7c,0 }; - void f173_Op2VV(void); +const i1 c01_s017d[] = { 0x7c,0 }; + void f172_Op2VV(void); // emit_104 workspace at ws+4224 length ws+0 -void f292_emit_104(void) { +void f291_emit_104(void) { i1 v3920 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3920; - i8 v3921 = (i8)(intptr_t)c02_s017d; + i8 v3921 = (i8)(intptr_t)c01_s017d; *(i8*)(intptr_t)(ws+4232) = v3921; - i8 v3922 = (i8)(intptr_t)(f173_Op2VV); + i8 v3922 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3922)(); } -const i1 c02_s017e[] = { 0x7c,0 }; - void f173_Op2VV(void); +const i1 c01_s017e[] = { 0x7c,0 }; + void f172_Op2VV(void); // emit_105 workspace at ws+4224 length ws+0 -void f293_emit_105(void) { +void f292_emit_105(void) { i1 v3923 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3923; - i8 v3924 = (i8)(intptr_t)c02_s017e; + i8 v3924 = (i8)(intptr_t)c01_s017e; *(i8*)(intptr_t)(ws+4232) = v3924; - i8 v3925 = (i8)(intptr_t)(f173_Op2VV); + i8 v3925 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3925)(); } -const i1 c02_s017f[] = { 0x7c,0 }; - void f173_Op2VV(void); +const i1 c01_s017f[] = { 0x7c,0 }; + void f172_Op2VV(void); // emit_106 workspace at ws+4224 length ws+0 -void f294_emit_106(void) { +void f293_emit_106(void) { i1 v3926 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3926; - i8 v3927 = (i8)(intptr_t)c02_s017f; + i8 v3927 = (i8)(intptr_t)c01_s017f; *(i8*)(intptr_t)(ws+4232) = v3927; - i8 v3928 = (i8)(intptr_t)(f173_Op2VV); + i8 v3928 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3928)(); } -const i1 c02_s0180[] = { 0x7c,0 }; - void f173_Op2VV(void); +const i1 c01_s0180[] = { 0x7c,0 }; + void f172_Op2VV(void); // emit_107 workspace at ws+4224 length ws+0 -void f295_emit_107(void) { +void f294_emit_107(void) { i1 v3929 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3929; - i8 v3930 = (i8)(intptr_t)c02_s0180; + i8 v3930 = (i8)(intptr_t)c01_s0180; *(i8*)(intptr_t)(ws+4232) = v3930; - i8 v3931 = (i8)(intptr_t)(f173_Op2VV); + i8 v3931 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3931)(); } -const i1 c02_s0181[] = { 0x5e,0 }; - void f173_Op2VV(void); +const i1 c01_s0181[] = { 0x5e,0 }; + void f172_Op2VV(void); // emit_108 workspace at ws+4224 length ws+0 -void f296_emit_108(void) { +void f295_emit_108(void) { i1 v3932 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3932; - i8 v3933 = (i8)(intptr_t)c02_s0181; + i8 v3933 = (i8)(intptr_t)c01_s0181; *(i8*)(intptr_t)(ws+4232) = v3933; - i8 v3934 = (i8)(intptr_t)(f173_Op2VV); + i8 v3934 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3934)(); } -const i1 c02_s0182[] = { 0x5e,0 }; - void f173_Op2VV(void); +const i1 c01_s0182[] = { 0x5e,0 }; + void f172_Op2VV(void); // emit_109 workspace at ws+4224 length ws+0 -void f297_emit_109(void) { +void f296_emit_109(void) { i1 v3935 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3935; - i8 v3936 = (i8)(intptr_t)c02_s0182; + i8 v3936 = (i8)(intptr_t)c01_s0182; *(i8*)(intptr_t)(ws+4232) = v3936; - i8 v3937 = (i8)(intptr_t)(f173_Op2VV); + i8 v3937 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3937)(); } -const i1 c02_s0183[] = { 0x5e,0 }; - void f173_Op2VV(void); +const i1 c01_s0183[] = { 0x5e,0 }; + void f172_Op2VV(void); // emit_110 workspace at ws+4224 length ws+0 -void f298_emit_110(void) { +void f297_emit_110(void) { i1 v3938 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3938; - i8 v3939 = (i8)(intptr_t)c02_s0183; + i8 v3939 = (i8)(intptr_t)c01_s0183; *(i8*)(intptr_t)(ws+4232) = v3939; - i8 v3940 = (i8)(intptr_t)(f173_Op2VV); + i8 v3940 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3940)(); } -const i1 c02_s0184[] = { 0x5e,0 }; - void f173_Op2VV(void); +const i1 c01_s0184[] = { 0x5e,0 }; + void f172_Op2VV(void); // emit_111 workspace at ws+4224 length ws+0 -void f299_emit_111(void) { +void f298_emit_111(void) { i1 v3941 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3941; - i8 v3942 = (i8)(intptr_t)c02_s0184; + i8 v3942 = (i8)(intptr_t)c01_s0184; *(i8*)(intptr_t)(ws+4232) = v3942; - i8 v3943 = (i8)(intptr_t)(f173_Op2VV); + i8 v3943 = (i8)(intptr_t)(f172_Op2VV); ((void(*)(void))(intptr_t)v3943)(); } -const i1 c02_s0185[] = { 0x2d,0 }; - void f177_Op1V(void); +const i1 c01_s0185[] = { 0x2d,0 }; + void f176_Op1V(void); // emit_112 workspace at ws+4224 length ws+0 -void f300_emit_112(void) { +void f299_emit_112(void) { i1 v3944 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3944; - i8 v3945 = (i8)(intptr_t)c02_s0185; + i8 v3945 = (i8)(intptr_t)c01_s0185; *(i8*)(intptr_t)(ws+4232) = v3945; - i8 v3946 = (i8)(intptr_t)(f177_Op1V); + i8 v3946 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3946)(); } -const i1 c02_s0186[] = { 0x2d,0 }; - void f177_Op1V(void); +const i1 c01_s0186[] = { 0x2d,0 }; + void f176_Op1V(void); // emit_113 workspace at ws+4224 length ws+0 -void f301_emit_113(void) { +void f300_emit_113(void) { i1 v3947 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3947; - i8 v3948 = (i8)(intptr_t)c02_s0186; + i8 v3948 = (i8)(intptr_t)c01_s0186; *(i8*)(intptr_t)(ws+4232) = v3948; - i8 v3949 = (i8)(intptr_t)(f177_Op1V); + i8 v3949 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3949)(); } -const i1 c02_s0187[] = { 0x2d,0 }; - void f177_Op1V(void); +const i1 c01_s0187[] = { 0x2d,0 }; + void f176_Op1V(void); // emit_114 workspace at ws+4224 length ws+0 -void f302_emit_114(void) { +void f301_emit_114(void) { i1 v3950 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3950; - i8 v3951 = (i8)(intptr_t)c02_s0187; + i8 v3951 = (i8)(intptr_t)c01_s0187; *(i8*)(intptr_t)(ws+4232) = v3951; - i8 v3952 = (i8)(intptr_t)(f177_Op1V); + i8 v3952 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3952)(); } -const i1 c02_s0188[] = { 0x2d,0 }; - void f177_Op1V(void); +const i1 c01_s0188[] = { 0x2d,0 }; + void f176_Op1V(void); // emit_115 workspace at ws+4224 length ws+0 -void f303_emit_115(void) { +void f302_emit_115(void) { i1 v3953 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3953; - i8 v3954 = (i8)(intptr_t)c02_s0188; + i8 v3954 = (i8)(intptr_t)c01_s0188; *(i8*)(intptr_t)(ws+4232) = v3954; - i8 v3955 = (i8)(intptr_t)(f177_Op1V); + i8 v3955 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3955)(); } -const i1 c02_s0189[] = { 0x7e,0 }; - void f177_Op1V(void); +const i1 c01_s0189[] = { 0x7e,0 }; + void f176_Op1V(void); // emit_116 workspace at ws+4224 length ws+0 -void f304_emit_116(void) { +void f303_emit_116(void) { i1 v3956 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3956; - i8 v3957 = (i8)(intptr_t)c02_s0189; + i8 v3957 = (i8)(intptr_t)c01_s0189; *(i8*)(intptr_t)(ws+4232) = v3957; - i8 v3958 = (i8)(intptr_t)(f177_Op1V); + i8 v3958 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3958)(); } -const i1 c02_s018a[] = { 0x7e,0 }; - void f177_Op1V(void); +const i1 c01_s018a[] = { 0x7e,0 }; + void f176_Op1V(void); // emit_117 workspace at ws+4224 length ws+0 -void f305_emit_117(void) { +void f304_emit_117(void) { i1 v3959 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3959; - i8 v3960 = (i8)(intptr_t)c02_s018a; + i8 v3960 = (i8)(intptr_t)c01_s018a; *(i8*)(intptr_t)(ws+4232) = v3960; - i8 v3961 = (i8)(intptr_t)(f177_Op1V); + i8 v3961 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3961)(); } -const i1 c02_s018b[] = { 0x7e,0 }; - void f177_Op1V(void); +const i1 c01_s018b[] = { 0x7e,0 }; + void f176_Op1V(void); // emit_118 workspace at ws+4224 length ws+0 -void f306_emit_118(void) { +void f305_emit_118(void) { i1 v3962 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3962; - i8 v3963 = (i8)(intptr_t)c02_s018b; + i8 v3963 = (i8)(intptr_t)c01_s018b; *(i8*)(intptr_t)(ws+4232) = v3963; - i8 v3964 = (i8)(intptr_t)(f177_Op1V); + i8 v3964 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3964)(); } -const i1 c02_s018c[] = { 0x7e,0 }; - void f177_Op1V(void); +const i1 c01_s018c[] = { 0x7e,0 }; + void f176_Op1V(void); // emit_119 workspace at ws+4224 length ws+0 -void f307_emit_119(void) { +void f306_emit_119(void) { i1 v3965 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3965; - i8 v3966 = (i8)(intptr_t)c02_s018c; + i8 v3966 = (i8)(intptr_t)c01_s018c; *(i8*)(intptr_t)(ws+4232) = v3966; - i8 v3967 = (i8)(intptr_t)(f177_Op1V); + i8 v3967 = (i8)(intptr_t)(f176_Op1V); ((void(*)(void))(intptr_t)v3967)(); } -const i1 c02_s018d[] = { 0x69,0x31,0 }; -const i1 c02_s018e[] = { 0x3c,0x3c,0 }; - void f178_Shift(void); +const i1 c01_s018d[] = { 0x69,0x31,0 }; +const i1 c01_s018e[] = { 0x3c,0x3c,0 }; + void f177_Shift(void); // emit_120 workspace at ws+4224 length ws+0 -void f308_emit_120(void) { +void f307_emit_120(void) { i1 v3968 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3968; - i8 v3969 = (i8)(intptr_t)c02_s018d; + i8 v3969 = (i8)(intptr_t)c01_s018d; *(i8*)(intptr_t)(ws+4232) = v3969; - i8 v3970 = (i8)(intptr_t)c02_s018e; + i8 v3970 = (i8)(intptr_t)c01_s018e; *(i8*)(intptr_t)(ws+4240) = v3970; - i8 v3971 = (i8)(intptr_t)(f178_Shift); + i8 v3971 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3971)(); } -const i1 c02_s018f[] = { 0x69,0x32,0 }; -const i1 c02_s0190[] = { 0x3c,0x3c,0 }; - void f178_Shift(void); +const i1 c01_s018f[] = { 0x69,0x32,0 }; +const i1 c01_s0190[] = { 0x3c,0x3c,0 }; + void f177_Shift(void); // emit_121 workspace at ws+4224 length ws+0 -void f309_emit_121(void) { +void f308_emit_121(void) { i1 v3972 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3972; - i8 v3973 = (i8)(intptr_t)c02_s018f; + i8 v3973 = (i8)(intptr_t)c01_s018f; *(i8*)(intptr_t)(ws+4232) = v3973; - i8 v3974 = (i8)(intptr_t)c02_s0190; + i8 v3974 = (i8)(intptr_t)c01_s0190; *(i8*)(intptr_t)(ws+4240) = v3974; - i8 v3975 = (i8)(intptr_t)(f178_Shift); + i8 v3975 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3975)(); } -const i1 c02_s0191[] = { 0x69,0x34,0 }; -const i1 c02_s0192[] = { 0x3c,0x3c,0 }; - void f178_Shift(void); +const i1 c01_s0191[] = { 0x69,0x34,0 }; +const i1 c01_s0192[] = { 0x3c,0x3c,0 }; + void f177_Shift(void); // emit_122 workspace at ws+4224 length ws+0 -void f310_emit_122(void) { +void f309_emit_122(void) { i1 v3976 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3976; - i8 v3977 = (i8)(intptr_t)c02_s0191; + i8 v3977 = (i8)(intptr_t)c01_s0191; *(i8*)(intptr_t)(ws+4232) = v3977; - i8 v3978 = (i8)(intptr_t)c02_s0192; + i8 v3978 = (i8)(intptr_t)c01_s0192; *(i8*)(intptr_t)(ws+4240) = v3978; - i8 v3979 = (i8)(intptr_t)(f178_Shift); + i8 v3979 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3979)(); } -const i1 c02_s0193[] = { 0x69,0x38,0 }; -const i1 c02_s0194[] = { 0x3c,0x3c,0 }; - void f178_Shift(void); +const i1 c01_s0193[] = { 0x69,0x38,0 }; +const i1 c01_s0194[] = { 0x3c,0x3c,0 }; + void f177_Shift(void); // emit_123 workspace at ws+4224 length ws+0 -void f311_emit_123(void) { +void f310_emit_123(void) { i1 v3980 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3980; - i8 v3981 = (i8)(intptr_t)c02_s0193; + i8 v3981 = (i8)(intptr_t)c01_s0193; *(i8*)(intptr_t)(ws+4232) = v3981; - i8 v3982 = (i8)(intptr_t)c02_s0194; + i8 v3982 = (i8)(intptr_t)c01_s0194; *(i8*)(intptr_t)(ws+4240) = v3982; - i8 v3983 = (i8)(intptr_t)(f178_Shift); + i8 v3983 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3983)(); } -const i1 c02_s0195[] = { 0x69,0x31,0 }; -const i1 c02_s0196[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s0195[] = { 0x69,0x31,0 }; +const i1 c01_s0196[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_124 workspace at ws+4224 length ws+0 -void f312_emit_124(void) { +void f311_emit_124(void) { i1 v3984 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v3984; - i8 v3985 = (i8)(intptr_t)c02_s0195; + i8 v3985 = (i8)(intptr_t)c01_s0195; *(i8*)(intptr_t)(ws+4232) = v3985; - i8 v3986 = (i8)(intptr_t)c02_s0196; + i8 v3986 = (i8)(intptr_t)c01_s0196; *(i8*)(intptr_t)(ws+4240) = v3986; - i8 v3987 = (i8)(intptr_t)(f178_Shift); + i8 v3987 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3987)(); } -const i1 c02_s0197[] = { 0x69,0x32,0 }; -const i1 c02_s0198[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s0197[] = { 0x69,0x32,0 }; +const i1 c01_s0198[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_125 workspace at ws+4224 length ws+0 -void f313_emit_125(void) { +void f312_emit_125(void) { i1 v3988 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v3988; - i8 v3989 = (i8)(intptr_t)c02_s0197; + i8 v3989 = (i8)(intptr_t)c01_s0197; *(i8*)(intptr_t)(ws+4232) = v3989; - i8 v3990 = (i8)(intptr_t)c02_s0198; + i8 v3990 = (i8)(intptr_t)c01_s0198; *(i8*)(intptr_t)(ws+4240) = v3990; - i8 v3991 = (i8)(intptr_t)(f178_Shift); + i8 v3991 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3991)(); } -const i1 c02_s0199[] = { 0x69,0x34,0 }; -const i1 c02_s019a[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s0199[] = { 0x69,0x34,0 }; +const i1 c01_s019a[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_126 workspace at ws+4224 length ws+0 -void f314_emit_126(void) { +void f313_emit_126(void) { i1 v3992 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v3992; - i8 v3993 = (i8)(intptr_t)c02_s0199; + i8 v3993 = (i8)(intptr_t)c01_s0199; *(i8*)(intptr_t)(ws+4232) = v3993; - i8 v3994 = (i8)(intptr_t)c02_s019a; + i8 v3994 = (i8)(intptr_t)c01_s019a; *(i8*)(intptr_t)(ws+4240) = v3994; - i8 v3995 = (i8)(intptr_t)(f178_Shift); + i8 v3995 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3995)(); } -const i1 c02_s019b[] = { 0x69,0x38,0 }; -const i1 c02_s019c[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s019b[] = { 0x69,0x38,0 }; +const i1 c01_s019c[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_127 workspace at ws+4224 length ws+0 -void f315_emit_127(void) { +void f314_emit_127(void) { i1 v3996 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v3996; - i8 v3997 = (i8)(intptr_t)c02_s019b; + i8 v3997 = (i8)(intptr_t)c01_s019b; *(i8*)(intptr_t)(ws+4232) = v3997; - i8 v3998 = (i8)(intptr_t)c02_s019c; + i8 v3998 = (i8)(intptr_t)c01_s019c; *(i8*)(intptr_t)(ws+4240) = v3998; - i8 v3999 = (i8)(intptr_t)(f178_Shift); + i8 v3999 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v3999)(); } -const i1 c02_s019d[] = { 0x73,0x31,0 }; -const i1 c02_s019e[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s019d[] = { 0x73,0x31,0 }; +const i1 c01_s019e[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_128 workspace at ws+4224 length ws+0 -void f316_emit_128(void) { +void f315_emit_128(void) { i1 v4000 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v4000; - i8 v4001 = (i8)(intptr_t)c02_s019d; + i8 v4001 = (i8)(intptr_t)c01_s019d; *(i8*)(intptr_t)(ws+4232) = v4001; - i8 v4002 = (i8)(intptr_t)c02_s019e; + i8 v4002 = (i8)(intptr_t)c01_s019e; *(i8*)(intptr_t)(ws+4240) = v4002; - i8 v4003 = (i8)(intptr_t)(f178_Shift); + i8 v4003 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v4003)(); } -const i1 c02_s019f[] = { 0x73,0x32,0 }; -const i1 c02_s01a0[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s019f[] = { 0x73,0x32,0 }; +const i1 c01_s01a0[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_129 workspace at ws+4224 length ws+0 -void f317_emit_129(void) { +void f316_emit_129(void) { i1 v4004 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v4004; - i8 v4005 = (i8)(intptr_t)c02_s019f; + i8 v4005 = (i8)(intptr_t)c01_s019f; *(i8*)(intptr_t)(ws+4232) = v4005; - i8 v4006 = (i8)(intptr_t)c02_s01a0; + i8 v4006 = (i8)(intptr_t)c01_s01a0; *(i8*)(intptr_t)(ws+4240) = v4006; - i8 v4007 = (i8)(intptr_t)(f178_Shift); + i8 v4007 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v4007)(); } -const i1 c02_s01a1[] = { 0x73,0x34,0 }; -const i1 c02_s01a2[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s01a1[] = { 0x73,0x34,0 }; +const i1 c01_s01a2[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_130 workspace at ws+4224 length ws+0 -void f318_emit_130(void) { +void f317_emit_130(void) { i1 v4008 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v4008; - i8 v4009 = (i8)(intptr_t)c02_s01a1; + i8 v4009 = (i8)(intptr_t)c01_s01a1; *(i8*)(intptr_t)(ws+4232) = v4009; - i8 v4010 = (i8)(intptr_t)c02_s01a2; + i8 v4010 = (i8)(intptr_t)c01_s01a2; *(i8*)(intptr_t)(ws+4240) = v4010; - i8 v4011 = (i8)(intptr_t)(f178_Shift); + i8 v4011 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v4011)(); } -const i1 c02_s01a3[] = { 0x73,0x38,0 }; -const i1 c02_s01a4[] = { 0x3e,0x3e,0 }; - void f178_Shift(void); +const i1 c01_s01a3[] = { 0x73,0x38,0 }; +const i1 c01_s01a4[] = { 0x3e,0x3e,0 }; + void f177_Shift(void); // emit_131 workspace at ws+4224 length ws+0 -void f319_emit_131(void) { +void f318_emit_131(void) { i1 v4012 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v4012; - i8 v4013 = (i8)(intptr_t)c02_s01a3; + i8 v4013 = (i8)(intptr_t)c01_s01a3; *(i8*)(intptr_t)(ws+4232) = v4013; - i8 v4014 = (i8)(intptr_t)c02_s01a4; + i8 v4014 = (i8)(intptr_t)c01_s01a4; *(i8*)(intptr_t)(ws+4240) = v4014; - i8 v4015 = (i8)(intptr_t)(f178_Shift); + i8 v4015 = (i8)(intptr_t)(f177_Shift); ((void(*)(void))(intptr_t)v4015)(); } -const i1 c02_s01a5[] = { 0x3d,0x3d,0 }; - void f179_Branch(void); +const i1 c01_s01a5[] = { 0x3d,0x3d,0 }; + void f178_Branch(void); // emit_132 workspace at ws+4224 length ws+0 -void f320_emit_132(void) { +void f319_emit_132(void) { i8 v4016 = (i8)(intptr_t)(ws+4128); i8 v4017 = *(i8*)(intptr_t)v4016; i8 v4018 = v4017+(+16); i8 v4019 = *(i8*)(intptr_t)v4018; *(i8*)(intptr_t)(ws+4224) = v4019; - i8 v4020 = (i8)(intptr_t)c02_s01a5; + i8 v4020 = (i8)(intptr_t)c01_s01a5; *(i8*)(intptr_t)(ws+4232) = v4020; - i8 v4021 = (i8)(intptr_t)(f179_Branch); + i8 v4021 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4021)(); } -const i1 c02_s01a6[] = { 0x3d,0x3d,0 }; - void f179_Branch(void); +const i1 c01_s01a6[] = { 0x3d,0x3d,0 }; + void f178_Branch(void); // emit_133 workspace at ws+4224 length ws+0 -void f321_emit_133(void) { +void f320_emit_133(void) { i8 v4022 = (i8)(intptr_t)(ws+4128); i8 v4023 = *(i8*)(intptr_t)v4022; i8 v4024 = v4023+(+16); i8 v4025 = *(i8*)(intptr_t)v4024; *(i8*)(intptr_t)(ws+4224) = v4025; - i8 v4026 = (i8)(intptr_t)c02_s01a6; + i8 v4026 = (i8)(intptr_t)c01_s01a6; *(i8*)(intptr_t)(ws+4232) = v4026; - i8 v4027 = (i8)(intptr_t)(f179_Branch); + i8 v4027 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4027)(); } -const i1 c02_s01a7[] = { 0x3d,0x3d,0 }; - void f179_Branch(void); +const i1 c01_s01a7[] = { 0x3d,0x3d,0 }; + void f178_Branch(void); // emit_134 workspace at ws+4224 length ws+0 -void f322_emit_134(void) { +void f321_emit_134(void) { i8 v4028 = (i8)(intptr_t)(ws+4128); i8 v4029 = *(i8*)(intptr_t)v4028; i8 v4030 = v4029+(+16); i8 v4031 = *(i8*)(intptr_t)v4030; *(i8*)(intptr_t)(ws+4224) = v4031; - i8 v4032 = (i8)(intptr_t)c02_s01a7; + i8 v4032 = (i8)(intptr_t)c01_s01a7; *(i8*)(intptr_t)(ws+4232) = v4032; - i8 v4033 = (i8)(intptr_t)(f179_Branch); + i8 v4033 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4033)(); } -const i1 c02_s01a8[] = { 0x3d,0x3d,0 }; - void f179_Branch(void); +const i1 c01_s01a8[] = { 0x3d,0x3d,0 }; + void f178_Branch(void); // emit_135 workspace at ws+4224 length ws+0 -void f323_emit_135(void) { +void f322_emit_135(void) { i8 v4034 = (i8)(intptr_t)(ws+4128); i8 v4035 = *(i8*)(intptr_t)v4034; i8 v4036 = v4035+(+16); i8 v4037 = *(i8*)(intptr_t)v4036; *(i8*)(intptr_t)(ws+4224) = v4037; - i8 v4038 = (i8)(intptr_t)c02_s01a8; + i8 v4038 = (i8)(intptr_t)c01_s01a8; *(i8*)(intptr_t)(ws+4232) = v4038; - i8 v4039 = (i8)(intptr_t)(f179_Branch); + i8 v4039 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4039)(); } -const i1 c02_s01a9[] = { 0x3c,0 }; - void f179_Branch(void); +const i1 c01_s01a9[] = { 0x3c,0 }; + void f178_Branch(void); // emit_136 workspace at ws+4224 length ws+0 -void f324_emit_136(void) { +void f323_emit_136(void) { i8 v4040 = (i8)(intptr_t)(ws+4128); i8 v4041 = *(i8*)(intptr_t)v4040; i8 v4042 = v4041+(+16); i8 v4043 = *(i8*)(intptr_t)v4042; *(i8*)(intptr_t)(ws+4224) = v4043; - i8 v4044 = (i8)(intptr_t)c02_s01a9; + i8 v4044 = (i8)(intptr_t)c01_s01a9; *(i8*)(intptr_t)(ws+4232) = v4044; - i8 v4045 = (i8)(intptr_t)(f179_Branch); + i8 v4045 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4045)(); } -const i1 c02_s01aa[] = { 0x3c,0 }; - void f179_Branch(void); +const i1 c01_s01aa[] = { 0x3c,0 }; + void f178_Branch(void); // emit_137 workspace at ws+4224 length ws+0 -void f325_emit_137(void) { +void f324_emit_137(void) { i8 v4046 = (i8)(intptr_t)(ws+4128); i8 v4047 = *(i8*)(intptr_t)v4046; i8 v4048 = v4047+(+16); i8 v4049 = *(i8*)(intptr_t)v4048; *(i8*)(intptr_t)(ws+4224) = v4049; - i8 v4050 = (i8)(intptr_t)c02_s01aa; + i8 v4050 = (i8)(intptr_t)c01_s01aa; *(i8*)(intptr_t)(ws+4232) = v4050; - i8 v4051 = (i8)(intptr_t)(f179_Branch); + i8 v4051 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4051)(); } -const i1 c02_s01ab[] = { 0x3c,0 }; - void f179_Branch(void); +const i1 c01_s01ab[] = { 0x3c,0 }; + void f178_Branch(void); // emit_138 workspace at ws+4224 length ws+0 -void f326_emit_138(void) { +void f325_emit_138(void) { i8 v4052 = (i8)(intptr_t)(ws+4128); i8 v4053 = *(i8*)(intptr_t)v4052; i8 v4054 = v4053+(+16); i8 v4055 = *(i8*)(intptr_t)v4054; *(i8*)(intptr_t)(ws+4224) = v4055; - i8 v4056 = (i8)(intptr_t)c02_s01ab; + i8 v4056 = (i8)(intptr_t)c01_s01ab; *(i8*)(intptr_t)(ws+4232) = v4056; - i8 v4057 = (i8)(intptr_t)(f179_Branch); + i8 v4057 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4057)(); } -const i1 c02_s01ac[] = { 0x3c,0 }; - void f179_Branch(void); +const i1 c01_s01ac[] = { 0x3c,0 }; + void f178_Branch(void); // emit_139 workspace at ws+4224 length ws+0 -void f327_emit_139(void) { +void f326_emit_139(void) { i8 v4058 = (i8)(intptr_t)(ws+4128); i8 v4059 = *(i8*)(intptr_t)v4058; i8 v4060 = v4059+(+16); i8 v4061 = *(i8*)(intptr_t)v4060; *(i8*)(intptr_t)(ws+4224) = v4061; - i8 v4062 = (i8)(intptr_t)c02_s01ac; + i8 v4062 = (i8)(intptr_t)c01_s01ac; *(i8*)(intptr_t)(ws+4232) = v4062; - i8 v4063 = (i8)(intptr_t)(f179_Branch); + i8 v4063 = (i8)(intptr_t)(f178_Branch); ((void(*)(void))(intptr_t)v4063)(); } -const i1 c02_s01ad[] = { 0x3c,0 }; - void f180_BranchSigned(void); +const i1 c01_s01ad[] = { 0x3c,0 }; + void f179_BranchSigned(void); // emit_140 workspace at ws+4224 length ws+0 -void f328_emit_140(void) { +void f327_emit_140(void) { i8 v4064 = (i8)(intptr_t)(ws+4128); i8 v4065 = *(i8*)(intptr_t)v4064; @@ -10050,18 +10050,18 @@ void f328_emit_140(void) { *(i8*)(intptr_t)(ws+4224) = v4067; i1 v4068 = (i1)+1; *(i1*)(intptr_t)(ws+4232) = v4068; - i8 v4069 = (i8)(intptr_t)c02_s01ad; + i8 v4069 = (i8)(intptr_t)c01_s01ad; *(i8*)(intptr_t)(ws+4240) = v4069; - i8 v4070 = (i8)(intptr_t)(f180_BranchSigned); + i8 v4070 = (i8)(intptr_t)(f179_BranchSigned); ((void(*)(void))(intptr_t)v4070)(); } -const i1 c02_s01ae[] = { 0x3c,0 }; - void f180_BranchSigned(void); +const i1 c01_s01ae[] = { 0x3c,0 }; + void f179_BranchSigned(void); // emit_141 workspace at ws+4224 length ws+0 -void f329_emit_141(void) { +void f328_emit_141(void) { i8 v4071 = (i8)(intptr_t)(ws+4128); i8 v4072 = *(i8*)(intptr_t)v4071; @@ -10070,18 +10070,18 @@ void f329_emit_141(void) { *(i8*)(intptr_t)(ws+4224) = v4074; i1 v4075 = (i1)+2; *(i1*)(intptr_t)(ws+4232) = v4075; - i8 v4076 = (i8)(intptr_t)c02_s01ae; + i8 v4076 = (i8)(intptr_t)c01_s01ae; *(i8*)(intptr_t)(ws+4240) = v4076; - i8 v4077 = (i8)(intptr_t)(f180_BranchSigned); + i8 v4077 = (i8)(intptr_t)(f179_BranchSigned); ((void(*)(void))(intptr_t)v4077)(); } -const i1 c02_s01af[] = { 0x3c,0 }; - void f180_BranchSigned(void); +const i1 c01_s01af[] = { 0x3c,0 }; + void f179_BranchSigned(void); // emit_142 workspace at ws+4224 length ws+0 -void f330_emit_142(void) { +void f329_emit_142(void) { i8 v4078 = (i8)(intptr_t)(ws+4128); i8 v4079 = *(i8*)(intptr_t)v4078; @@ -10090,18 +10090,18 @@ void f330_emit_142(void) { *(i8*)(intptr_t)(ws+4224) = v4081; i1 v4082 = (i1)+4; *(i1*)(intptr_t)(ws+4232) = v4082; - i8 v4083 = (i8)(intptr_t)c02_s01af; + i8 v4083 = (i8)(intptr_t)c01_s01af; *(i8*)(intptr_t)(ws+4240) = v4083; - i8 v4084 = (i8)(intptr_t)(f180_BranchSigned); + i8 v4084 = (i8)(intptr_t)(f179_BranchSigned); ((void(*)(void))(intptr_t)v4084)(); } -const i1 c02_s01b0[] = { 0x3c,0 }; - void f180_BranchSigned(void); +const i1 c01_s01b0[] = { 0x3c,0 }; + void f179_BranchSigned(void); // emit_143 workspace at ws+4224 length ws+0 -void f331_emit_143(void) { +void f330_emit_143(void) { i8 v4085 = (i8)(intptr_t)(ws+4128); i8 v4086 = *(i8*)(intptr_t)v4085; @@ -10110,17 +10110,17 @@ void f331_emit_143(void) { *(i8*)(intptr_t)(ws+4224) = v4088; i1 v4089 = (i1)+8; *(i1*)(intptr_t)(ws+4232) = v4089; - i8 v4090 = (i8)(intptr_t)c02_s01b0; + i8 v4090 = (i8)(intptr_t)c01_s01b0; *(i8*)(intptr_t)(ws+4240) = v4090; - i8 v4091 = (i8)(intptr_t)(f180_BranchSigned); + i8 v4091 = (i8)(intptr_t)(f179_BranchSigned); ((void(*)(void))(intptr_t)v4091)(); } - void f182_Whencase(void); + void f181_Whencase(void); // emit_148 workspace at ws+4224 length ws+0 -void f332_emit_148(void) { +void f331_emit_148(void) { i8 v4092 = (i8)(intptr_t)(ws+4136); i8 v4093 = *(i8*)(intptr_t)v4092; @@ -10132,15 +10132,15 @@ void f332_emit_148(void) { i8 v4098 = v4097+(+4); i2 v4099 = *(i2*)(intptr_t)v4098; *(i2*)(intptr_t)(ws+4228) = v4099; - i8 v4100 = (i8)(intptr_t)(f182_Whencase); + i8 v4100 = (i8)(intptr_t)(f181_Whencase); ((void(*)(void))(intptr_t)v4100)(); } - void f182_Whencase(void); + void f181_Whencase(void); // emit_149 workspace at ws+4224 length ws+0 -void f333_emit_149(void) { +void f332_emit_149(void) { i8 v4101 = (i8)(intptr_t)(ws+4136); i8 v4102 = *(i8*)(intptr_t)v4101; @@ -10152,15 +10152,15 @@ void f333_emit_149(void) { i8 v4107 = v4106+(+4); i2 v4108 = *(i2*)(intptr_t)v4107; *(i2*)(intptr_t)(ws+4228) = v4108; - i8 v4109 = (i8)(intptr_t)(f182_Whencase); + i8 v4109 = (i8)(intptr_t)(f181_Whencase); ((void(*)(void))(intptr_t)v4109)(); } - void f182_Whencase(void); + void f181_Whencase(void); // emit_150 workspace at ws+4224 length ws+0 -void f334_emit_150(void) { +void f333_emit_150(void) { i8 v4110 = (i8)(intptr_t)(ws+4136); i8 v4111 = *(i8*)(intptr_t)v4110; @@ -10172,15 +10172,15 @@ void f334_emit_150(void) { i8 v4116 = v4115+(+4); i2 v4117 = *(i2*)(intptr_t)v4116; *(i2*)(intptr_t)(ws+4228) = v4117; - i8 v4118 = (i8)(intptr_t)(f182_Whencase); + i8 v4118 = (i8)(intptr_t)(f181_Whencase); ((void(*)(void))(intptr_t)v4118)(); } - void f182_Whencase(void); + void f181_Whencase(void); // emit_151 workspace at ws+4224 length ws+0 -void f335_emit_151(void) { +void f334_emit_151(void) { i8 v4119 = (i8)(intptr_t)(ws+4136); i8 v4120 = *(i8*)(intptr_t)v4119; @@ -10191,14 +10191,14 @@ void f335_emit_151(void) { i8 v4124 = v4123+(+4); i2 v4125 = *(i2*)(intptr_t)v4124; *(i2*)(intptr_t)(ws+4228) = v4125; - i8 v4126 = (i8)(intptr_t)(f182_Whencase); + i8 v4126 = (i8)(intptr_t)(f181_Whencase); ((void(*)(void))(intptr_t)v4126)(); } // emit_152 workspace at ws+4224 length ws+0 -void f336_emit_152(void) { +void f335_emit_152(void) { i8 v4127 = (i8)(intptr_t)(ws+3832); i1 v4128 = *(i1*)(intptr_t)v4127; @@ -10209,7 +10209,7 @@ void f336_emit_152(void) { } // emit_153 workspace at ws+4224 length ws+0 -void f337_emit_153(void) { +void f336_emit_153(void) { i8 v4131 = (i8)(intptr_t)(ws+3832); i1 v4132 = *(i1*)(intptr_t)v4131; @@ -10220,7 +10220,7 @@ void f337_emit_153(void) { } // emit_154 workspace at ws+4224 length ws+0 -void f338_emit_154(void) { +void f337_emit_154(void) { i8 v4135 = (i8)(intptr_t)(ws+3832); i1 v4136 = *(i1*)(intptr_t)v4135; @@ -10231,7 +10231,7 @@ void f338_emit_154(void) { } // emit_155 workspace at ws+4224 length ws+0 -void f339_emit_155(void) { +void f338_emit_155(void) { i8 v4139 = (i8)(intptr_t)(ws+3832); i1 v4140 = *(i1*)(intptr_t)v4139; @@ -10240,10 +10240,10 @@ void f339_emit_155(void) { *(i1*)(intptr_t)v4142 = v4141; } - void f183_Cast(void); + void f182_Cast(void); // emit_156 workspace at ws+4224 length ws+0 -void f340_emit_156(void) { +void f339_emit_156(void) { i1 v4143 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v4143; @@ -10253,15 +10253,15 @@ void f340_emit_156(void) { i8 v4146 = *(i8*)(intptr_t)v4145; i1 v4147 = *(i1*)(intptr_t)v4146; *(i1*)(intptr_t)(ws+4226) = v4147; - i8 v4148 = (i8)(intptr_t)(f183_Cast); + i8 v4148 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4148)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_157 workspace at ws+4224 length ws+0 -void f341_emit_157(void) { +void f340_emit_157(void) { i1 v4149 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v4149; @@ -10271,15 +10271,15 @@ void f341_emit_157(void) { i8 v4152 = *(i8*)(intptr_t)v4151; i1 v4153 = *(i1*)(intptr_t)v4152; *(i1*)(intptr_t)(ws+4226) = v4153; - i8 v4154 = (i8)(intptr_t)(f183_Cast); + i8 v4154 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4154)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_158 workspace at ws+4224 length ws+0 -void f342_emit_158(void) { +void f341_emit_158(void) { i1 v4155 = (i1)+1; *(i1*)(intptr_t)(ws+4224) = v4155; @@ -10289,15 +10289,15 @@ void f342_emit_158(void) { i8 v4158 = *(i8*)(intptr_t)v4157; i1 v4159 = *(i1*)(intptr_t)v4158; *(i1*)(intptr_t)(ws+4226) = v4159; - i8 v4160 = (i8)(intptr_t)(f183_Cast); + i8 v4160 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4160)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_159 workspace at ws+4224 length ws+0 -void f343_emit_159(void) { +void f342_emit_159(void) { i1 v4161 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v4161; @@ -10307,15 +10307,15 @@ void f343_emit_159(void) { i8 v4164 = *(i8*)(intptr_t)v4163; i1 v4165 = *(i1*)(intptr_t)v4164; *(i1*)(intptr_t)(ws+4226) = v4165; - i8 v4166 = (i8)(intptr_t)(f183_Cast); + i8 v4166 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4166)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_160 workspace at ws+4224 length ws+0 -void f344_emit_160(void) { +void f343_emit_160(void) { i1 v4167 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v4167; @@ -10325,15 +10325,15 @@ void f344_emit_160(void) { i8 v4170 = *(i8*)(intptr_t)v4169; i1 v4171 = *(i1*)(intptr_t)v4170; *(i1*)(intptr_t)(ws+4226) = v4171; - i8 v4172 = (i8)(intptr_t)(f183_Cast); + i8 v4172 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4172)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_161 workspace at ws+4224 length ws+0 -void f345_emit_161(void) { +void f344_emit_161(void) { i1 v4173 = (i1)+2; *(i1*)(intptr_t)(ws+4224) = v4173; @@ -10343,15 +10343,15 @@ void f345_emit_161(void) { i8 v4176 = *(i8*)(intptr_t)v4175; i1 v4177 = *(i1*)(intptr_t)v4176; *(i1*)(intptr_t)(ws+4226) = v4177; - i8 v4178 = (i8)(intptr_t)(f183_Cast); + i8 v4178 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4178)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_162 workspace at ws+4224 length ws+0 -void f346_emit_162(void) { +void f345_emit_162(void) { i1 v4179 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v4179; @@ -10361,15 +10361,15 @@ void f346_emit_162(void) { i8 v4182 = *(i8*)(intptr_t)v4181; i1 v4183 = *(i1*)(intptr_t)v4182; *(i1*)(intptr_t)(ws+4226) = v4183; - i8 v4184 = (i8)(intptr_t)(f183_Cast); + i8 v4184 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4184)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_163 workspace at ws+4224 length ws+0 -void f347_emit_163(void) { +void f346_emit_163(void) { i1 v4185 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v4185; @@ -10379,15 +10379,15 @@ void f347_emit_163(void) { i8 v4188 = *(i8*)(intptr_t)v4187; i1 v4189 = *(i1*)(intptr_t)v4188; *(i1*)(intptr_t)(ws+4226) = v4189; - i8 v4190 = (i8)(intptr_t)(f183_Cast); + i8 v4190 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4190)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_164 workspace at ws+4224 length ws+0 -void f348_emit_164(void) { +void f347_emit_164(void) { i1 v4191 = (i1)+4; *(i1*)(intptr_t)(ws+4224) = v4191; @@ -10397,15 +10397,15 @@ void f348_emit_164(void) { i8 v4194 = *(i8*)(intptr_t)v4193; i1 v4195 = *(i1*)(intptr_t)v4194; *(i1*)(intptr_t)(ws+4226) = v4195; - i8 v4196 = (i8)(intptr_t)(f183_Cast); + i8 v4196 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4196)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_165 workspace at ws+4224 length ws+0 -void f349_emit_165(void) { +void f348_emit_165(void) { i1 v4197 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v4197; @@ -10415,15 +10415,15 @@ void f349_emit_165(void) { i8 v4200 = *(i8*)(intptr_t)v4199; i1 v4201 = *(i1*)(intptr_t)v4200; *(i1*)(intptr_t)(ws+4226) = v4201; - i8 v4202 = (i8)(intptr_t)(f183_Cast); + i8 v4202 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4202)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_166 workspace at ws+4224 length ws+0 -void f350_emit_166(void) { +void f349_emit_166(void) { i1 v4203 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v4203; @@ -10433,15 +10433,15 @@ void f350_emit_166(void) { i8 v4206 = *(i8*)(intptr_t)v4205; i1 v4207 = *(i1*)(intptr_t)v4206; *(i1*)(intptr_t)(ws+4226) = v4207; - i8 v4208 = (i8)(intptr_t)(f183_Cast); + i8 v4208 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4208)(); } - void f183_Cast(void); + void f182_Cast(void); // emit_167 workspace at ws+4224 length ws+0 -void f351_emit_167(void) { +void f350_emit_167(void) { i1 v4209 = (i1)+8; *(i1*)(intptr_t)(ws+4224) = v4209; @@ -10451,28 +10451,28 @@ void f351_emit_167(void) { i8 v4212 = *(i8*)(intptr_t)v4211; i1 v4213 = *(i1*)(intptr_t)v4212; *(i1*)(intptr_t)(ws+4226) = v4213; - i8 v4214 = (i8)(intptr_t)(f183_Cast); + i8 v4214 = (i8)(intptr_t)(f182_Cast); ((void(*)(void))(intptr_t)v4214)(); } - void f160_Push(void); -const i1 c02_s01b1[] = { 0x09,0x69,0x38,0x20,0x76,0 }; - void f92_E(void); - void f94_E_u16(void); -const i1 c02_s01b2[] = { 0x20,0x3d,0x20,0x28,0x69,0x38,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0 }; - void f92_E(void); - void f83_E_b8(void); - void f83_E_b8(void); - void f184_E_string(void); - void f101_E_h16(void); -const i1 c02_s01b3[] = { 0x3b,0x0a,0 }; - void f92_E(void); + void f159_Push(void); +const i1 c01_s01b1[] = { 0x09,0x69,0x38,0x20,0x76,0 }; + void f91_E(void); + void f93_E_u16(void); +const i1 c01_s01b2[] = { 0x20,0x3d,0x20,0x28,0x69,0x38,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0 }; + void f91_E(void); + void f82_E_b8(void); + void f82_E_b8(void); + void f183_E_string(void); + void f100_E_h16(void); +const i1 c01_s01b3[] = { 0x3b,0x0a,0 }; + void f91_E(void); // emit_168 workspace at ws+4224 length ws+6 -void f352_emit_168(void) { +void f351_emit_168(void) { - i8 v4215 = (i8)(intptr_t)(f160_Push); + i8 v4215 = (i8)(intptr_t)(f159_Push); ((void(*)(void))(intptr_t)v4215)(); @@ -10485,34 +10485,34 @@ void f352_emit_168(void) { i8 v4220 = (i8)(intptr_t)(ws+4226); *(i2*)(intptr_t)v4220 = v4219; - i8 v4221 = (i8)(intptr_t)c02_s01b1; + i8 v4221 = (i8)(intptr_t)c01_s01b1; *(i8*)(intptr_t)(ws+4320) = v4221; - i8 v4222 = (i8)(intptr_t)(f92_E); + i8 v4222 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4222)(); i8 v4223 = (i8)(intptr_t)(ws+4226); i2 v4224 = *(i2*)(intptr_t)v4223; *(i2*)(intptr_t)(ws+4272) = v4224; - i8 v4225 = (i8)(intptr_t)(f94_E_u16); + i8 v4225 = (i8)(intptr_t)(f93_E_u16); ((void(*)(void))(intptr_t)v4225)(); - i8 v4226 = (i8)(intptr_t)c02_s01b2; + i8 v4226 = (i8)(intptr_t)c01_s01b2; *(i8*)(intptr_t)(ws+4320) = v4226; - i8 v4227 = (i8)(intptr_t)(f92_E); + i8 v4227 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4227)(); i1 v4228 = (i1)+3; *(i1*)(intptr_t)(ws+4336) = v4228; - i8 v4229 = (i8)(intptr_t)(f83_E_b8); + i8 v4229 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v4229)(); i1 v4230 = (i1)+115; *(i1*)(intptr_t)(ws+4336) = v4230; - i8 v4231 = (i8)(intptr_t)(f83_E_b8); + i8 v4231 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v4231)(); @@ -10520,7 +10520,7 @@ void f352_emit_168(void) { i8 v4233 = *(i8*)(intptr_t)v4232; i8 v4234 = *(i8*)(intptr_t)v4233; *(i8*)(intptr_t)(ws+4232) = v4234; - i8 v4235 = (i8)(intptr_t)(f184_E_string); + i8 v4235 = (i8)(intptr_t)(f183_E_string); ((void(*)(void))(intptr_t)v4235)(); @@ -10531,37 +10531,37 @@ void f352_emit_168(void) { i8 v4238 = (i8)(intptr_t)(ws+4228); i2 v4239 = *(i2*)(intptr_t)v4238; *(i2*)(intptr_t)(ws+4272) = v4239; - i8 v4240 = (i8)(intptr_t)(f101_E_h16); + i8 v4240 = (i8)(intptr_t)(f100_E_h16); ((void(*)(void))(intptr_t)v4240)(); - i8 v4241 = (i8)(intptr_t)c02_s01b3; + i8 v4241 = (i8)(intptr_t)c01_s01b3; *(i8*)(intptr_t)(ws+4320) = v4241; - i8 v4242 = (i8)(intptr_t)(f92_E); + i8 v4242 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4242)(); } - void f106_EmitterOpenStream(void); -const i1 c02_s01b4[] = { 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x64,0x61,0x74,0x61,0x20,0 }; - void f92_E(void); - void f105_E_wsref(void); -const i1 c02_s01b5[] = { 0x5b,0x5d,0x20,0x3d,0x20,0x7b,0x0a,0 }; - void f92_E(void); + void f105_EmitterOpenStream(void); +const i1 c01_s01b4[] = { 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x64,0x61,0x74,0x61,0x20,0 }; + void f91_E(void); + void f104_E_wsref(void); +const i1 c01_s01b5[] = { 0x5b,0x5d,0x20,0x3d,0x20,0x7b,0x0a,0 }; + void f91_E(void); // emit_169 workspace at ws+4224 length ws+0 -void f353_emit_169(void) { +void f352_emit_169(void) { i8 v4243 = (i8)(intptr_t)(ws+40); i8 v4244 = *(i8*)(intptr_t)v4243; *(i8*)(intptr_t)(ws+4248) = v4244; - i8 v4245 = (i8)(intptr_t)(f106_EmitterOpenStream); + i8 v4245 = (i8)(intptr_t)(f105_EmitterOpenStream); ((void(*)(void))(intptr_t)v4245)(); - i8 v4246 = (i8)(intptr_t)c02_s01b4; + i8 v4246 = (i8)(intptr_t)c01_s01b4; *(i8*)(intptr_t)(ws+4320) = v4246; - i8 v4247 = (i8)(intptr_t)(f92_E); + i8 v4247 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4247)(); @@ -10581,13 +10581,13 @@ void f353_emit_169(void) { i8 v4259 = v4258+(+12); i2 v4260 = *(i2*)(intptr_t)v4259; *(i2*)(intptr_t)(ws+4268) = v4260; - i8 v4261 = (i8)(intptr_t)(f105_E_wsref); + i8 v4261 = (i8)(intptr_t)(f104_E_wsref); ((void(*)(void))(intptr_t)v4261)(); - i8 v4262 = (i8)(intptr_t)c02_s01b5; + i8 v4262 = (i8)(intptr_t)c01_s01b5; *(i8*)(intptr_t)(ws+4320) = v4262; - i8 v4263 = (i8)(intptr_t)(f92_E); + i8 v4263 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4263)(); @@ -10596,83 +10596,83 @@ void f353_emit_169(void) { *(i1*)(intptr_t)v4265 = v4264; } - void f186_E_bytes(void); + void f185_E_bytes(void); // emit_170 workspace at ws+4224 length ws+0 -void f354_emit_170(void) { +void f353_emit_170(void) { i8 v4266 = (i8)(intptr_t)(ws+4136); i8 v4267 = *(i8*)(intptr_t)v4266; *(i8*)(intptr_t)(ws+4224) = v4267; i1 v4268 = (i1)+1; *(i1*)(intptr_t)(ws+4232) = v4268; - i8 v4269 = (i8)(intptr_t)(f186_E_bytes); + i8 v4269 = (i8)(intptr_t)(f185_E_bytes); ((void(*)(void))(intptr_t)v4269)(); } - void f186_E_bytes(void); + void f185_E_bytes(void); // emit_171 workspace at ws+4224 length ws+0 -void f355_emit_171(void) { +void f354_emit_171(void) { i8 v4270 = (i8)(intptr_t)(ws+4136); i8 v4271 = *(i8*)(intptr_t)v4270; *(i8*)(intptr_t)(ws+4224) = v4271; i1 v4272 = (i1)+2; *(i1*)(intptr_t)(ws+4232) = v4272; - i8 v4273 = (i8)(intptr_t)(f186_E_bytes); + i8 v4273 = (i8)(intptr_t)(f185_E_bytes); ((void(*)(void))(intptr_t)v4273)(); } - void f186_E_bytes(void); + void f185_E_bytes(void); // emit_172 workspace at ws+4224 length ws+0 -void f356_emit_172(void) { +void f355_emit_172(void) { i8 v4274 = (i8)(intptr_t)(ws+4136); i8 v4275 = *(i8*)(intptr_t)v4274; *(i8*)(intptr_t)(ws+4224) = v4275; i1 v4276 = (i1)+4; *(i1*)(intptr_t)(ws+4232) = v4276; - i8 v4277 = (i8)(intptr_t)(f186_E_bytes); + i8 v4277 = (i8)(intptr_t)(f185_E_bytes); ((void(*)(void))(intptr_t)v4277)(); } - void f186_E_bytes(void); + void f185_E_bytes(void); // emit_173 workspace at ws+4224 length ws+0 -void f357_emit_173(void) { +void f356_emit_173(void) { i8 v4278 = (i8)(intptr_t)(ws+4136); i8 v4279 = *(i8*)(intptr_t)v4278; *(i8*)(intptr_t)(ws+4224) = v4279; i1 v4280 = (i1)+8; *(i1*)(intptr_t)(ws+4232) = v4280; - i8 v4281 = (i8)(intptr_t)(f186_E_bytes); + i8 v4281 = (i8)(intptr_t)(f185_E_bytes); ((void(*)(void))(intptr_t)v4281)(); } - void f187_CheckBufferAlignment(void); -const i1 c02_s01b6[] = { 0x09,0x7b,0x20,0x2e,0x70,0x74,0x72,0x20,0x3d,0x20,0x28,0x76,0x6f,0x69,0x64,0x2a,0x29,0 }; - void f92_E(void); - void f155_E_subref_sig(void); -const i1 c02_s01b7[] = { 0x20,0x7d,0x2c,0x0a,0 }; - void f92_E(void); + void f186_CheckBufferAlignment(void); +const i1 c01_s01b6[] = { 0x09,0x7b,0x20,0x2e,0x70,0x74,0x72,0x20,0x3d,0x20,0x28,0x76,0x6f,0x69,0x64,0x2a,0x29,0 }; + void f91_E(void); + void f154_E_subref_sig(void); +const i1 c01_s01b7[] = { 0x20,0x7d,0x2c,0x0a,0 }; + void f91_E(void); // emit_174 workspace at ws+4224 length ws+0 -void f358_emit_174(void) { +void f357_emit_174(void) { - i8 v4282 = (i8)(intptr_t)(f187_CheckBufferAlignment); + i8 v4282 = (i8)(intptr_t)(f186_CheckBufferAlignment); ((void(*)(void))(intptr_t)v4282)(); - i8 v4283 = (i8)(intptr_t)c02_s01b6; + i8 v4283 = (i8)(intptr_t)c01_s01b6; *(i8*)(intptr_t)(ws+4320) = v4283; - i8 v4284 = (i8)(intptr_t)(f92_E); + i8 v4284 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4284)(); @@ -10680,34 +10680,34 @@ void f358_emit_174(void) { i8 v4286 = *(i8*)(intptr_t)v4285; i8 v4287 = *(i8*)(intptr_t)v4286; *(i8*)(intptr_t)(ws+4232) = v4287; - i8 v4288 = (i8)(intptr_t)(f155_E_subref_sig); + i8 v4288 = (i8)(intptr_t)(f154_E_subref_sig); ((void(*)(void))(intptr_t)v4288)(); - i8 v4289 = (i8)(intptr_t)c02_s01b7; + i8 v4289 = (i8)(intptr_t)c01_s01b7; *(i8*)(intptr_t)(ws+4320) = v4289; - i8 v4290 = (i8)(intptr_t)(f92_E); + i8 v4290 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4290)(); } - void f187_CheckBufferAlignment(void); -const i1 c02_s01b8[] = { 0x09,0x7b,0x20,0x2e,0x70,0x74,0x72,0x20,0x3d,0x20,0x28,0x76,0x6f,0x69,0x64,0x2a,0x29,0 }; - void f92_E(void); - void f156_E_symref(void); -const i1 c02_s01b9[] = { 0x20,0x7d,0x2c,0x0a,0 }; - void f92_E(void); + void f186_CheckBufferAlignment(void); +const i1 c01_s01b8[] = { 0x09,0x7b,0x20,0x2e,0x70,0x74,0x72,0x20,0x3d,0x20,0x28,0x76,0x6f,0x69,0x64,0x2a,0x29,0 }; + void f91_E(void); + void f155_E_symref(void); +const i1 c01_s01b9[] = { 0x20,0x7d,0x2c,0x0a,0 }; + void f91_E(void); // emit_175 workspace at ws+4224 length ws+0 -void f359_emit_175(void) { +void f358_emit_175(void) { - i8 v4291 = (i8)(intptr_t)(f187_CheckBufferAlignment); + i8 v4291 = (i8)(intptr_t)(f186_CheckBufferAlignment); ((void(*)(void))(intptr_t)v4291)(); - i8 v4292 = (i8)(intptr_t)c02_s01b8; + i8 v4292 = (i8)(intptr_t)c01_s01b8; *(i8*)(intptr_t)(ws+4320) = v4292; - i8 v4293 = (i8)(intptr_t)(f92_E); + i8 v4293 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4293)(); @@ -10719,49 +10719,49 @@ void f359_emit_175(void) { i8 v4298 = v4297+(+16); i2 v4299 = *(i2*)(intptr_t)v4298; *(i2*)(intptr_t)(ws+4256) = v4299; - i8 v4300 = (i8)(intptr_t)(f156_E_symref); + i8 v4300 = (i8)(intptr_t)(f155_E_symref); ((void(*)(void))(intptr_t)v4300)(); - i8 v4301 = (i8)(intptr_t)c02_s01b9; + i8 v4301 = (i8)(intptr_t)c01_s01b9; *(i8*)(intptr_t)(ws+4320) = v4301; - i8 v4302 = (i8)(intptr_t)(f92_E); + i8 v4302 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4302)(); } - void f187_CheckBufferAlignment(void); -const i1 c02_s01ba[] = { 0x09,0x7b,0x20,0x2e,0x70,0x74,0x72,0x20,0x3d,0x20,0x28,0x76,0x6f,0x69,0x64,0x2a,0x29,0 }; - void f92_E(void); - void f83_E_b8(void); - void f83_E_b8(void); - void f184_E_string(void); - void f101_E_h16(void); -const i1 c02_s01bb[] = { 0x20,0x7d,0x2c,0x0a,0 }; - void f92_E(void); + void f186_CheckBufferAlignment(void); +const i1 c01_s01ba[] = { 0x09,0x7b,0x20,0x2e,0x70,0x74,0x72,0x20,0x3d,0x20,0x28,0x76,0x6f,0x69,0x64,0x2a,0x29,0 }; + void f91_E(void); + void f82_E_b8(void); + void f82_E_b8(void); + void f183_E_string(void); + void f100_E_h16(void); +const i1 c01_s01bb[] = { 0x20,0x7d,0x2c,0x0a,0 }; + void f91_E(void); // emit_176 workspace at ws+4224 length ws+2 -void f360_emit_176(void) { +void f359_emit_176(void) { - i8 v4303 = (i8)(intptr_t)(f187_CheckBufferAlignment); + i8 v4303 = (i8)(intptr_t)(f186_CheckBufferAlignment); ((void(*)(void))(intptr_t)v4303)(); - i8 v4304 = (i8)(intptr_t)c02_s01ba; + i8 v4304 = (i8)(intptr_t)c01_s01ba; *(i8*)(intptr_t)(ws+4320) = v4304; - i8 v4305 = (i8)(intptr_t)(f92_E); + i8 v4305 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4305)(); i1 v4306 = (i1)+3; *(i1*)(intptr_t)(ws+4336) = v4306; - i8 v4307 = (i8)(intptr_t)(f83_E_b8); + i8 v4307 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v4307)(); i1 v4308 = (i1)+115; *(i1*)(intptr_t)(ws+4336) = v4308; - i8 v4309 = (i8)(intptr_t)(f83_E_b8); + i8 v4309 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v4309)(); @@ -10769,7 +10769,7 @@ void f360_emit_176(void) { i8 v4311 = *(i8*)(intptr_t)v4310; i8 v4312 = *(i8*)(intptr_t)v4311; *(i8*)(intptr_t)(ws+4232) = v4312; - i8 v4313 = (i8)(intptr_t)(f184_E_string); + i8 v4313 = (i8)(intptr_t)(f183_E_string); ((void(*)(void))(intptr_t)v4313)(); @@ -10780,85 +10780,85 @@ void f360_emit_176(void) { i8 v4316 = (i8)(intptr_t)(ws+4224); i2 v4317 = *(i2*)(intptr_t)v4316; *(i2*)(intptr_t)(ws+4272) = v4317; - i8 v4318 = (i8)(intptr_t)(f101_E_h16); + i8 v4318 = (i8)(intptr_t)(f100_E_h16); ((void(*)(void))(intptr_t)v4318)(); - i8 v4319 = (i8)(intptr_t)c02_s01bb; + i8 v4319 = (i8)(intptr_t)c01_s01bb; *(i8*)(intptr_t)(ws+4320) = v4319; - i8 v4320 = (i8)(intptr_t)(f92_E); + i8 v4320 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4320)(); } - void f185_FlushInitialiserBuffer(void); -const i1 c02_s01bc[] = { 0x7d,0x3b,0x0a,0 }; - void f92_E(void); - void f107_EmitterCloseStream(void); + void f184_FlushInitialiserBuffer(void); +const i1 c01_s01bc[] = { 0x7d,0x3b,0x0a,0 }; + void f91_E(void); + void f106_EmitterCloseStream(void); // emit_177 workspace at ws+4224 length ws+0 -void f361_emit_177(void) { +void f360_emit_177(void) { - i8 v4321 = (i8)(intptr_t)(f185_FlushInitialiserBuffer); + i8 v4321 = (i8)(intptr_t)(f184_FlushInitialiserBuffer); ((void(*)(void))(intptr_t)v4321)(); - i8 v4322 = (i8)(intptr_t)c02_s01bc; + i8 v4322 = (i8)(intptr_t)c01_s01bc; *(i8*)(intptr_t)(ws+4320) = v4322; - i8 v4323 = (i8)(intptr_t)(f92_E); + i8 v4323 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4323)(); - i8 v4324 = (i8)(intptr_t)(f107_EmitterCloseStream); + i8 v4324 = (i8)(intptr_t)(f106_EmitterCloseStream); ((void(*)(void))(intptr_t)v4324)(); } - void f88_E_tab(void); + void f87_E_tab(void); // emit_180 workspace at ws+4224 length ws+0 -void f362_emit_180(void) { +void f361_emit_180(void) { - i8 v4325 = (i8)(intptr_t)(f88_E_tab); + i8 v4325 = (i8)(intptr_t)(f87_E_tab); ((void(*)(void))(intptr_t)v4325)(); } - void f92_E(void); - void f86_E_space(void); + void f91_E(void); + void f85_E_space(void); // emit_181 workspace at ws+4224 length ws+0 -void f363_emit_181(void) { +void f362_emit_181(void) { i8 v4326 = (i8)(intptr_t)(ws+4136); i8 v4327 = *(i8*)(intptr_t)v4326; i8 v4328 = *(i8*)(intptr_t)v4327; *(i8*)(intptr_t)(ws+4320) = v4328; - i8 v4329 = (i8)(intptr_t)(f92_E); + i8 v4329 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4329)(); - i8 v4330 = (i8)(intptr_t)(f86_E_space); + i8 v4330 = (i8)(intptr_t)(f85_E_space); ((void(*)(void))(intptr_t)v4330)(); } -const i1 c02_s01bd[] = { 0x2a,0x28,0x69,0 }; - void f92_E(void); - void f95_E_u8(void); -const i1 c02_s01be[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; - void f92_E(void); - void f156_E_symref(void); -const i1 c02_s01bf[] = { 0x29,0 }; - void f92_E(void); - void f86_E_space(void); +const i1 c01_s01bd[] = { 0x2a,0x28,0x69,0 }; + void f91_E(void); + void f94_E_u8(void); +const i1 c01_s01be[] = { 0x2a,0x29,0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; + void f91_E(void); + void f155_E_symref(void); +const i1 c01_s01bf[] = { 0x29,0 }; + void f91_E(void); + void f85_E_space(void); // emit_182 workspace at ws+4224 length ws+0 -void f364_emit_182(void) { +void f363_emit_182(void) { - i8 v4331 = (i8)(intptr_t)c02_s01bd; + i8 v4331 = (i8)(intptr_t)c01_s01bd; *(i8*)(intptr_t)(ws+4320) = v4331; - i8 v4332 = (i8)(intptr_t)(f92_E); + i8 v4332 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4332)(); @@ -10867,13 +10867,13 @@ void f364_emit_182(void) { i8 v4335 = v4334+(+14); i1 v4336 = *(i1*)(intptr_t)v4335; *(i1*)(intptr_t)(ws+4264) = v4336; - i8 v4337 = (i8)(intptr_t)(f95_E_u8); + i8 v4337 = (i8)(intptr_t)(f94_E_u8); ((void(*)(void))(intptr_t)v4337)(); - i8 v4338 = (i8)(intptr_t)c02_s01be; + i8 v4338 = (i8)(intptr_t)c01_s01be; *(i8*)(intptr_t)(ws+4320) = v4338; - i8 v4339 = (i8)(intptr_t)(f92_E); + i8 v4339 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4339)(); @@ -10882,34 +10882,34 @@ void f364_emit_182(void) { *(i8*)(intptr_t)(ws+4248) = v4341; i2 v4342 = (i2)+0; *(i2*)(intptr_t)(ws+4256) = v4342; - i8 v4343 = (i8)(intptr_t)(f156_E_symref); + i8 v4343 = (i8)(intptr_t)(f155_E_symref); ((void(*)(void))(intptr_t)v4343)(); - i8 v4344 = (i8)(intptr_t)c02_s01bf; + i8 v4344 = (i8)(intptr_t)c01_s01bf; *(i8*)(intptr_t)(ws+4320) = v4344; - i8 v4345 = (i8)(intptr_t)(f92_E); + i8 v4345 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4345)(); - i8 v4346 = (i8)(intptr_t)(f86_E_space); + i8 v4346 = (i8)(intptr_t)(f85_E_space); ((void(*)(void))(intptr_t)v4346)(); } -const i1 c02_s01c0[] = { 0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; - void f92_E(void); - void f155_E_subref_sig(void); -const i1 c02_s01c1[] = { 0x29,0 }; - void f92_E(void); - void f86_E_space(void); +const i1 c01_s01c0[] = { 0x28,0x69,0x6e,0x74,0x70,0x74,0x72,0x5f,0x74,0x29,0x28,0 }; + void f91_E(void); + void f154_E_subref_sig(void); +const i1 c01_s01c1[] = { 0x29,0 }; + void f91_E(void); + void f85_E_space(void); // emit_183 workspace at ws+4224 length ws+0 -void f365_emit_183(void) { +void f364_emit_183(void) { - i8 v4347 = (i8)(intptr_t)c02_s01c0; + i8 v4347 = (i8)(intptr_t)c01_s01c0; *(i8*)(intptr_t)(ws+4320) = v4347; - i8 v4348 = (i8)(intptr_t)(f92_E); + i8 v4348 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4348)(); @@ -10917,31 +10917,31 @@ void f365_emit_183(void) { i8 v4350 = *(i8*)(intptr_t)v4349; i8 v4351 = *(i8*)(intptr_t)v4350; *(i8*)(intptr_t)(ws+4232) = v4351; - i8 v4352 = (i8)(intptr_t)(f155_E_subref_sig); + i8 v4352 = (i8)(intptr_t)(f154_E_subref_sig); ((void(*)(void))(intptr_t)v4352)(); - i8 v4353 = (i8)(intptr_t)c02_s01c1; + i8 v4353 = (i8)(intptr_t)c01_s01c1; *(i8*)(intptr_t)(ws+4320) = v4353; - i8 v4354 = (i8)(intptr_t)(f92_E); + i8 v4354 = (i8)(intptr_t)(f91_E); ((void(*)(void))(intptr_t)v4354)(); - i8 v4355 = (i8)(intptr_t)(f86_E_space); + i8 v4355 = (i8)(intptr_t)(f85_E_space); ((void(*)(void))(intptr_t)v4355)(); } - void f83_E_b8(void); - void f98_E_i32(void); - void f83_E_b8(void); + void f82_E_b8(void); + void f97_E_i32(void); + void f82_E_b8(void); // emit_184 workspace at ws+4224 length ws+0 -void f366_emit_184(void) { +void f365_emit_184(void) { i1 v4356 = (i1)+40; *(i1*)(intptr_t)(ws+4336) = v4356; - i8 v4357 = (i8)(intptr_t)(f83_E_b8); + i8 v4357 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v4357)(); @@ -10949,596 +10949,596 @@ void f366_emit_184(void) { i8 v4359 = *(i8*)(intptr_t)v4358; i4 v4360 = *(i4*)(intptr_t)v4359; *(i4*)(intptr_t)(ws+4256) = v4360; - i8 v4361 = (i8)(intptr_t)(f98_E_i32); + i8 v4361 = (i8)(intptr_t)(f97_E_i32); ((void(*)(void))(intptr_t)v4361)(); i1 v4362 = (i1)+41; *(i1*)(intptr_t)(ws+4336) = v4362; - i8 v4363 = (i8)(intptr_t)(f83_E_b8); + i8 v4363 = (i8)(intptr_t)(f82_E_b8); ((void(*)(void))(intptr_t)v4363)(); } - void f89_E_nl(void); + void f88_E_nl(void); // emit_185 workspace at ws+4224 length ws+0 -void f367_emit_185(void) { +void f366_emit_185(void) { - i8 v4364 = (i8)(intptr_t)(f89_E_nl); + i8 v4364 = (i8)(intptr_t)(f88_E_nl); ((void(*)(void))(intptr_t)v4364)(); } // nop_emitter workspace at ws+4224 length ws+0 -void f368_nop_emitter(void) { - -} - void f191_emit_0(void); - void f192_emit_1(void); - void f193_emit_2(void); - void f194_emit_3(void); - void f195_emit_4(void); - void f196_emit_5(void); - void f197_emit_6(void); - void f198_emit_7(void); - void f199_emit_8(void); - void f200_emit_9(void); - void f201_emit_10(void); - void f202_emit_11(void); - void f203_emit_12(void); - void f204_emit_13(void); - void f205_emit_14(void); - void f206_emit_15(void); - void f207_emit_16(void); - void f208_emit_17(void); - void f209_emit_18(void); - void f210_emit_19(void); - void f211_emit_20(void); - void f212_emit_21(void); - void f213_emit_22(void); - void f214_emit_23(void); - void f215_emit_24(void); - void f216_emit_25(void); - void f217_emit_26(void); - void f218_emit_27(void); - void f219_emit_28(void); - void f220_emit_29(void); - void f221_emit_30(void); - void f222_emit_31(void); - void f223_emit_32(void); - void f224_emit_33(void); - void f225_emit_34(void); - void f226_emit_35(void); - void f227_emit_36(void); - void f228_emit_37(void); - void f229_emit_38(void); - void f230_emit_39(void); - void f231_emit_40(void); - void f232_emit_41(void); - void f233_emit_42(void); - void f234_emit_43(void); - void f235_emit_44(void); - void f368_nop_emitter(void); - void f368_nop_emitter(void); - void f236_emit_47(void); - void f237_emit_48(void); - void f238_emit_49(void); - void f239_emit_50(void); - void f240_emit_51(void); - void f241_emit_52(void); - void f368_nop_emitter(void); - void f242_emit_54(void); - void f243_emit_55(void); - void f244_emit_56(void); - void f245_emit_57(void); - void f246_emit_58(void); - void f247_emit_59(void); - void f248_emit_60(void); - void f249_emit_61(void); - void f250_emit_62(void); - void f251_emit_63(void); - void f252_emit_64(void); - void f253_emit_65(void); - void f254_emit_66(void); - void f255_emit_67(void); - void f256_emit_68(void); - void f257_emit_69(void); - void f258_emit_70(void); - void f259_emit_71(void); - void f260_emit_72(void); - void f261_emit_73(void); - void f262_emit_74(void); - void f263_emit_75(void); - void f264_emit_76(void); - void f265_emit_77(void); - void f266_emit_78(void); - void f267_emit_79(void); - void f268_emit_80(void); - void f269_emit_81(void); - void f270_emit_82(void); - void f271_emit_83(void); - void f272_emit_84(void); - void f273_emit_85(void); - void f274_emit_86(void); - void f275_emit_87(void); - void f276_emit_88(void); - void f277_emit_89(void); - void f278_emit_90(void); - void f279_emit_91(void); - void f280_emit_92(void); - void f281_emit_93(void); - void f282_emit_94(void); - void f283_emit_95(void); - void f284_emit_96(void); - void f285_emit_97(void); - void f286_emit_98(void); - void f287_emit_99(void); - void f288_emit_100(void); - void f289_emit_101(void); - void f290_emit_102(void); - void f291_emit_103(void); - void f292_emit_104(void); - void f293_emit_105(void); - void f294_emit_106(void); - void f295_emit_107(void); - void f296_emit_108(void); - void f297_emit_109(void); - void f298_emit_110(void); - void f299_emit_111(void); - void f300_emit_112(void); - void f301_emit_113(void); - void f302_emit_114(void); - void f303_emit_115(void); - void f304_emit_116(void); - void f305_emit_117(void); - void f306_emit_118(void); - void f307_emit_119(void); - void f308_emit_120(void); - void f309_emit_121(void); - void f310_emit_122(void); - void f311_emit_123(void); - void f312_emit_124(void); - void f313_emit_125(void); - void f314_emit_126(void); - void f315_emit_127(void); - void f316_emit_128(void); - void f317_emit_129(void); - void f318_emit_130(void); - void f319_emit_131(void); - void f320_emit_132(void); - void f321_emit_133(void); - void f322_emit_134(void); - void f323_emit_135(void); - void f324_emit_136(void); - void f325_emit_137(void); - void f326_emit_138(void); - void f327_emit_139(void); - void f328_emit_140(void); - void f329_emit_141(void); - void f330_emit_142(void); - void f331_emit_143(void); - void f368_nop_emitter(void); - void f368_nop_emitter(void); - void f368_nop_emitter(void); - void f368_nop_emitter(void); - void f332_emit_148(void); - void f333_emit_149(void); - void f334_emit_150(void); - void f335_emit_151(void); - void f336_emit_152(void); - void f337_emit_153(void); - void f338_emit_154(void); - void f339_emit_155(void); - void f340_emit_156(void); - void f341_emit_157(void); - void f342_emit_158(void); - void f343_emit_159(void); - void f344_emit_160(void); - void f345_emit_161(void); - void f346_emit_162(void); - void f347_emit_163(void); - void f348_emit_164(void); - void f349_emit_165(void); - void f350_emit_166(void); - void f351_emit_167(void); - void f352_emit_168(void); - void f353_emit_169(void); - void f354_emit_170(void); - void f355_emit_171(void); - void f356_emit_172(void); - void f357_emit_173(void); - void f358_emit_174(void); - void f359_emit_175(void); - void f360_emit_176(void); - void f361_emit_177(void); - void f368_nop_emitter(void); - void f368_nop_emitter(void); - void f362_emit_180(void); - void f363_emit_181(void); - void f364_emit_182(void); - void f365_emit_183(void); - void f366_emit_184(void); - void f367_emit_185(void); -static data f189_EmitOneInstruction_s02a9[] = { +void f367_nop_emitter(void) { + +} + void f190_emit_0(void); + void f191_emit_1(void); + void f192_emit_2(void); + void f193_emit_3(void); + void f194_emit_4(void); + void f195_emit_5(void); + void f196_emit_6(void); + void f197_emit_7(void); + void f198_emit_8(void); + void f199_emit_9(void); + void f200_emit_10(void); + void f201_emit_11(void); + void f202_emit_12(void); + void f203_emit_13(void); + void f204_emit_14(void); + void f205_emit_15(void); + void f206_emit_16(void); + void f207_emit_17(void); + void f208_emit_18(void); + void f209_emit_19(void); + void f210_emit_20(void); + void f211_emit_21(void); + void f212_emit_22(void); + void f213_emit_23(void); + void f214_emit_24(void); + void f215_emit_25(void); + void f216_emit_26(void); + void f217_emit_27(void); + void f218_emit_28(void); + void f219_emit_29(void); + void f220_emit_30(void); + void f221_emit_31(void); + void f222_emit_32(void); + void f223_emit_33(void); + void f224_emit_34(void); + void f225_emit_35(void); + void f226_emit_36(void); + void f227_emit_37(void); + void f228_emit_38(void); + void f229_emit_39(void); + void f230_emit_40(void); + void f231_emit_41(void); + void f232_emit_42(void); + void f233_emit_43(void); + void f234_emit_44(void); + void f367_nop_emitter(void); + void f367_nop_emitter(void); + void f235_emit_47(void); + void f236_emit_48(void); + void f237_emit_49(void); + void f238_emit_50(void); + void f239_emit_51(void); + void f240_emit_52(void); + void f367_nop_emitter(void); + void f241_emit_54(void); + void f242_emit_55(void); + void f243_emit_56(void); + void f244_emit_57(void); + void f245_emit_58(void); + void f246_emit_59(void); + void f247_emit_60(void); + void f248_emit_61(void); + void f249_emit_62(void); + void f250_emit_63(void); + void f251_emit_64(void); + void f252_emit_65(void); + void f253_emit_66(void); + void f254_emit_67(void); + void f255_emit_68(void); + void f256_emit_69(void); + void f257_emit_70(void); + void f258_emit_71(void); + void f259_emit_72(void); + void f260_emit_73(void); + void f261_emit_74(void); + void f262_emit_75(void); + void f263_emit_76(void); + void f264_emit_77(void); + void f265_emit_78(void); + void f266_emit_79(void); + void f267_emit_80(void); + void f268_emit_81(void); + void f269_emit_82(void); + void f270_emit_83(void); + void f271_emit_84(void); + void f272_emit_85(void); + void f273_emit_86(void); + void f274_emit_87(void); + void f275_emit_88(void); + void f276_emit_89(void); + void f277_emit_90(void); + void f278_emit_91(void); + void f279_emit_92(void); + void f280_emit_93(void); + void f281_emit_94(void); + void f282_emit_95(void); + void f283_emit_96(void); + void f284_emit_97(void); + void f285_emit_98(void); + void f286_emit_99(void); + void f287_emit_100(void); + void f288_emit_101(void); + void f289_emit_102(void); + void f290_emit_103(void); + void f291_emit_104(void); + void f292_emit_105(void); + void f293_emit_106(void); + void f294_emit_107(void); + void f295_emit_108(void); + void f296_emit_109(void); + void f297_emit_110(void); + void f298_emit_111(void); + void f299_emit_112(void); + void f300_emit_113(void); + void f301_emit_114(void); + void f302_emit_115(void); + void f303_emit_116(void); + void f304_emit_117(void); + void f305_emit_118(void); + void f306_emit_119(void); + void f307_emit_120(void); + void f308_emit_121(void); + void f309_emit_122(void); + void f310_emit_123(void); + void f311_emit_124(void); + void f312_emit_125(void); + void f313_emit_126(void); + void f314_emit_127(void); + void f315_emit_128(void); + void f316_emit_129(void); + void f317_emit_130(void); + void f318_emit_131(void); + void f319_emit_132(void); + void f320_emit_133(void); + void f321_emit_134(void); + void f322_emit_135(void); + void f323_emit_136(void); + void f324_emit_137(void); + void f325_emit_138(void); + void f326_emit_139(void); + void f327_emit_140(void); + void f328_emit_141(void); + void f329_emit_142(void); + void f330_emit_143(void); + void f367_nop_emitter(void); + void f367_nop_emitter(void); + void f367_nop_emitter(void); + void f367_nop_emitter(void); + void f331_emit_148(void); + void f332_emit_149(void); + void f333_emit_150(void); + void f334_emit_151(void); + void f335_emit_152(void); + void f336_emit_153(void); + void f337_emit_154(void); + void f338_emit_155(void); + void f339_emit_156(void); + void f340_emit_157(void); + void f341_emit_158(void); + void f342_emit_159(void); + void f343_emit_160(void); + void f344_emit_161(void); + void f345_emit_162(void); + void f346_emit_163(void); + void f347_emit_164(void); + void f348_emit_165(void); + void f349_emit_166(void); + void f350_emit_167(void); + void f351_emit_168(void); + void f352_emit_169(void); + void f353_emit_170(void); + void f354_emit_171(void); + void f355_emit_172(void); + void f356_emit_173(void); + void f357_emit_174(void); + void f358_emit_175(void); + void f359_emit_176(void); + void f360_emit_177(void); + void f367_nop_emitter(void); + void f367_nop_emitter(void); + void f361_emit_180(void); + void f362_emit_181(void); + void f363_emit_182(void); + void f364_emit_183(void); + void f365_emit_184(void); + void f366_emit_185(void); +static data f188_EmitOneInstruction_s02a9[] = { - { .ptr = (void*)f191_emit_0 }, + { .ptr = (void*)f190_emit_0 }, - { .ptr = (void*)f192_emit_1 }, + { .ptr = (void*)f191_emit_1 }, - { .ptr = (void*)f193_emit_2 }, + { .ptr = (void*)f192_emit_2 }, - { .ptr = (void*)f194_emit_3 }, + { .ptr = (void*)f193_emit_3 }, - { .ptr = (void*)f195_emit_4 }, + { .ptr = (void*)f194_emit_4 }, - { .ptr = (void*)f196_emit_5 }, + { .ptr = (void*)f195_emit_5 }, - { .ptr = (void*)f197_emit_6 }, + { .ptr = (void*)f196_emit_6 }, - { .ptr = (void*)f198_emit_7 }, + { .ptr = (void*)f197_emit_7 }, - { .ptr = (void*)f199_emit_8 }, + { .ptr = (void*)f198_emit_8 }, - { .ptr = (void*)f200_emit_9 }, + { .ptr = (void*)f199_emit_9 }, - { .ptr = (void*)f201_emit_10 }, + { .ptr = (void*)f200_emit_10 }, - { .ptr = (void*)f202_emit_11 }, + { .ptr = (void*)f201_emit_11 }, - { .ptr = (void*)f203_emit_12 }, + { .ptr = (void*)f202_emit_12 }, - { .ptr = (void*)f204_emit_13 }, + { .ptr = (void*)f203_emit_13 }, - { .ptr = (void*)f205_emit_14 }, + { .ptr = (void*)f204_emit_14 }, - { .ptr = (void*)f206_emit_15 }, + { .ptr = (void*)f205_emit_15 }, - { .ptr = (void*)f207_emit_16 }, + { .ptr = (void*)f206_emit_16 }, - { .ptr = (void*)f208_emit_17 }, + { .ptr = (void*)f207_emit_17 }, - { .ptr = (void*)f209_emit_18 }, + { .ptr = (void*)f208_emit_18 }, - { .ptr = (void*)f210_emit_19 }, + { .ptr = (void*)f209_emit_19 }, - { .ptr = (void*)f211_emit_20 }, + { .ptr = (void*)f210_emit_20 }, - { .ptr = (void*)f212_emit_21 }, + { .ptr = (void*)f211_emit_21 }, - { .ptr = (void*)f213_emit_22 }, + { .ptr = (void*)f212_emit_22 }, - { .ptr = (void*)f214_emit_23 }, + { .ptr = (void*)f213_emit_23 }, - { .ptr = (void*)f215_emit_24 }, + { .ptr = (void*)f214_emit_24 }, - { .ptr = (void*)f216_emit_25 }, + { .ptr = (void*)f215_emit_25 }, - { .ptr = (void*)f217_emit_26 }, + { .ptr = (void*)f216_emit_26 }, - { .ptr = (void*)f218_emit_27 }, + { .ptr = (void*)f217_emit_27 }, - { .ptr = (void*)f219_emit_28 }, + { .ptr = (void*)f218_emit_28 }, - { .ptr = (void*)f220_emit_29 }, + { .ptr = (void*)f219_emit_29 }, - { .ptr = (void*)f221_emit_30 }, + { .ptr = (void*)f220_emit_30 }, - { .ptr = (void*)f222_emit_31 }, + { .ptr = (void*)f221_emit_31 }, - { .ptr = (void*)f223_emit_32 }, + { .ptr = (void*)f222_emit_32 }, - { .ptr = (void*)f224_emit_33 }, + { .ptr = (void*)f223_emit_33 }, - { .ptr = (void*)f225_emit_34 }, + { .ptr = (void*)f224_emit_34 }, - { .ptr = (void*)f226_emit_35 }, + { .ptr = (void*)f225_emit_35 }, - { .ptr = (void*)f227_emit_36 }, + { .ptr = (void*)f226_emit_36 }, - { .ptr = (void*)f228_emit_37 }, + { .ptr = (void*)f227_emit_37 }, - { .ptr = (void*)f229_emit_38 }, + { .ptr = (void*)f228_emit_38 }, - { .ptr = (void*)f230_emit_39 }, + { .ptr = (void*)f229_emit_39 }, - { .ptr = (void*)f231_emit_40 }, + { .ptr = (void*)f230_emit_40 }, - { .ptr = (void*)f232_emit_41 }, + { .ptr = (void*)f231_emit_41 }, - { .ptr = (void*)f233_emit_42 }, + { .ptr = (void*)f232_emit_42 }, - { .ptr = (void*)f234_emit_43 }, + { .ptr = (void*)f233_emit_43 }, - { .ptr = (void*)f235_emit_44 }, + { .ptr = (void*)f234_emit_44 }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f236_emit_47 }, + { .ptr = (void*)f235_emit_47 }, - { .ptr = (void*)f237_emit_48 }, + { .ptr = (void*)f236_emit_48 }, - { .ptr = (void*)f238_emit_49 }, + { .ptr = (void*)f237_emit_49 }, - { .ptr = (void*)f239_emit_50 }, + { .ptr = (void*)f238_emit_50 }, - { .ptr = (void*)f240_emit_51 }, + { .ptr = (void*)f239_emit_51 }, - { .ptr = (void*)f241_emit_52 }, + { .ptr = (void*)f240_emit_52 }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f242_emit_54 }, + { .ptr = (void*)f241_emit_54 }, - { .ptr = (void*)f243_emit_55 }, + { .ptr = (void*)f242_emit_55 }, - { .ptr = (void*)f244_emit_56 }, + { .ptr = (void*)f243_emit_56 }, - { .ptr = (void*)f245_emit_57 }, + { .ptr = (void*)f244_emit_57 }, - { .ptr = (void*)f246_emit_58 }, + { .ptr = (void*)f245_emit_58 }, - { .ptr = (void*)f247_emit_59 }, + { .ptr = (void*)f246_emit_59 }, - { .ptr = (void*)f248_emit_60 }, + { .ptr = (void*)f247_emit_60 }, - { .ptr = (void*)f249_emit_61 }, + { .ptr = (void*)f248_emit_61 }, - { .ptr = (void*)f250_emit_62 }, + { .ptr = (void*)f249_emit_62 }, - { .ptr = (void*)f251_emit_63 }, + { .ptr = (void*)f250_emit_63 }, - { .ptr = (void*)f252_emit_64 }, + { .ptr = (void*)f251_emit_64 }, - { .ptr = (void*)f253_emit_65 }, + { .ptr = (void*)f252_emit_65 }, - { .ptr = (void*)f254_emit_66 }, + { .ptr = (void*)f253_emit_66 }, - { .ptr = (void*)f255_emit_67 }, + { .ptr = (void*)f254_emit_67 }, - { .ptr = (void*)f256_emit_68 }, + { .ptr = (void*)f255_emit_68 }, - { .ptr = (void*)f257_emit_69 }, + { .ptr = (void*)f256_emit_69 }, - { .ptr = (void*)f258_emit_70 }, + { .ptr = (void*)f257_emit_70 }, - { .ptr = (void*)f259_emit_71 }, + { .ptr = (void*)f258_emit_71 }, - { .ptr = (void*)f260_emit_72 }, + { .ptr = (void*)f259_emit_72 }, - { .ptr = (void*)f261_emit_73 }, + { .ptr = (void*)f260_emit_73 }, - { .ptr = (void*)f262_emit_74 }, + { .ptr = (void*)f261_emit_74 }, - { .ptr = (void*)f263_emit_75 }, + { .ptr = (void*)f262_emit_75 }, - { .ptr = (void*)f264_emit_76 }, + { .ptr = (void*)f263_emit_76 }, - { .ptr = (void*)f265_emit_77 }, + { .ptr = (void*)f264_emit_77 }, - { .ptr = (void*)f266_emit_78 }, + { .ptr = (void*)f265_emit_78 }, - { .ptr = (void*)f267_emit_79 }, + { .ptr = (void*)f266_emit_79 }, - { .ptr = (void*)f268_emit_80 }, + { .ptr = (void*)f267_emit_80 }, - { .ptr = (void*)f269_emit_81 }, + { .ptr = (void*)f268_emit_81 }, - { .ptr = (void*)f270_emit_82 }, + { .ptr = (void*)f269_emit_82 }, - { .ptr = (void*)f271_emit_83 }, + { .ptr = (void*)f270_emit_83 }, - { .ptr = (void*)f272_emit_84 }, + { .ptr = (void*)f271_emit_84 }, - { .ptr = (void*)f273_emit_85 }, + { .ptr = (void*)f272_emit_85 }, - { .ptr = (void*)f274_emit_86 }, + { .ptr = (void*)f273_emit_86 }, - { .ptr = (void*)f275_emit_87 }, + { .ptr = (void*)f274_emit_87 }, - { .ptr = (void*)f276_emit_88 }, + { .ptr = (void*)f275_emit_88 }, - { .ptr = (void*)f277_emit_89 }, + { .ptr = (void*)f276_emit_89 }, - { .ptr = (void*)f278_emit_90 }, + { .ptr = (void*)f277_emit_90 }, - { .ptr = (void*)f279_emit_91 }, + { .ptr = (void*)f278_emit_91 }, - { .ptr = (void*)f280_emit_92 }, + { .ptr = (void*)f279_emit_92 }, - { .ptr = (void*)f281_emit_93 }, + { .ptr = (void*)f280_emit_93 }, - { .ptr = (void*)f282_emit_94 }, + { .ptr = (void*)f281_emit_94 }, - { .ptr = (void*)f283_emit_95 }, + { .ptr = (void*)f282_emit_95 }, - { .ptr = (void*)f284_emit_96 }, + { .ptr = (void*)f283_emit_96 }, - { .ptr = (void*)f285_emit_97 }, + { .ptr = (void*)f284_emit_97 }, - { .ptr = (void*)f286_emit_98 }, + { .ptr = (void*)f285_emit_98 }, - { .ptr = (void*)f287_emit_99 }, + { .ptr = (void*)f286_emit_99 }, - { .ptr = (void*)f288_emit_100 }, + { .ptr = (void*)f287_emit_100 }, - { .ptr = (void*)f289_emit_101 }, + { .ptr = (void*)f288_emit_101 }, - { .ptr = (void*)f290_emit_102 }, + { .ptr = (void*)f289_emit_102 }, - { .ptr = (void*)f291_emit_103 }, + { .ptr = (void*)f290_emit_103 }, - { .ptr = (void*)f292_emit_104 }, + { .ptr = (void*)f291_emit_104 }, - { .ptr = (void*)f293_emit_105 }, + { .ptr = (void*)f292_emit_105 }, - { .ptr = (void*)f294_emit_106 }, + { .ptr = (void*)f293_emit_106 }, - { .ptr = (void*)f295_emit_107 }, + { .ptr = (void*)f294_emit_107 }, - { .ptr = (void*)f296_emit_108 }, + { .ptr = (void*)f295_emit_108 }, - { .ptr = (void*)f297_emit_109 }, + { .ptr = (void*)f296_emit_109 }, - { .ptr = (void*)f298_emit_110 }, + { .ptr = (void*)f297_emit_110 }, - { .ptr = (void*)f299_emit_111 }, + { .ptr = (void*)f298_emit_111 }, - { .ptr = (void*)f300_emit_112 }, + { .ptr = (void*)f299_emit_112 }, - { .ptr = (void*)f301_emit_113 }, + { .ptr = (void*)f300_emit_113 }, - { .ptr = (void*)f302_emit_114 }, + { .ptr = (void*)f301_emit_114 }, - { .ptr = (void*)f303_emit_115 }, + { .ptr = (void*)f302_emit_115 }, - { .ptr = (void*)f304_emit_116 }, + { .ptr = (void*)f303_emit_116 }, - { .ptr = (void*)f305_emit_117 }, + { .ptr = (void*)f304_emit_117 }, - { .ptr = (void*)f306_emit_118 }, + { .ptr = (void*)f305_emit_118 }, - { .ptr = (void*)f307_emit_119 }, + { .ptr = (void*)f306_emit_119 }, - { .ptr = (void*)f308_emit_120 }, + { .ptr = (void*)f307_emit_120 }, - { .ptr = (void*)f309_emit_121 }, + { .ptr = (void*)f308_emit_121 }, - { .ptr = (void*)f310_emit_122 }, + { .ptr = (void*)f309_emit_122 }, - { .ptr = (void*)f311_emit_123 }, + { .ptr = (void*)f310_emit_123 }, - { .ptr = (void*)f312_emit_124 }, + { .ptr = (void*)f311_emit_124 }, - { .ptr = (void*)f313_emit_125 }, + { .ptr = (void*)f312_emit_125 }, - { .ptr = (void*)f314_emit_126 }, + { .ptr = (void*)f313_emit_126 }, - { .ptr = (void*)f315_emit_127 }, + { .ptr = (void*)f314_emit_127 }, - { .ptr = (void*)f316_emit_128 }, + { .ptr = (void*)f315_emit_128 }, - { .ptr = (void*)f317_emit_129 }, + { .ptr = (void*)f316_emit_129 }, - { .ptr = (void*)f318_emit_130 }, + { .ptr = (void*)f317_emit_130 }, - { .ptr = (void*)f319_emit_131 }, + { .ptr = (void*)f318_emit_131 }, - { .ptr = (void*)f320_emit_132 }, + { .ptr = (void*)f319_emit_132 }, - { .ptr = (void*)f321_emit_133 }, + { .ptr = (void*)f320_emit_133 }, - { .ptr = (void*)f322_emit_134 }, + { .ptr = (void*)f321_emit_134 }, - { .ptr = (void*)f323_emit_135 }, + { .ptr = (void*)f322_emit_135 }, - { .ptr = (void*)f324_emit_136 }, + { .ptr = (void*)f323_emit_136 }, - { .ptr = (void*)f325_emit_137 }, + { .ptr = (void*)f324_emit_137 }, - { .ptr = (void*)f326_emit_138 }, + { .ptr = (void*)f325_emit_138 }, - { .ptr = (void*)f327_emit_139 }, + { .ptr = (void*)f326_emit_139 }, - { .ptr = (void*)f328_emit_140 }, + { .ptr = (void*)f327_emit_140 }, - { .ptr = (void*)f329_emit_141 }, + { .ptr = (void*)f328_emit_141 }, - { .ptr = (void*)f330_emit_142 }, + { .ptr = (void*)f329_emit_142 }, - { .ptr = (void*)f331_emit_143 }, + { .ptr = (void*)f330_emit_143 }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f332_emit_148 }, + { .ptr = (void*)f331_emit_148 }, - { .ptr = (void*)f333_emit_149 }, + { .ptr = (void*)f332_emit_149 }, - { .ptr = (void*)f334_emit_150 }, + { .ptr = (void*)f333_emit_150 }, - { .ptr = (void*)f335_emit_151 }, + { .ptr = (void*)f334_emit_151 }, - { .ptr = (void*)f336_emit_152 }, + { .ptr = (void*)f335_emit_152 }, - { .ptr = (void*)f337_emit_153 }, + { .ptr = (void*)f336_emit_153 }, - { .ptr = (void*)f338_emit_154 }, + { .ptr = (void*)f337_emit_154 }, - { .ptr = (void*)f339_emit_155 }, + { .ptr = (void*)f338_emit_155 }, - { .ptr = (void*)f340_emit_156 }, + { .ptr = (void*)f339_emit_156 }, - { .ptr = (void*)f341_emit_157 }, + { .ptr = (void*)f340_emit_157 }, - { .ptr = (void*)f342_emit_158 }, + { .ptr = (void*)f341_emit_158 }, - { .ptr = (void*)f343_emit_159 }, + { .ptr = (void*)f342_emit_159 }, - { .ptr = (void*)f344_emit_160 }, + { .ptr = (void*)f343_emit_160 }, - { .ptr = (void*)f345_emit_161 }, + { .ptr = (void*)f344_emit_161 }, - { .ptr = (void*)f346_emit_162 }, + { .ptr = (void*)f345_emit_162 }, - { .ptr = (void*)f347_emit_163 }, + { .ptr = (void*)f346_emit_163 }, - { .ptr = (void*)f348_emit_164 }, + { .ptr = (void*)f347_emit_164 }, - { .ptr = (void*)f349_emit_165 }, + { .ptr = (void*)f348_emit_165 }, - { .ptr = (void*)f350_emit_166 }, + { .ptr = (void*)f349_emit_166 }, - { .ptr = (void*)f351_emit_167 }, + { .ptr = (void*)f350_emit_167 }, - { .ptr = (void*)f352_emit_168 }, + { .ptr = (void*)f351_emit_168 }, - { .ptr = (void*)f353_emit_169 }, + { .ptr = (void*)f352_emit_169 }, - { .ptr = (void*)f354_emit_170 }, + { .ptr = (void*)f353_emit_170 }, - { .ptr = (void*)f355_emit_171 }, + { .ptr = (void*)f354_emit_171 }, - { .ptr = (void*)f356_emit_172 }, + { .ptr = (void*)f355_emit_172 }, - { .ptr = (void*)f357_emit_173 }, + { .ptr = (void*)f356_emit_173 }, - { .ptr = (void*)f358_emit_174 }, + { .ptr = (void*)f357_emit_174 }, - { .ptr = (void*)f359_emit_175 }, + { .ptr = (void*)f358_emit_175 }, - { .ptr = (void*)f360_emit_176 }, + { .ptr = (void*)f359_emit_176 }, - { .ptr = (void*)f361_emit_177 }, + { .ptr = (void*)f360_emit_177 }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f368_nop_emitter }, + { .ptr = (void*)f367_nop_emitter }, - { .ptr = (void*)f362_emit_180 }, + { .ptr = (void*)f361_emit_180 }, - { .ptr = (void*)f363_emit_181 }, + { .ptr = (void*)f362_emit_181 }, - { .ptr = (void*)f364_emit_182 }, + { .ptr = (void*)f363_emit_182 }, - { .ptr = (void*)f365_emit_183 }, + { .ptr = (void*)f364_emit_183 }, - { .ptr = (void*)f366_emit_184 }, + { .ptr = (void*)f365_emit_184 }, - { .ptr = (void*)f367_emit_185 }, + { .ptr = (void*)f366_emit_185 }, }; // EmitOneInstruction workspace at ws+4120 length ws+98 -void f189_EmitOneInstruction(void) { +void f188_EmitOneInstruction(void) { i8 v3346 = (i8)(intptr_t)(ws+4128); i8 v3347 = *(i8*)(intptr_t)v3346; @@ -11554,14 +11554,14 @@ void f189_EmitOneInstruction(void) { i8 v3353 = (i8)(intptr_t)(ws+4216); *(i1*)(intptr_t)v3353 = v3352; -c02_029e:; +c01_029e:; i8 v3354 = (i8)(intptr_t)(ws+4216); i1 v3355 = *(i1*)(intptr_t)v3354; i1 v3356 = (i1)+0; - if (v3355==v3356) goto c02_02a3; else goto c02_02a2; + if (v3355==v3356) goto c01_02a3; else goto c01_02a2; -c02_02a2:; +c01_02a2:; i8 v3357 = (i8)(intptr_t)(ws+4200); i8 v3358 = *(i8*)(intptr_t)v3357; @@ -11574,9 +11574,9 @@ c02_02a2:; i8 v3363 = *(i8*)(intptr_t)v3362; i8 v3364 = *(i8*)(intptr_t)v3363; i8 v3365 = (i8)+0; - if (v3364==v3365) goto c02_02a8; else goto c02_02a7; + if (v3364==v3365) goto c01_02a8; else goto c01_02a7; -c02_02a7:; +c01_02a7:; i8 v3366 = (i8)(intptr_t)(ws+4208); i8 v3367 = *(i8*)(intptr_t)v3366; @@ -11588,9 +11588,9 @@ c02_02a7:; i8 v3373 = v3372+(+8); *(i1*)(intptr_t)v3373 = v3370; -c02_02a8:; +c01_02a8:; -c02_02a4:; +c01_02a4:; i8 v3374 = (i8)(intptr_t)(ws+4200); i8 v3375 = *(i8*)(intptr_t)v3374; @@ -11610,9 +11610,9 @@ c02_02a4:; i8 v3385 = (i8)(intptr_t)(ws+4216); *(i1*)(intptr_t)v3385 = v3384; - goto c02_029e; + goto c01_029e; -c02_02a3:; +c01_02a3:; i8 v3386 = (i8)(intptr_t)(ws+4128); i8 v3387 = *(i8*)(intptr_t)v3386; @@ -11801,7 +11801,7 @@ c02_02a3:; - i8 v4365 = (i8)(intptr_t)((i1*)f189_EmitOneInstruction_s02a9); + i8 v4365 = (i8)(intptr_t)((i1*)f188_EmitOneInstruction_s02a9); i8 v4366 = (i8)(intptr_t)(ws+4120); i1 v4367 = *(i1*)(intptr_t)v4366; i8 v4368 = v4367; @@ -11813,7 +11813,7 @@ c02_02a3:; ((void(*)(void))(intptr_t)v4372)(); } -static data f3___main_s02aa[] = { +static data f2___main_s02aa[] = { @@ -12077,7 +12077,7 @@ static data f3___main_s02aa[] = { { .i1 = { 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17}}, }; -static data f3___main_s02ab[] = { +static data f2___main_s02ab[] = { @@ -12321,7 +12321,7 @@ static data f3___main_s02ab[] = { { .i1 = { 0x04,0x04,0x04,0x08,0x08,0x08}}, }; -static data f3___main_s02ac[] = { +static data f2___main_s02ac[] = { @@ -13791,7 +13791,7 @@ static data f3___main_s02ac[] = { }; // PopulateMatchBuffer workspace at ws+4176 length ws+24 -void f369_PopulateMatchBuffer(void) { +void f368_PopulateMatchBuffer(void) { i8 v4373 = (i8)(intptr_t)(ws+4184); i8 v4374 = *(i8*)(intptr_t)v4373; @@ -13817,9 +13817,9 @@ void f369_PopulateMatchBuffer(void) { i8 v4390 = v4389+(+8); i8 v4391 = *(i8*)(intptr_t)v4390; i8 v4392 = (i8)+0; - if (v4391==v4392) goto c02_02b1; else goto c02_02b0; + if (v4391==v4392) goto c01_02b1; else goto c01_02b0; -c02_02b0:; +c01_02b0:; i8 v4393 = (i8)(intptr_t)(ws+4184); i8 v4394 = *(i8*)(intptr_t)v4393; @@ -13832,9 +13832,9 @@ c02_02b0:; i8 v4401 = v4400+(+1); *(i1*)(intptr_t)v4401 = v4398; -c02_02b1:; +c01_02b1:; -c02_02ad:; +c01_02ad:; i8 v4402 = (i8)(intptr_t)(ws+4184); i8 v4403 = *(i8*)(intptr_t)v4402; @@ -13851,9 +13851,9 @@ c02_02ad:; i8 v4412 = v4411+(+16); i8 v4413 = *(i8*)(intptr_t)v4412; i8 v4414 = (i8)+0; - if (v4413==v4414) goto c02_02b6; else goto c02_02b5; + if (v4413==v4414) goto c01_02b6; else goto c01_02b5; -c02_02b5:; +c01_02b5:; i8 v4415 = (i8)(intptr_t)(ws+4184); i8 v4416 = *(i8*)(intptr_t)v4415; @@ -13882,9 +13882,9 @@ c02_02b5:; i8 v4435 = v4434+(+24); i8 v4436 = *(i8*)(intptr_t)v4435; i8 v4437 = (i8)+0; - if (v4436==v4437) goto c02_02bb; else goto c02_02ba; + if (v4436==v4437) goto c01_02bb; else goto c01_02ba; -c02_02ba:; +c01_02ba:; i8 v4438 = (i8)(intptr_t)(ws+4184); i8 v4439 = *(i8*)(intptr_t)v4438; @@ -13897,35 +13897,35 @@ c02_02ba:; i8 v4446 = v4445+(+3); *(i1*)(intptr_t)v4446 = v4443; -c02_02bb:; +c01_02bb:; -c02_02b7:; +c01_02b7:; -c02_02b6:; +c01_02b6:; -c02_02b2:; +c01_02b2:; } // IsStackedRegister workspace at ws+4256 length ws+16 -void f370_IsStackedRegister(void) { +void f369_IsStackedRegister(void) { i1 v4447 = (i1)+0; i8 v4448 = (i8)(intptr_t)(ws+4257); *(i1*)(intptr_t)v4448 = v4447; - i8 v4449 = (i8)(intptr_t)((i1*)f3___main_s00ff); + i8 v4449 = (i8)(intptr_t)((i1*)f2___main_s00ff); i8 v4450 = (i8)(intptr_t)(ws+4264); *(i8*)(intptr_t)v4450 = v4449; -c02_02bc:; +c01_02bc:; i8 v4451 = (i8)(intptr_t)(ws+4264); i8 v4452 = *(i8*)(intptr_t)v4451; - i8 v4453 = (i8)(intptr_t)((i1*)f3___main_s00ff+80); - if (v4452==v4453) goto c02_02c1; else goto c02_02c0; + i8 v4453 = (i8)(intptr_t)((i1*)f2___main_s00ff+80); + if (v4452==v4453) goto c01_02c1; else goto c01_02c0; -c02_02c0:; +c01_02c0:; i8 v4454 = (i8)(intptr_t)(ws+4264); i8 v4455 = *(i8*)(intptr_t)v4454; @@ -13935,9 +13935,9 @@ c02_02c0:; i1 v4459 = *(i1*)(intptr_t)v4458; i1 v4460 = v4457&v4459; i1 v4461 = (i1)+0; - if (v4460==v4461) goto c02_02c6; else goto c02_02c5; + if (v4460==v4461) goto c01_02c6; else goto c01_02c5; -c02_02c5:; +c01_02c5:; i8 v4462 = (i8)(intptr_t)(ws+4264); i8 v4463 = *(i8*)(intptr_t)v4462; @@ -13948,9 +13948,9 @@ c02_02c5:; return; -c02_02c6:; +c01_02c6:; -c02_02c2:; +c01_02c2:; i8 v4467 = (i8)(intptr_t)(ws+4264); i8 v4468 = *(i8*)(intptr_t)v4467; @@ -13958,14 +13958,14 @@ c02_02c2:; i8 v4470 = (i8)(intptr_t)(ws+4264); *(i8*)(intptr_t)v4470 = v4469; - goto c02_02bc; + goto c01_02bc; -c02_02c1:; +c01_02c1:; } // CalculateBlockedRegisters workspace at ws+4152 length ws+17 -void f371_CalculateBlockedRegisters(void) { +void f370_CalculateBlockedRegisters(void) { i1 v4471 = (i1)+0; i8 v4472 = (i8)(intptr_t)(ws+4168); @@ -13975,15 +13975,15 @@ void f371_CalculateBlockedRegisters(void) { i8 v4474 = *(i8*)(intptr_t)v4473; i8 v4475 = (i8)(intptr_t)(ws+4160); i8 v4476 = *(i8*)(intptr_t)v4475; - if (v4474==v4476) goto c02_02ca; else goto c02_02cb; + if (v4474==v4476) goto c01_02ca; else goto c01_02cb; -c02_02ca:; +c01_02ca:; return; -c02_02cb:; +c01_02cb:; -c02_02c7:; +c01_02c7:; i8 v4477 = (i8)(intptr_t)(ws+4152); i8 v4478 = *(i8*)(intptr_t)v4477; @@ -13991,15 +13991,15 @@ c02_02c7:; i8 v4480 = (i8)(intptr_t)(ws+4152); *(i8*)(intptr_t)v4480 = v4479; -c02_02cc:; +c01_02cc:; i8 v4481 = (i8)(intptr_t)(ws+4152); i8 v4482 = *(i8*)(intptr_t)v4481; i8 v4483 = (i8)(intptr_t)(ws+4160); i8 v4484 = *(i8*)(intptr_t)v4483; - if (v4482==v4484) goto c02_02d1; else goto c02_02d0; + if (v4482==v4484) goto c01_02d1; else goto c01_02d0; -c02_02d0:; +c01_02d0:; i8 v4485 = (i8)(intptr_t)(ws+4168); i1 v4486 = *(i1*)(intptr_t)v4485; @@ -14025,15 +14025,15 @@ c02_02d0:; i8 v4504 = *(i8*)(intptr_t)v4503; i8 v4505 = (i8)(intptr_t)(ws+4160); i8 v4506 = *(i8*)(intptr_t)v4505; - if (v4504==v4506) goto c02_02d5; else goto c02_02d6; + if (v4504==v4506) goto c01_02d5; else goto c01_02d6; -c02_02d5:; +c01_02d5:; - goto c02_02d1; + goto c01_02d1; -c02_02d6:; +c01_02d6:; -c02_02d2:; +c01_02d2:; i8 v4507 = (i8)(intptr_t)(ws+4152); i8 v4508 = *(i8*)(intptr_t)v4507; @@ -14041,28 +14041,28 @@ c02_02d2:; i8 v4510 = (i8)(intptr_t)(ws+4152); *(i8*)(intptr_t)v4510 = v4509; - goto c02_02cc; + goto c01_02cc; -c02_02d1:; +c01_02d1:; } // BlockRegisters workspace at ws+4152 length ws+17 -void f373_BlockRegisters(void) { +void f372_BlockRegisters(void) { i8 v4538 = (i8)(intptr_t)(ws+4152); i8 v4539 = *(i8*)(intptr_t)v4538; i8 v4540 = (i8)(intptr_t)(ws+4160); i8 v4541 = *(i8*)(intptr_t)v4540; - if (v4539==v4541) goto c02_02df; else goto c02_02e0; + if (v4539==v4541) goto c01_02df; else goto c01_02e0; -c02_02df:; +c01_02df:; return; -c02_02e0:; +c01_02e0:; -c02_02dc:; +c01_02dc:; i8 v4542 = (i8)(intptr_t)(ws+4152); i8 v4543 = *(i8*)(intptr_t)v4542; @@ -14070,15 +14070,15 @@ c02_02dc:; i8 v4545 = (i8)(intptr_t)(ws+4152); *(i8*)(intptr_t)v4545 = v4544; -c02_02e1:; +c01_02e1:; i8 v4546 = (i8)(intptr_t)(ws+4152); i8 v4547 = *(i8*)(intptr_t)v4546; i8 v4548 = (i8)(intptr_t)(ws+4160); i8 v4549 = *(i8*)(intptr_t)v4548; - if (v4547==v4549) goto c02_02e6; else goto c02_02e5; + if (v4547==v4549) goto c01_02e6; else goto c01_02e5; -c02_02e5:; +c01_02e5:; i8 v4550 = (i8)(intptr_t)(ws+4152); i8 v4551 = *(i8*)(intptr_t)v4550; @@ -14120,15 +14120,15 @@ c02_02e5:; i8 v4581 = *(i8*)(intptr_t)v4580; i8 v4582 = (i8)(intptr_t)(ws+4160); i8 v4583 = *(i8*)(intptr_t)v4582; - if (v4581==v4583) goto c02_02ea; else goto c02_02eb; + if (v4581==v4583) goto c01_02ea; else goto c01_02eb; -c02_02ea:; +c01_02ea:; - goto c02_02e6; + goto c01_02e6; -c02_02eb:; +c01_02eb:; -c02_02e7:; +c01_02e7:; i8 v4584 = (i8)(intptr_t)(ws+4152); i8 v4585 = *(i8*)(intptr_t)v4584; @@ -14136,16 +14136,16 @@ c02_02e7:; i8 v4587 = (i8)(intptr_t)(ws+4152); *(i8*)(intptr_t)v4587 = v4586; - goto c02_02e1; + goto c01_02e1; -c02_02e6:; +c01_02e6:; } -const i1 c02_s01c2[] = { 0x74,0x6f,0x6f,0x20,0x6d,0x61,0x6e,0x79,0x20,0x73,0x70,0x69,0x6c,0x6c,0x73,0 }; - void f68_SimpleError(void); +const i1 c01_s01c2[] = { 0x74,0x6f,0x6f,0x20,0x6d,0x61,0x6e,0x79,0x20,0x73,0x70,0x69,0x6c,0x6c,0x73,0 }; + void f67_SimpleError(void); // CreateSpill workspace at ws+4152 length ws+24 -void f376_CreateSpill(void) { +void f375_CreateSpill(void) { i8 v4657 = (i8)(intptr_t)(ws+4152); i8 v4658 = *(i8*)(intptr_t)v4657; @@ -14157,19 +14157,19 @@ void f376_CreateSpill(void) { i8 v4662 = (i8)(intptr_t)(ws+4162); i1 v4663 = *(i1*)(intptr_t)v4662; i1 v4664 = (i1)+5; - if (v4663==v4664) goto c02_02ff; else goto c02_0300; + if (v4663==v4664) goto c01_02ff; else goto c01_0300; -c02_02ff:; +c01_02ff:; - i8 v4665 = (i8)(intptr_t)c02_s01c2; + i8 v4665 = (i8)(intptr_t)c01_s01c2; *(i8*)(intptr_t)(ws+4280) = v4665; - i8 v4666 = (i8)(intptr_t)(f68_SimpleError); + i8 v4666 = (i8)(intptr_t)(f67_SimpleError); ((void(*)(void))(intptr_t)v4666)(); -c02_0300:; +c01_0300:; -c02_02fc:; +c01_02fc:; i8 v4667 = (i8)(intptr_t)(ws+4152); i8 v4668 = *(i8*)(intptr_t)v4667; @@ -14205,11 +14205,11 @@ c02_02fc:; *(i1*)(intptr_t)v4691 = v4688; } -const i1 c02_s01c3[] = { 0x74,0x6f,0x6f,0x20,0x6d,0x61,0x6e,0x79,0x20,0x72,0x65,0x6c,0x6f,0x61,0x64,0x73,0 }; - void f68_SimpleError(void); +const i1 c01_s01c3[] = { 0x74,0x6f,0x6f,0x20,0x6d,0x61,0x6e,0x79,0x20,0x72,0x65,0x6c,0x6f,0x61,0x64,0x73,0 }; + void f67_SimpleError(void); // CreateReload workspace at ws+4152 length ws+24 -void f377_CreateReload(void) { +void f376_CreateReload(void) { i8 v4692 = (i8)(intptr_t)(ws+4152); i8 v4693 = *(i8*)(intptr_t)v4692; @@ -14221,19 +14221,19 @@ void f377_CreateReload(void) { i8 v4697 = (i8)(intptr_t)(ws+4162); i1 v4698 = *(i1*)(intptr_t)v4697; i1 v4699 = (i1)+5; - if (v4698==v4699) goto c02_0304; else goto c02_0305; + if (v4698==v4699) goto c01_0304; else goto c01_0305; -c02_0304:; +c01_0304:; - i8 v4700 = (i8)(intptr_t)c02_s01c3; + i8 v4700 = (i8)(intptr_t)c01_s01c3; *(i8*)(intptr_t)(ws+4280) = v4700; - i8 v4701 = (i8)(intptr_t)(f68_SimpleError); + i8 v4701 = (i8)(intptr_t)(f67_SimpleError); ((void(*)(void))(intptr_t)v4701)(); -c02_0305:; +c01_0305:; -c02_0301:; +c01_0301:; i8 v4702 = (i8)(intptr_t)(ws+4152); i8 v4703 = *(i8*)(intptr_t)v4702; @@ -14269,13 +14269,13 @@ c02_0301:; *(i1*)(intptr_t)v4726 = v4723; } - void f166_ArchEmitMove(void); - void f166_ArchEmitMove(void); - void f166_ArchEmitMove(void); - void f166_ArchEmitMove(void); + void f165_ArchEmitMove(void); + void f165_ArchEmitMove(void); + void f165_ArchEmitMove(void); + void f165_ArchEmitMove(void); // ShuffleRegisters workspace at ws+4120 length ws+25 -void f378_ShuffleRegisters(void) { +void f377_ShuffleRegisters(void) { i1 v4727 = (i1)+0; i8 v4728 = (i8)(intptr_t)(ws+4128); @@ -14294,14 +14294,14 @@ void f378_ShuffleRegisters(void) { i8 v4735 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4735 = v4734; -c02_0306:; +c01_0306:; i8 v4736 = (i8)(intptr_t)(ws+4144); i1 v4737 = *(i1*)(intptr_t)v4736; i1 v4738 = (i1)+0; - if (v4737==v4738) goto c02_030b; else goto c02_030a; + if (v4737==v4738) goto c01_030b; else goto c01_030a; -c02_030a:; +c01_030a:; i8 v4739 = (i8)(intptr_t)(ws+4128); i1 v4740 = *(i1*)(intptr_t)v4739; @@ -14334,11 +14334,11 @@ c02_030a:; i8 v4761 = (i8)(intptr_t)(ws+4136); *(i8*)(intptr_t)v4761 = v4760; - goto c02_0306; + goto c01_0306; -c02_030b:; +c01_030b:; -c02_030c:; +c01_030c:; i8 v4762 = (i8)(intptr_t)(ws+4120); i8 v4763 = *(i8*)(intptr_t)v4762; @@ -14349,37 +14349,37 @@ c02_030c:; i8 v4766 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4766 = v4765; -c02_030e:; +c01_030e:; i8 v4767 = (i8)(intptr_t)(ws+4144); i1 v4768 = *(i1*)(intptr_t)v4767; i1 v4769 = (i1)+0; - if (v4768==v4769) goto c02_0313; else goto c02_0312; + if (v4768==v4769) goto c01_0313; else goto c01_0312; -c02_0312:; +c01_0312:; i8 v4770 = (i8)(intptr_t)(ws+4136); i8 v4771 = *(i8*)(intptr_t)v4770; i1 v4772 = *(i1*)(intptr_t)v4771; i1 v4773 = (i1)+0; - if (v4772==v4773) goto c02_031a; else goto c02_031b; + if (v4772==v4773) goto c01_031a; else goto c01_031b; -c02_031b:; +c01_031b:; i8 v4774 = (i8)(intptr_t)(ws+4136); i8 v4775 = *(i8*)(intptr_t)v4774; i8 v4776 = v4775+(+1); i1 v4777 = *(i1*)(intptr_t)v4776; i1 v4778 = (i1)+0; - if (v4777==v4778) goto c02_0319; else goto c02_031a; + if (v4777==v4778) goto c01_0319; else goto c01_031a; -c02_0319:; +c01_0319:; - goto c02_0313; + goto c01_0313; -c02_031a:; +c01_031a:; -c02_0314:; +c01_0314:; i8 v4779 = (i8)(intptr_t)(ws+4136); i8 v4780 = *(i8*)(intptr_t)v4779; @@ -14393,16 +14393,16 @@ c02_0314:; i8 v4786 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4786 = v4785; - goto c02_030e; + goto c01_030e; -c02_0313:; +c01_0313:; i8 v4787 = (i8)(intptr_t)(ws+4144); i1 v4788 = *(i1*)(intptr_t)v4787; i1 v4789 = (i1)+0; - if (v4788==v4789) goto c02_0320; else goto c02_031f; + if (v4788==v4789) goto c01_0320; else goto c01_031f; -c02_031f:; +c01_031f:; i8 v4790 = (i8)(intptr_t)(ws+4136); i8 v4791 = *(i8*)(intptr_t)v4790; @@ -14410,7 +14410,7 @@ c02_031f:; *(i1*)(intptr_t)(ws+4152) = v4792; i1 v4793 = (i1)+0; *(i1*)(intptr_t)(ws+4153) = v4793; - i8 v4794 = (i8)(intptr_t)(f166_ArchEmitMove); + i8 v4794 = (i8)(intptr_t)(f165_ArchEmitMove); ((void(*)(void))(intptr_t)v4794)(); @@ -14429,11 +14429,11 @@ c02_031f:; i8 v4805 = *(i8*)(intptr_t)v4804; *(i1*)(intptr_t)v4805 = v4803; - goto c02_030c; + goto c01_030c; -c02_0320:; +c01_0320:; -c02_031c:; +c01_031c:; i8 v4806 = (i8)(intptr_t)(ws+4120); i8 v4807 = *(i8*)(intptr_t)v4806; @@ -14444,31 +14444,31 @@ c02_031c:; i8 v4810 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4810 = v4809; -c02_0321:; +c01_0321:; i8 v4811 = (i8)(intptr_t)(ws+4144); i1 v4812 = *(i1*)(intptr_t)v4811; i1 v4813 = (i1)+0; - if (v4812==v4813) goto c02_0326; else goto c02_0325; + if (v4812==v4813) goto c01_0326; else goto c01_0325; -c02_0325:; +c01_0325:; i8 v4814 = (i8)(intptr_t)(ws+4136); i8 v4815 = *(i8*)(intptr_t)v4814; i1 v4816 = *(i1*)(intptr_t)v4815; i1 v4817 = (i1)+0; - if (v4816==v4817) goto c02_032f; else goto c02_0331; + if (v4816==v4817) goto c01_032f; else goto c01_0331; -c02_0331:; +c01_0331:; i8 v4818 = (i8)(intptr_t)(ws+4136); i8 v4819 = *(i8*)(intptr_t)v4818; i8 v4820 = v4819+(+1); i1 v4821 = *(i1*)(intptr_t)v4820; i1 v4822 = (i1)+0; - if (v4821==v4822) goto c02_032f; else goto c02_0330; + if (v4821==v4822) goto c01_032f; else goto c01_0330; -c02_0330:; +c01_0330:; i8 v4823 = (i8)(intptr_t)(ws+4136); i8 v4824 = *(i8*)(intptr_t)v4823; @@ -14478,15 +14478,15 @@ c02_0330:; i1 v4828 = *(i1*)(intptr_t)v4827; i1 v4829 = v4826&v4828; i1 v4830 = (i1)+0; - if (v4829==v4830) goto c02_032e; else goto c02_032f; + if (v4829==v4830) goto c01_032e; else goto c01_032f; -c02_032e:; +c01_032e:; - goto c02_0326; + goto c01_0326; -c02_032f:; +c01_032f:; -c02_0327:; +c01_0327:; i8 v4831 = (i8)(intptr_t)(ws+4136); i8 v4832 = *(i8*)(intptr_t)v4831; @@ -14500,16 +14500,16 @@ c02_0327:; i8 v4838 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4838 = v4837; - goto c02_0321; + goto c01_0321; -c02_0326:; +c01_0326:; i8 v4839 = (i8)(intptr_t)(ws+4144); i1 v4840 = *(i1*)(intptr_t)v4839; i1 v4841 = (i1)+0; - if (v4840==v4841) goto c02_0336; else goto c02_0335; + if (v4840==v4841) goto c01_0336; else goto c01_0335; -c02_0335:; +c01_0335:; i8 v4842 = (i8)(intptr_t)(ws+4136); i8 v4843 = *(i8*)(intptr_t)v4842; @@ -14520,7 +14520,7 @@ c02_0335:; i8 v4847 = v4846+(+1); i1 v4848 = *(i1*)(intptr_t)v4847; *(i1*)(intptr_t)(ws+4153) = v4848; - i8 v4849 = (i8)(intptr_t)(f166_ArchEmitMove); + i8 v4849 = (i8)(intptr_t)(f165_ArchEmitMove); ((void(*)(void))(intptr_t)v4849)(); @@ -14556,11 +14556,11 @@ c02_0335:; i8 v4873 = v4872+(+1); *(i1*)(intptr_t)v4873 = v4870; - goto c02_030c; + goto c01_030c; -c02_0336:; +c01_0336:; -c02_0332:; +c01_0332:; i8 v4874 = (i8)(intptr_t)(ws+4120); i8 v4875 = *(i8*)(intptr_t)v4874; @@ -14571,37 +14571,37 @@ c02_0332:; i8 v4878 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4878 = v4877; -c02_0337:; +c01_0337:; i8 v4879 = (i8)(intptr_t)(ws+4144); i1 v4880 = *(i1*)(intptr_t)v4879; i1 v4881 = (i1)+0; - if (v4880==v4881) goto c02_033c; else goto c02_033b; + if (v4880==v4881) goto c01_033c; else goto c01_033b; -c02_033b:; +c01_033b:; i8 v4882 = (i8)(intptr_t)(ws+4136); i8 v4883 = *(i8*)(intptr_t)v4882; i1 v4884 = *(i1*)(intptr_t)v4883; i1 v4885 = (i1)+0; - if (v4884==v4885) goto c02_0344; else goto c02_0343; + if (v4884==v4885) goto c01_0344; else goto c01_0343; -c02_0344:; +c01_0344:; i8 v4886 = (i8)(intptr_t)(ws+4136); i8 v4887 = *(i8*)(intptr_t)v4886; i8 v4888 = v4887+(+1); i1 v4889 = *(i1*)(intptr_t)v4888; i1 v4890 = (i1)+0; - if (v4889==v4890) goto c02_0343; else goto c02_0342; + if (v4889==v4890) goto c01_0343; else goto c01_0342; -c02_0342:; +c01_0342:; - goto c02_033c; + goto c01_033c; -c02_0343:; +c01_0343:; -c02_033d:; +c01_033d:; i8 v4891 = (i8)(intptr_t)(ws+4136); i8 v4892 = *(i8*)(intptr_t)v4891; @@ -14615,16 +14615,16 @@ c02_033d:; i8 v4898 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4898 = v4897; - goto c02_0337; + goto c01_0337; -c02_033c:; +c01_033c:; i8 v4899 = (i8)(intptr_t)(ws+4144); i1 v4900 = *(i1*)(intptr_t)v4899; i1 v4901 = (i1)+0; - if (v4900==v4901) goto c02_0349; else goto c02_0348; + if (v4900==v4901) goto c01_0349; else goto c01_0348; -c02_0348:; +c01_0348:; i1 v4902 = (i1)+0; *(i1*)(intptr_t)(ws+4152) = v4902; @@ -14633,7 +14633,7 @@ c02_0348:; i8 v4905 = v4904+(+1); i1 v4906 = *(i1*)(intptr_t)v4905; *(i1*)(intptr_t)(ws+4153) = v4906; - i8 v4907 = (i8)(intptr_t)(f166_ArchEmitMove); + i8 v4907 = (i8)(intptr_t)(f165_ArchEmitMove); ((void(*)(void))(intptr_t)v4907)(); @@ -14654,11 +14654,11 @@ c02_0348:; i8 v4920 = v4919+(+1); *(i1*)(intptr_t)v4920 = v4917; - goto c02_030c; + goto c01_030c; -c02_0349:; +c01_0349:; -c02_0345:; +c01_0345:; i8 v4921 = (i8)(intptr_t)(ws+4120); i8 v4922 = *(i8*)(intptr_t)v4921; @@ -14669,37 +14669,37 @@ c02_0345:; i8 v4925 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4925 = v4924; -c02_034a:; +c01_034a:; i8 v4926 = (i8)(intptr_t)(ws+4144); i1 v4927 = *(i1*)(intptr_t)v4926; i1 v4928 = (i1)+0; - if (v4927==v4928) goto c02_034f; else goto c02_034e; + if (v4927==v4928) goto c01_034f; else goto c01_034e; -c02_034e:; +c01_034e:; i8 v4929 = (i8)(intptr_t)(ws+4136); i8 v4930 = *(i8*)(intptr_t)v4929; i1 v4931 = *(i1*)(intptr_t)v4930; i1 v4932 = (i1)+0; - if (v4931==v4932) goto c02_0356; else goto c02_0357; + if (v4931==v4932) goto c01_0356; else goto c01_0357; -c02_0357:; +c01_0357:; i8 v4933 = (i8)(intptr_t)(ws+4136); i8 v4934 = *(i8*)(intptr_t)v4933; i8 v4935 = v4934+(+1); i1 v4936 = *(i1*)(intptr_t)v4935; i1 v4937 = (i1)+0; - if (v4936==v4937) goto c02_0356; else goto c02_0355; + if (v4936==v4937) goto c01_0356; else goto c01_0355; -c02_0355:; +c01_0355:; - goto c02_034f; + goto c01_034f; -c02_0356:; +c01_0356:; -c02_0350:; +c01_0350:; i8 v4938 = (i8)(intptr_t)(ws+4136); i8 v4939 = *(i8*)(intptr_t)v4938; @@ -14713,16 +14713,16 @@ c02_0350:; i8 v4945 = (i8)(intptr_t)(ws+4144); *(i1*)(intptr_t)v4945 = v4944; - goto c02_034a; + goto c01_034a; -c02_034f:; +c01_034f:; i8 v4946 = (i8)(intptr_t)(ws+4144); i1 v4947 = *(i1*)(intptr_t)v4946; i1 v4948 = (i1)+0; - if (v4947==v4948) goto c02_035c; else goto c02_035b; + if (v4947==v4948) goto c01_035c; else goto c01_035b; -c02_035b:; +c01_035b:; i8 v4949 = (i8)(intptr_t)(ws+4136); i8 v4950 = *(i8*)(intptr_t)v4949; @@ -14730,7 +14730,7 @@ c02_035b:; *(i1*)(intptr_t)(ws+4152) = v4951; i1 v4952 = (i1)+0; *(i1*)(intptr_t)(ws+4153) = v4952; - i8 v4953 = (i8)(intptr_t)(f166_ArchEmitMove); + i8 v4953 = (i8)(intptr_t)(f165_ArchEmitMove); ((void(*)(void))(intptr_t)v4953)(); @@ -14749,37 +14749,37 @@ c02_035b:; i8 v4964 = *(i8*)(intptr_t)v4963; *(i1*)(intptr_t)v4964 = v4962; - goto c02_030c; + goto c01_030c; -c02_035c:; +c01_035c:; -c02_0358:; +c01_0358:; - goto c02_030d; + goto c01_030d; -c02_030d:; +c01_030d:; } - void f61_PushNode(void); - void f63_NextNode(void); - void f21_print_hex_i32(void); - void f9_print_char(void); - void f18_print_i8(void); - void f9_print_char(void); - void f78_MidcodeName(void); - void f12_print(void); - void f9_print_char(void); - void f21_print_hex_i32(void); - void f9_print_char(void); - void f21_print_hex_i32(void); - void f9_print_char(void); - void f21_print_hex_i32(void); - void f9_print_char(void); - void f21_print_hex_i32(void); - void f13_print_nl(void); + void f60_PushNode(void); + void f62_NextNode(void); + void f20_print_hex_i32(void); + void f8_print_char(void); + void f17_print_i8(void); + void f8_print_char(void); + void f77_MidcodeName(void); + void f11_print(void); + void f8_print_char(void); + void f20_print_hex_i32(void); + void f8_print_char(void); + void f20_print_hex_i32(void); + void f8_print_char(void); + void f20_print_hex_i32(void); + void f8_print_char(void); + void f20_print_hex_i32(void); + void f12_print_nl(void); // PrintNodes workspace at ws+4176 length ws+40 -void f379_PrintNodes(void) { +void f378_PrintNodes(void) { i8 v4965 = (i8)(intptr_t)(ws+184); i8 v4966 = *(i8*)(intptr_t)v4965; @@ -14789,21 +14789,21 @@ void f379_PrintNodes(void) { i8 v4968 = (i8)(intptr_t)(ws+4176); i8 v4969 = *(i8*)(intptr_t)v4968; *(i8*)(intptr_t)(ws+4232) = v4969; - i8 v4970 = (i8)(intptr_t)(f61_PushNode); + i8 v4970 = (i8)(intptr_t)(f60_PushNode); ((void(*)(void))(intptr_t)v4970)(); -c02_035d:; +c01_035d:; i8 v4971 = (i8)(intptr_t)(ws+184); i8 v4972 = *(i8*)(intptr_t)v4971; i8 v4973 = (i8)(intptr_t)(ws+4184); i8 v4974 = *(i8*)(intptr_t)v4973; - if (v4972==v4974) goto c02_0362; else goto c02_0361; + if (v4972==v4974) goto c01_0362; else goto c01_0361; -c02_0361:; +c01_0361:; - i8 v4975 = (i8)(intptr_t)(f63_NextNode); + i8 v4975 = (i8)(intptr_t)(f62_NextNode); ((void(*)(void))(intptr_t)v4975)(); @@ -14819,27 +14819,27 @@ c02_0361:; i8 v4981 = (i8)(intptr_t)(ws+4200); i8 v4982 = *(i8*)(intptr_t)v4981; i8 v4983 = (i8)+0; - if (v4982==v4983) goto c02_0366; else goto c02_0367; + if (v4982==v4983) goto c01_0366; else goto c01_0367; -c02_0366:; +c01_0366:; - goto c02_0362; + goto c01_0362; -c02_0367:; +c01_0367:; -c02_0363:; +c01_0363:; i8 v4984 = (i8)(intptr_t)(ws+4200); i8 v4985 = *(i8*)(intptr_t)v4984; i4 v4986 = v4985; *(i4*)(intptr_t)(ws+4288) = v4986; - i8 v4987 = (i8)(intptr_t)(f21_print_hex_i32); + i8 v4987 = (i8)(intptr_t)(f20_print_hex_i32); ((void(*)(void))(intptr_t)v4987)(); i1 v4988 = (i1)+32; *(i1*)(intptr_t)(ws+4304) = v4988; - i8 v4989 = (i8)(intptr_t)(f9_print_char); + i8 v4989 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v4989)(); @@ -14848,13 +14848,13 @@ c02_0363:; i8 v4992 = v4991+(+256); i1 v4993 = *(i1*)(intptr_t)v4992; *(i1*)(intptr_t)(ws+4232) = v4993; - i8 v4994 = (i8)(intptr_t)(f18_print_i8); + i8 v4994 = (i8)(intptr_t)(f17_print_i8); ((void(*)(void))(intptr_t)v4994)(); i1 v4995 = (i1)+61; *(i1*)(intptr_t)(ws+4304) = v4995; - i8 v4996 = (i8)(intptr_t)(f9_print_char); + i8 v4996 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v4996)(); @@ -14863,7 +14863,7 @@ c02_0363:; i8 v4999 = v4998+(+256); i1 v5000 = *(i1*)(intptr_t)v4999; *(i1*)(intptr_t)(ws+4216) = v5000; - i8 v5001 = (i8)(intptr_t)(f78_MidcodeName); + i8 v5001 = (i8)(intptr_t)(f77_MidcodeName); ((void(*)(void))(intptr_t)v5001)(); @@ -14874,13 +14874,13 @@ c02_0363:; i8 v5004 = (i8)(intptr_t)(ws+4208); i8 v5005 = *(i8*)(intptr_t)v5004; *(i8*)(intptr_t)(ws+4288) = v5005; - i8 v5006 = (i8)(intptr_t)(f12_print); + i8 v5006 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v5006)(); i1 v5007 = (i1)+32; *(i1*)(intptr_t)(ws+4304) = v5007; - i8 v5008 = (i8)(intptr_t)(f9_print_char); + i8 v5008 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v5008)(); @@ -14890,13 +14890,13 @@ c02_0363:; i1 v5012 = *(i1*)(intptr_t)v5011; i4 v5013 = v5012; *(i4*)(intptr_t)(ws+4288) = v5013; - i8 v5014 = (i8)(intptr_t)(f21_print_hex_i32); + i8 v5014 = (i8)(intptr_t)(f20_print_hex_i32); ((void(*)(void))(intptr_t)v5014)(); i1 v5015 = (i1)+32; *(i1*)(intptr_t)(ws+4304) = v5015; - i8 v5016 = (i8)(intptr_t)(f9_print_char); + i8 v5016 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v5016)(); @@ -14906,13 +14906,13 @@ c02_0363:; i1 v5020 = *(i1*)(intptr_t)v5019; i4 v5021 = v5020; *(i4*)(intptr_t)(ws+4288) = v5021; - i8 v5022 = (i8)(intptr_t)(f21_print_hex_i32); + i8 v5022 = (i8)(intptr_t)(f20_print_hex_i32); ((void(*)(void))(intptr_t)v5022)(); i1 v5023 = (i1)+32; *(i1*)(intptr_t)(ws+4304) = v5023; - i8 v5024 = (i8)(intptr_t)(f9_print_char); + i8 v5024 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v5024)(); @@ -14922,13 +14922,13 @@ c02_0363:; i8 v5028 = *(i8*)(intptr_t)v5027; i4 v5029 = v5028; *(i4*)(intptr_t)(ws+4288) = v5029; - i8 v5030 = (i8)(intptr_t)(f21_print_hex_i32); + i8 v5030 = (i8)(intptr_t)(f20_print_hex_i32); ((void(*)(void))(intptr_t)v5030)(); i1 v5031 = (i1)+32; *(i1*)(intptr_t)(ws+4304) = v5031; - i8 v5032 = (i8)(intptr_t)(f9_print_char); + i8 v5032 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v5032)(); @@ -14938,25 +14938,25 @@ c02_0363:; i8 v5036 = *(i8*)(intptr_t)v5035; i4 v5037 = v5036; *(i4*)(intptr_t)(ws+4288) = v5037; - i8 v5038 = (i8)(intptr_t)(f21_print_hex_i32); + i8 v5038 = (i8)(intptr_t)(f20_print_hex_i32); ((void(*)(void))(intptr_t)v5038)(); - i8 v5039 = (i8)(intptr_t)(f13_print_nl); + i8 v5039 = (i8)(intptr_t)(f12_print_nl); ((void(*)(void))(intptr_t)v5039)(); - goto c02_035d; + goto c01_035d; -c02_0362:; +c01_0362:; } - void f370_IsStackedRegister(void); - void f370_IsStackedRegister(void); - void f31_MemCopy(void); + void f369_IsStackedRegister(void); + void f369_IsStackedRegister(void); + void f30_MemCopy(void); // IsSimpleValue workspace at ws+4216 length ws+33 -void f383_IsSimpleValue(void) { +void f382_IsSimpleValue(void) { i1 v5161 = (i1)+0; i8 v5162 = (i8)(intptr_t)(ws+4232); @@ -14967,7 +14967,7 @@ void f383_IsSimpleValue(void) { i8 v5165 = v5164+(+48); i1 v5166 = *(i1*)(intptr_t)v5165; *(i1*)(intptr_t)(ws+4256) = v5166; - i8 v5167 = (i8)(intptr_t)(f370_IsStackedRegister); + i8 v5167 = (i8)(intptr_t)(f369_IsStackedRegister); ((void(*)(void))(intptr_t)v5167)(); @@ -14978,9 +14978,9 @@ void f383_IsSimpleValue(void) { i8 v5170 = (i8)(intptr_t)(ws+4233); i1 v5171 = *(i1*)(intptr_t)v5170; i1 v5172 = (i1)+0; - if (v5171==v5172) goto c02_0393; else goto c02_0394; + if (v5171==v5172) goto c01_0393; else goto c01_0394; -c02_0393:; +c01_0393:; i8 v5173 = (i8)(intptr_t)(ws+4216); i8 v5174 = *(i8*)(intptr_t)v5173; @@ -14994,9 +14994,9 @@ c02_0393:; i8 v5180 = v5179+(+256); i1 v5181 = *(i1*)(intptr_t)v5180; i1 v5182 = (i1)+24; - if (v5181==v5182) goto c02_0398; else goto c02_0399; + if (v5181==v5182) goto c01_0398; else goto c01_0399; -c02_0398:; +c01_0398:; i8 v5183 = (i8)(intptr_t)(ws+4240); i8 v5184 = *(i8*)(intptr_t)v5183; @@ -15005,16 +15005,16 @@ c02_0398:; i8 v5187 = (i8)(intptr_t)(ws+4240); *(i8*)(intptr_t)v5187 = v5186; -c02_0399:; +c01_0399:; -c02_0395:; +c01_0395:; i8 v5188 = (i8)(intptr_t)(ws+4240); i8 v5189 = *(i8*)(intptr_t)v5188; i8 v5190 = v5189+(+57); i1 v5191 = *(i1*)(intptr_t)v5190; *(i1*)(intptr_t)(ws+4256) = v5191; - i8 v5192 = (i8)(intptr_t)(f370_IsStackedRegister); + i8 v5192 = (i8)(intptr_t)(f369_IsStackedRegister); ((void(*)(void))(intptr_t)v5192)(); @@ -15027,31 +15027,31 @@ c02_0395:; i8 v5197 = v5196+(+24); i8 v5198 = *(i8*)(intptr_t)v5197; i8 v5199 = (i8)+0; - if (v5198==v5199) goto c02_03a0; else goto c02_03a1; + if (v5198==v5199) goto c01_03a0; else goto c01_03a1; -c02_03a1:; +c01_03a1:; i8 v5200 = (i8)(intptr_t)(ws+4248); i1 v5201 = *(i1*)(intptr_t)v5200; i1 v5202 = (i1)+0; - if (v5201==v5202) goto c02_039f; else goto c02_03a0; + if (v5201==v5202) goto c01_039f; else goto c01_03a0; -c02_039f:; +c01_039f:; return; -c02_03a0:; +c01_03a0:; -c02_039a:; +c01_039a:; i8 v5203 = (i8)(intptr_t)(ws+4240); i8 v5204 = *(i8*)(intptr_t)v5203; i8 v5205 = v5204+(+256); i1 v5206 = *(i1*)(intptr_t)v5205; i1 v5207 = (i1)+42; - if (v5206==v5207) goto c02_03a5; else goto c02_03a6; + if (v5206==v5207) goto c01_03a5; else goto c01_03a6; -c02_03a5:; +c01_03a5:; i8 v5208 = (i8)(intptr_t)(ws+4240); i8 v5209 = *(i8*)(intptr_t)v5208; @@ -15061,7 +15061,7 @@ c02_03a5:; i8 v5211 = (i8)(intptr_t)(ws+4224); i8 v5212 = *(i8*)(intptr_t)v5211; *(i8*)(intptr_t)(ws+4280) = v5212; - i8 v5213 = (i8)(intptr_t)(f31_MemCopy); + i8 v5213 = (i8)(intptr_t)(f30_MemCopy); ((void(*)(void))(intptr_t)v5213)(); @@ -15075,18 +15075,18 @@ c02_03a5:; i8 v5219 = (i8)(intptr_t)(ws+4232); *(i1*)(intptr_t)v5219 = v5218; - goto c02_03a2; + goto c01_03a2; -c02_03a6:; +c01_03a6:; i8 v5220 = (i8)(intptr_t)(ws+4240); i8 v5221 = *(i8*)(intptr_t)v5220; i8 v5222 = v5221+(+256); i1 v5223 = *(i1*)(intptr_t)v5222; i1 v5224 = (i1)+40; - if (v5223==v5224) goto c02_03a9; else goto c02_03aa; + if (v5223==v5224) goto c01_03a9; else goto c01_03aa; -c02_03a9:; +c01_03a9:; i8 v5225 = (i8)(intptr_t)(ws+4240); i8 v5226 = *(i8*)(intptr_t)v5225; @@ -15105,18 +15105,18 @@ c02_03a9:; i8 v5235 = (i8)(intptr_t)(ws+4232); *(i1*)(intptr_t)v5235 = v5234; -c02_03aa:; +c01_03aa:; -c02_03a2:; +c01_03a2:; -c02_0394:; +c01_0394:; -c02_0390:; +c01_0390:; } // check_deref workspace at ws+4240 length ws+0 -void f385_check_deref(void) { +void f384_check_deref(void) { i8 v5246 = (i8)(intptr_t)(ws+4216); i8 v5247 = *(i8*)(intptr_t)v5246; @@ -15124,9 +15124,9 @@ void f385_check_deref(void) { i8 v5249 = (i8)(intptr_t)(ws+4224); i8 v5250 = *(i8*)(intptr_t)v5249; i8 v5251 = *(i8*)(intptr_t)v5250; - if (v5248==v5251) goto c02_03ba; else goto c02_03b8; + if (v5248==v5251) goto c01_03ba; else goto c01_03b8; -c02_03ba:; +c01_03ba:; i8 v5252 = (i8)(intptr_t)(ws+4216); i8 v5253 = *(i8*)(intptr_t)v5252; @@ -15146,9 +15146,9 @@ c02_03ba:; i8 v5267 = v5266+(+16); i2 v5268 = *(i2*)(intptr_t)v5267; i2 v5269 = v5264+v5268; - if (v5260==v5269) goto c02_03b9; else goto c02_03b8; + if (v5260==v5269) goto c01_03b9; else goto c01_03b8; -c02_03b9:; +c01_03b9:; i8 v5270 = (i8)(intptr_t)(ws+4216); i8 v5271 = *(i8*)(intptr_t)v5270; @@ -15158,27 +15158,27 @@ c02_03b9:; i8 v5275 = *(i8*)(intptr_t)v5274; i8 v5276 = v5275+(+10); i1 v5277 = *(i1*)(intptr_t)v5276; - if (v5273==v5277) goto c02_03b7; else goto c02_03b8; + if (v5273==v5277) goto c01_03b7; else goto c01_03b8; -c02_03b7:; +c01_03b7:; i1 v5278 = (i1)+1; i8 v5279 = (i8)(intptr_t)(ws+4232); *(i1*)(intptr_t)v5279 = v5278; -c02_03b8:; +c01_03b8:; -c02_03b0:; +c01_03b0:; } - void f385_check_deref(void); - void f385_check_deref(void); - void f385_check_deref(void); - void f385_check_deref(void); - void f385_check_deref(void); + void f384_check_deref(void); + void f384_check_deref(void); + void f384_check_deref(void); + void f384_check_deref(void); + void f384_check_deref(void); // SimpleValuesMatch workspace at ws+4216 length ws+17 -void f384_SimpleValuesMatch(void) { +void f383_SimpleValuesMatch(void) { i1 v5236 = (i1)+0; i8 v5237 = (i8)(intptr_t)(ws+4232); @@ -15192,15 +15192,15 @@ void f384_SimpleValuesMatch(void) { i8 v5243 = *(i8*)(intptr_t)v5242; i8 v5244 = v5243+(+19); i1 v5245 = *(i1*)(intptr_t)v5244; - if (v5241==v5245) goto c02_03af; else goto c02_03ae; + if (v5241==v5245) goto c01_03af; else goto c01_03ae; -c02_03ae:; +c01_03ae:; return; -c02_03af:; +c01_03af:; -c02_03ab:; +c01_03ab:; i8 v5280 = (i8)(intptr_t)(ws+4216); @@ -15208,57 +15208,57 @@ c02_03ab:; i8 v5282 = v5281+(+19); i1 v5283 = *(i1*)(intptr_t)v5282; - if (v5283 != +45) goto c02_03bc; + if (v5283 != +45) goto c01_03bc; - i8 v5284 = (i8)(intptr_t)(f385_check_deref); + i8 v5284 = (i8)(intptr_t)(f384_check_deref); ((void(*)(void))(intptr_t)v5284)(); - goto c02_03bb; + goto c01_03bb; -c02_03bc:; +c01_03bc:; - if (v5283 != +46) goto c02_03bd; + if (v5283 != +46) goto c01_03bd; - i8 v5285 = (i8)(intptr_t)(f385_check_deref); + i8 v5285 = (i8)(intptr_t)(f384_check_deref); ((void(*)(void))(intptr_t)v5285)(); - goto c02_03bb; + goto c01_03bb; -c02_03bd:; +c01_03bd:; - if (v5283 != +47) goto c02_03be; + if (v5283 != +47) goto c01_03be; - i8 v5286 = (i8)(intptr_t)(f385_check_deref); + i8 v5286 = (i8)(intptr_t)(f384_check_deref); ((void(*)(void))(intptr_t)v5286)(); - goto c02_03bb; + goto c01_03bb; -c02_03be:; +c01_03be:; - if (v5283 != +48) goto c02_03bf; + if (v5283 != +48) goto c01_03bf; - i8 v5287 = (i8)(intptr_t)(f385_check_deref); + i8 v5287 = (i8)(intptr_t)(f384_check_deref); ((void(*)(void))(intptr_t)v5287)(); - goto c02_03bb; + goto c01_03bb; -c02_03bf:; +c01_03bf:; - if (v5283 != +42) goto c02_03c0; + if (v5283 != +42) goto c01_03c0; - i8 v5288 = (i8)(intptr_t)(f385_check_deref); + i8 v5288 = (i8)(intptr_t)(f384_check_deref); ((void(*)(void))(intptr_t)v5288)(); - goto c02_03bb; + goto c01_03bb; -c02_03c0:; +c01_03c0:; - if (v5283 != +40) goto c02_03c1; + if (v5283 != +40) goto c01_03c1; i8 v5289 = (i8)(intptr_t)(ws+4216); i8 v5290 = *(i8*)(intptr_t)v5289; @@ -15266,39 +15266,39 @@ c02_03c0:; i8 v5292 = (i8)(intptr_t)(ws+4224); i8 v5293 = *(i8*)(intptr_t)v5292; i4 v5294 = *(i4*)(intptr_t)v5293; - if (v5291==v5294) goto c02_03c5; else goto c02_03c6; + if (v5291==v5294) goto c01_03c5; else goto c01_03c6; -c02_03c5:; +c01_03c5:; i1 v5295 = (i1)+1; i8 v5296 = (i8)(intptr_t)(ws+4232); *(i1*)(intptr_t)v5296 = v5295; -c02_03c6:; +c01_03c6:; -c02_03c2:; +c01_03c2:; -c02_03c1:; +c01_03c1:; -c02_03bb:; +c01_03bb:; } - void f61_PushNode(void); - void f147_AllocNewInstruction(void); - void f62_PopNode(void); - void f23_MemZero(void); - void f23_MemZero(void); - void f369_PopulateMatchBuffer(void); + void f60_PushNode(void); + void f146_AllocNewInstruction(void); + void f61_PopNode(void); + void f22_MemZero(void); + void f22_MemZero(void); + void f368_PopulateMatchBuffer(void); // RewindRulePointers workspace at ws+4176 length ws+0 -void f388_RewindRulePointers(void) { +void f387_RewindRulePointers(void) { i8 v5344 = (i8)(intptr_t)(ws+4112); *(i8*)(intptr_t)(ws+4176) = v5344; i8 v5345 = (i8)+4; *(i8*)(intptr_t)(ws+4184) = v5345; - i8 v5346 = (i8)(intptr_t)(f23_MemZero); + i8 v5346 = (i8)(intptr_t)(f22_MemZero); ((void(*)(void))(intptr_t)v5346)(); @@ -15306,7 +15306,7 @@ void f388_RewindRulePointers(void) { *(i8*)(intptr_t)(ws+4176) = v5347; i8 v5348 = (i8)+32; *(i8*)(intptr_t)(ws+4184) = v5348; - i8 v5349 = (i8)(intptr_t)(f23_MemZero); + i8 v5349 = (i8)(intptr_t)(f22_MemZero); ((void(*)(void))(intptr_t)v5349)(); @@ -15322,7 +15322,7 @@ void f388_RewindRulePointers(void) { *(i8*)(intptr_t)(ws+4184) = v5355; i8 v5356 = (i8)(intptr_t)(ws+4112); *(i8*)(intptr_t)(ws+4192) = v5356; - i8 v5357 = (i8)(intptr_t)(f369_PopulateMatchBuffer); + i8 v5357 = (i8)(intptr_t)(f368_PopulateMatchBuffer); ((void(*)(void))(intptr_t)v5357)(); @@ -15330,23 +15330,23 @@ void f388_RewindRulePointers(void) { i8 v5359 = (i8)(intptr_t)(ws+4096); *(i1*)(intptr_t)v5359 = v5358; - i8 v5360 = (i8)(intptr_t)((i1*)f3___main_s02aa); + i8 v5360 = (i8)(intptr_t)((i1*)f2___main_s02aa); i8 v5361 = (i8)(intptr_t)(ws+4152); *(i8*)(intptr_t)v5361 = v5360; - i8 v5362 = (i8)(intptr_t)((i1*)f3___main_s02ab); + i8 v5362 = (i8)(intptr_t)((i1*)f2___main_s02ab); i8 v5363 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)v5363 = v5362; - i8 v5364 = (i8)(intptr_t)((i1*)f3___main_s02ac-7); + i8 v5364 = (i8)(intptr_t)((i1*)f2___main_s02ac-7); i8 v5365 = (i8)(intptr_t)(ws+4104); *(i8*)(intptr_t)v5365 = v5364; } - void f188_MatchPredicate(void); + void f187_MatchPredicate(void); // TestRule workspace at ws+4176 length ws+28 -void f389_TestRule(void) { +void f388_TestRule(void) { i1 v5366 = (i1)+0; i8 v5367 = (i8)(intptr_t)(ws+4176); @@ -15357,9 +15357,9 @@ void f389_TestRule(void) { i8 v5370 = v5369+(+1); i1 v5371 = *(i1*)(intptr_t)v5370; i1 v5372 = (i1)+0; - if (v5371==v5372) goto c02_03d6; else goto c02_03d5; + if (v5371==v5372) goto c01_03d6; else goto c01_03d5; -c02_03d5:; +c01_03d5:; i8 v5373 = (i8)(intptr_t)(ws+4088); i8 v5374 = *(i8*)(intptr_t)v5373; @@ -15371,36 +15371,36 @@ c02_03d5:; i1 v5380 = *(i1*)(intptr_t)v5379; i1 v5381 = v5376&v5380; i1 v5382 = (i1)+0; - if (v5381==v5382) goto c02_03da; else goto c02_03db; + if (v5381==v5382) goto c01_03da; else goto c01_03db; -c02_03da:; +c01_03da:; return; -c02_03db:; +c01_03db:; -c02_03d7:; +c01_03d7:; - goto c02_03d2; + goto c01_03d2; -c02_03d6:; +c01_03d6:; i8 v5383 = (i8)(intptr_t)(ws+4088); i8 v5384 = *(i8*)(intptr_t)v5383; i8 v5385 = v5384+(+56); i1 v5386 = *(i1*)(intptr_t)v5385; i1 v5387 = (i1)+0; - if (v5386==v5387) goto c02_03e0; else goto c02_03df; + if (v5386==v5387) goto c01_03e0; else goto c01_03df; -c02_03df:; +c01_03df:; return; -c02_03e0:; +c01_03e0:; -c02_03dc:; +c01_03dc:; -c02_03d2:; +c01_03d2:; i8 v5388 = (i8)(intptr_t)(ws+4112); i8 v5389 = (i8)(intptr_t)(ws+4184); @@ -15418,14 +15418,14 @@ c02_03d2:; i8 v5397 = (i8)(intptr_t)(ws+4200); *(i1*)(intptr_t)v5397 = v5396; -c02_03e1:; +c01_03e1:; i8 v5398 = (i8)(intptr_t)(ws+4200); i1 v5399 = *(i1*)(intptr_t)v5398; i1 v5400 = (i1)+0; - if (v5399==v5400) goto c02_03e6; else goto c02_03e5; + if (v5399==v5400) goto c01_03e6; else goto c01_03e5; -c02_03e5:; +c01_03e5:; i8 v5401 = (i8)(intptr_t)(ws+4184); i8 v5402 = *(i8*)(intptr_t)v5401; @@ -15443,9 +15443,9 @@ c02_03e5:; i1 v5410 = *(i1*)(intptr_t)v5409; i1 v5411 = v5410&(+1); i1 v5412 = (i1)+0; - if (v5411==v5412) goto c02_03eb; else goto c02_03ea; + if (v5411==v5412) goto c01_03eb; else goto c01_03ea; -c02_03ea:; +c01_03ea:; i8 v5413 = (i8)(intptr_t)(ws+4192); i8 v5414 = *(i8*)(intptr_t)v5413; @@ -15463,19 +15463,19 @@ c02_03ea:; i1 v5422 = *(i1*)(intptr_t)v5421; i8 v5423 = (i8)(intptr_t)(ws+4202); i1 v5424 = *(i1*)(intptr_t)v5423; - if (v5422==v5424) goto c02_03f0; else goto c02_03ef; + if (v5422==v5424) goto c01_03f0; else goto c01_03ef; -c02_03ef:; +c01_03ef:; return; -c02_03f0:; +c01_03f0:; -c02_03ec:; +c01_03ec:; -c02_03eb:; +c01_03eb:; -c02_03e7:; +c01_03e7:; i8 v5425 = (i8)(intptr_t)(ws+4200); i1 v5426 = *(i1*)(intptr_t)v5425; @@ -15484,16 +15484,16 @@ c02_03e7:; i8 v5429 = (i8)(intptr_t)(ws+4200); *(i1*)(intptr_t)v5429 = v5428; - goto c02_03e1; + goto c01_03e1; -c02_03e6:; +c01_03e6:; i8 v5430 = (i8)(intptr_t)(ws+4096); i1 v5431 = *(i1*)(intptr_t)v5430; *(i1*)(intptr_t)(ws+4208) = v5431; i8 v5432 = (i8)(intptr_t)(ws+4120); *(i8*)(intptr_t)(ws+4216) = v5432; - i8 v5433 = (i8)(intptr_t)(f188_MatchPredicate); + i8 v5433 = (i8)(intptr_t)(f187_MatchPredicate); ((void(*)(void))(intptr_t)v5433)(); @@ -15506,33 +15506,33 @@ c02_03e6:; i1 v5438 = *(i1*)(intptr_t)v5437; i1 v5439 = v5438&(+1); i1 v5440 = (i1)+0; - if (v5439==v5440) goto c02_03f7; else goto c02_03f8; + if (v5439==v5440) goto c01_03f7; else goto c01_03f8; -c02_03f8:; +c01_03f8:; i8 v5441 = (i8)(intptr_t)(ws+4203); i1 v5442 = *(i1*)(intptr_t)v5441; i1 v5443 = (i1)+0; - if (v5442==v5443) goto c02_03f6; else goto c02_03f7; + if (v5442==v5443) goto c01_03f6; else goto c01_03f7; -c02_03f6:; +c01_03f6:; return; -c02_03f7:; +c01_03f7:; -c02_03f1:; +c01_03f1:; i1 v5444 = (i1)+1; i8 v5445 = (i8)(intptr_t)(ws+4176); *(i1*)(intptr_t)v5445 = v5444; } - void f388_RewindRulePointers(void); - void f77_AllocateNewNode(void); + void f387_RewindRulePointers(void); + void f76_AllocateNewNode(void); // ConvertNodeToFallback workspace at ws+4176 length ws+33 -void f390_ConvertNodeToFallback(void) { +void f389_ConvertNodeToFallback(void) { i8 v5468 = (i8)(intptr_t)(ws+4088); i8 v5469 = *(i8*)(intptr_t)v5468; @@ -15541,7 +15541,7 @@ void f390_ConvertNodeToFallback(void) { i1 v5471 = (i1)+24; *(i1*)(intptr_t)(ws+4216) = v5471; - i8 v5472 = (i8)(intptr_t)(f77_AllocateNewNode); + i8 v5472 = (i8)(intptr_t)(f76_AllocateNewNode); ((void(*)(void))(intptr_t)v5472)(); @@ -15599,14 +15599,14 @@ void f390_ConvertNodeToFallback(void) { i8 v5510 = (i8)(intptr_t)(ws+4208); *(i1*)(intptr_t)v5510 = v5509; -c02_0408:; +c01_0408:; i8 v5511 = (i8)(intptr_t)(ws+4208); i1 v5512 = *(i1*)(intptr_t)v5511; i1 v5513 = (i1)+4; - if (v5512==v5513) goto c02_040d; else goto c02_040c; + if (v5512==v5513) goto c01_040d; else goto c01_040c; -c02_040c:; +c01_040c:; i8 v5514 = (i8)(intptr_t)(ws+4200); i8 v5515 = *(i8*)(intptr_t)v5514; @@ -15620,9 +15620,9 @@ c02_040c:; i8 v5523 = *(i8*)(intptr_t)v5522; i8 v5524 = (i8)(intptr_t)(ws+4176); i8 v5525 = *(i8*)(intptr_t)v5524; - if (v5523==v5525) goto c02_0411; else goto c02_0412; + if (v5523==v5525) goto c01_0411; else goto c01_0412; -c02_0411:; +c01_0411:; i8 v5526 = (i8)(intptr_t)(ws+4088); i8 v5527 = *(i8*)(intptr_t)v5526; @@ -15637,9 +15637,9 @@ c02_0411:; i8 v5536 = v5530+v5535; *(i8*)(intptr_t)v5536 = v5527; -c02_0412:; +c01_0412:; -c02_040e:; +c01_040e:; i8 v5537 = (i8)(intptr_t)(ws+4208); i1 v5538 = *(i1*)(intptr_t)v5537; @@ -15647,28 +15647,28 @@ c02_040e:; i8 v5540 = (i8)(intptr_t)(ws+4208); *(i1*)(intptr_t)v5540 = v5539; - goto c02_0408; + goto c01_0408; -c02_040d:; +c01_040d:; } - void f390_ConvertNodeToFallback(void); - void f388_RewindRulePointers(void); - void f379_PrintNodes(void); - void f66_StartError(void); -const i1 c02_s01c5[] = { 0x75,0x6e,0x6d,0x61,0x74,0x63,0x68,0x65,0x64,0x20,0x69,0x6e,0x73,0x74,0x72,0x75,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0 }; - void f12_print(void); - void f18_print_i8(void); - void f9_print_char(void); -const i1 c02_s01c6[] = { 0x70,0x72,0x6f,0x64,0x75,0x63,0x69,0x6e,0x67,0x20,0 }; - void f12_print(void); - void f21_print_hex_i32(void); - void f67_EndError(void); - void f389_TestRule(void); - void f61_PushNode(void); + void f389_ConvertNodeToFallback(void); + void f387_RewindRulePointers(void); + void f378_PrintNodes(void); + void f65_StartError(void); +const i1 c01_s01c5[] = { 0x75,0x6e,0x6d,0x61,0x74,0x63,0x68,0x65,0x64,0x20,0x69,0x6e,0x73,0x74,0x72,0x75,0x63,0x74,0x69,0x6f,0x6e,0x3a,0x20,0 }; + void f11_print(void); + void f17_print_i8(void); + void f8_print_char(void); +const i1 c01_s01c6[] = { 0x70,0x72,0x6f,0x64,0x75,0x63,0x69,0x6e,0x67,0x20,0 }; + void f11_print(void); + void f20_print_hex_i32(void); + void f66_EndError(void); + void f388_TestRule(void); + void f60_PushNode(void); // CopyChildNodes workspace at ws+4176 length ws+16 -void f391_CopyChildNodes(void) { +void f390_CopyChildNodes(void) { i8 v5643 = (i8)(intptr_t)(ws+4104); i8 v5644 = *(i8*)(intptr_t)v5643; @@ -15688,14 +15688,14 @@ void f391_CopyChildNodes(void) { i8 v5654 = (i8)(intptr_t)(ws+4032); *(i1*)(intptr_t)v5654 = v5653; -c02_0434:; +c01_0434:; i8 v5655 = (i8)(intptr_t)(ws+4032); i1 v5656 = *(i1*)(intptr_t)v5655; i1 v5657 = (i1)+4; - if (v5656==v5657) goto c02_0439; else goto c02_0438; + if (v5656==v5657) goto c01_0439; else goto c01_0438; -c02_0438:; +c01_0438:; i8 v5658 = (i8)(intptr_t)(ws+4120); i8 v5659 = (i8)(intptr_t)(ws+4032); @@ -15712,9 +15712,9 @@ c02_0438:; i1 v5668 = *(i1*)(intptr_t)v5667; i1 v5669 = v5668&(+1); i1 v5670 = (i1)+0; - if (v5669==v5670) goto c02_043e; else goto c02_043d; + if (v5669==v5670) goto c01_043e; else goto c01_043d; -c02_043d:; +c01_043d:; i8 v5671 = (i8)(intptr_t)(ws+4184); i8 v5672 = *(i8*)(intptr_t)v5671; @@ -15733,14 +15733,14 @@ c02_043d:; i1 v5683 = *(i1*)(intptr_t)v5682; i1 v5684 = v5683&(+1); i1 v5685 = (i1)+0; - if (v5684==v5685) goto c02_0443; else goto c02_0442; + if (v5684==v5685) goto c01_0443; else goto c01_0442; -c02_0442:; +c01_0442:; i8 v5686 = (i8)(intptr_t)(ws+4184); i8 v5687 = *(i8*)(intptr_t)v5686; *(i8*)(intptr_t)(ws+4232) = v5687; - i8 v5688 = (i8)(intptr_t)(f61_PushNode); + i8 v5688 = (i8)(intptr_t)(f60_PushNode); ((void(*)(void))(intptr_t)v5688)(); @@ -15765,13 +15765,13 @@ c02_0442:; i8 v5703 = v5702+(+48); *(i8*)(intptr_t)v5703 = v5700; -c02_0443:; +c01_0443:; -c02_043f:; +c01_043f:; -c02_043e:; +c01_043e:; -c02_043a:; +c01_043a:; i8 v5704 = (i8)(intptr_t)(ws+4176); i1 v5705 = *(i1*)(intptr_t)v5704; @@ -15793,9 +15793,9 @@ c02_043a:; i8 v5717 = (i8)(intptr_t)(ws+4032); *(i1*)(intptr_t)v5717 = v5716; - goto c02_0434; + goto c01_0434; -c02_0439:; +c01_0439:; i8 v5718 = (i8)(intptr_t)(ws+4072); i8 v5719 = *(i8*)(intptr_t)v5718; @@ -15812,18 +15812,18 @@ c02_0439:; *(i8*)(intptr_t)v5727 = v5724; } - void f391_CopyChildNodes(void); + void f390_CopyChildNodes(void); // InstructionMatcher workspace at ws+4112 length ws+58 -void f387_InstructionMatcher(void) { +void f386_InstructionMatcher(void) { - i8 v5446 = (i8)(intptr_t)(f388_RewindRulePointers); + i8 v5446 = (i8)(intptr_t)(f387_RewindRulePointers); ((void(*)(void))(intptr_t)v5446)(); -c02_03f9:; +c01_03f9:; i8 v5447 = (i8)(intptr_t)(ws+4104); i8 v5448 = *(i8*)(intptr_t)v5447; @@ -15839,58 +15839,58 @@ c02_03f9:; i8 v5455 = (i8)(intptr_t)(ws+4104); i8 v5456 = *(i8*)(intptr_t)v5455; - i8 v5457 = (i8)(intptr_t)((i1*)f3___main_s02ac+1302); - if (v5456==v5457) goto c02_03fe; else goto c02_03ff; + i8 v5457 = (i8)(intptr_t)((i1*)f2___main_s02ac+1302); + if (v5456==v5457) goto c01_03fe; else goto c01_03ff; -c02_03fe:; +c01_03fe:; i8 v5458 = (i8)(intptr_t)(ws+4088); i8 v5459 = *(i8*)(intptr_t)v5458; i8 v5460 = v5459+(+256); i1 v5461 = *(i1*)(intptr_t)v5460; i1 v5462 = (i1)+24; - if (v5461==v5462) goto c02_0406; else goto c02_0407; + if (v5461==v5462) goto c01_0406; else goto c01_0407; -c02_0407:; +c01_0407:; i8 v5463 = (i8)(intptr_t)(ws+4088); i8 v5464 = *(i8*)(intptr_t)v5463; i8 v5465 = v5464+(+48); i8 v5466 = *(i8*)(intptr_t)v5465; i8 v5467 = (i8)+0; - if (v5466==v5467) goto c02_0406; else goto c02_0405; + if (v5466==v5467) goto c01_0406; else goto c01_0405; -c02_0405:; +c01_0405:; - i8 v5541 = (i8)(intptr_t)(f390_ConvertNodeToFallback); + i8 v5541 = (i8)(intptr_t)(f389_ConvertNodeToFallback); ((void(*)(void))(intptr_t)v5541)(); - i8 v5542 = (i8)(intptr_t)(f388_RewindRulePointers); + i8 v5542 = (i8)(intptr_t)(f387_RewindRulePointers); ((void(*)(void))(intptr_t)v5542)(); - goto c02_03f9; + goto c01_03f9; -c02_0406:; +c01_0406:; -c02_0400:; +c01_0400:; i8 v5543 = (i8)(intptr_t)(ws+4024); i8 v5544 = *(i8*)(intptr_t)v5543; *(i8*)(intptr_t)(ws+4176) = v5544; - i8 v5545 = (i8)(intptr_t)(f379_PrintNodes); + i8 v5545 = (i8)(intptr_t)(f378_PrintNodes); ((void(*)(void))(intptr_t)v5545)(); - i8 v5546 = (i8)(intptr_t)(f66_StartError); + i8 v5546 = (i8)(intptr_t)(f65_StartError); ((void(*)(void))(intptr_t)v5546)(); - i8 v5547 = (i8)(intptr_t)c02_s01c5; + i8 v5547 = (i8)(intptr_t)c01_s01c5; *(i8*)(intptr_t)(ws+4288) = v5547; - i8 v5548 = (i8)(intptr_t)(f12_print); + i8 v5548 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v5548)(); @@ -15898,14 +15898,14 @@ c02_0400:; i8 v5550 = (i8)(intptr_t)(ws+4032); *(i1*)(intptr_t)v5550 = v5549; -c02_0413:; +c01_0413:; i8 v5551 = (i8)(intptr_t)(ws+4032); i1 v5552 = *(i1*)(intptr_t)v5551; i1 v5553 = (i1)+4; - if (v5552==v5553) goto c02_0418; else goto c02_0417; + if (v5552==v5553) goto c01_0418; else goto c01_0417; -c02_0417:; +c01_0417:; i8 v5554 = (i8)(intptr_t)(ws+4112); i8 v5555 = (i8)(intptr_t)(ws+4032); @@ -15914,13 +15914,13 @@ c02_0417:; i8 v5558 = v5554+v5557; i1 v5559 = *(i1*)(intptr_t)v5558; *(i1*)(intptr_t)(ws+4232) = v5559; - i8 v5560 = (i8)(intptr_t)(f18_print_i8); + i8 v5560 = (i8)(intptr_t)(f17_print_i8); ((void(*)(void))(intptr_t)v5560)(); i1 v5561 = (i1)+32; *(i1*)(intptr_t)(ws+4304) = v5561; - i8 v5562 = (i8)(intptr_t)(f9_print_char); + i8 v5562 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v5562)(); @@ -15930,13 +15930,13 @@ c02_0417:; i8 v5566 = (i8)(intptr_t)(ws+4032); *(i1*)(intptr_t)v5566 = v5565; - goto c02_0413; + goto c01_0413; -c02_0418:; +c01_0418:; - i8 v5567 = (i8)(intptr_t)c02_s01c6; + i8 v5567 = (i8)(intptr_t)c01_s01c6; *(i8*)(intptr_t)(ws+4288) = v5567; - i8 v5568 = (i8)(intptr_t)(f12_print); + i8 v5568 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v5568)(); @@ -15946,19 +15946,19 @@ c02_0418:; i1 v5572 = *(i1*)(intptr_t)v5571; i4 v5573 = v5572; *(i4*)(intptr_t)(ws+4288) = v5573; - i8 v5574 = (i8)(intptr_t)(f21_print_hex_i32); + i8 v5574 = (i8)(intptr_t)(f20_print_hex_i32); ((void(*)(void))(intptr_t)v5574)(); - i8 v5575 = (i8)(intptr_t)(f67_EndError); + i8 v5575 = (i8)(intptr_t)(f66_EndError); ((void(*)(void))(intptr_t)v5575)(); -c02_03ff:; +c01_03ff:; -c02_03fb:; +c01_03fb:; - i8 v5576 = (i8)(intptr_t)(f389_TestRule); + i8 v5576 = (i8)(intptr_t)(f388_TestRule); ((void(*)(void))(intptr_t)v5576)(); @@ -15969,15 +15969,15 @@ c02_03fb:; i8 v5579 = (i8)(intptr_t)(ws+4168); i1 v5580 = *(i1*)(intptr_t)v5579; i1 v5581 = (i1)+0; - if (v5580==v5581) goto c02_041d; else goto c02_041c; + if (v5580==v5581) goto c01_041d; else goto c01_041c; -c02_041c:; +c01_041c:; - goto c02_03fa; + goto c01_03fa; -c02_041d:; +c01_041d:; -c02_0419:; +c01_0419:; i8 v5582 = (i8)(intptr_t)(ws+4104); i8 v5583 = *(i8*)(intptr_t)v5582; @@ -15986,22 +15986,22 @@ c02_0419:; i8 v5586 = (i8)(intptr_t)(ws+4169); *(i1*)(intptr_t)v5586 = v5585; -c02_041e:; +c01_041e:; i8 v5587 = (i8)(intptr_t)(ws+4169); i1 v5588 = *(i1*)(intptr_t)v5587; i1 v5589 = (i1)+0; - if (v5588==v5589) goto c02_0423; else goto c02_0422; + if (v5588==v5589) goto c01_0423; else goto c01_0422; -c02_0422:; +c01_0422:; i8 v5590 = (i8)(intptr_t)(ws+4169); i1 v5591 = *(i1*)(intptr_t)v5590; i1 v5592 = v5591&(+1); i1 v5593 = (i1)+0; - if (v5592==v5593) goto c02_0428; else goto c02_0427; + if (v5592==v5593) goto c01_0428; else goto c01_0427; -c02_0427:; +c01_0427:; i8 v5594 = (i8)(intptr_t)(ws+4152); i8 v5595 = *(i8*)(intptr_t)v5594; @@ -16009,9 +16009,9 @@ c02_0427:; i8 v5597 = (i8)(intptr_t)(ws+4152); *(i8*)(intptr_t)v5597 = v5596; -c02_0428:; +c01_0428:; -c02_0424:; +c01_0424:; i8 v5598 = (i8)(intptr_t)(ws+4169); i1 v5599 = *(i1*)(intptr_t)v5598; @@ -16020,9 +16020,9 @@ c02_0424:; i8 v5602 = (i8)(intptr_t)(ws+4169); *(i1*)(intptr_t)v5602 = v5601; - goto c02_041e; + goto c01_041e; -c02_0423:; +c01_0423:; i8 v5603 = (i8)(intptr_t)(ws+4104); i8 v5604 = *(i8*)(intptr_t)v5603; @@ -16031,22 +16031,22 @@ c02_0423:; i8 v5607 = (i8)(intptr_t)(ws+4169); *(i1*)(intptr_t)v5607 = v5606; -c02_0429:; +c01_0429:; i8 v5608 = (i8)(intptr_t)(ws+4169); i1 v5609 = *(i1*)(intptr_t)v5608; i1 v5610 = (i1)+0; - if (v5609==v5610) goto c02_042e; else goto c02_042d; + if (v5609==v5610) goto c01_042e; else goto c01_042d; -c02_042d:; +c01_042d:; i8 v5611 = (i8)(intptr_t)(ws+4169); i1 v5612 = *(i1*)(intptr_t)v5611; i1 v5613 = v5612&(+1); i1 v5614 = (i1)+0; - if (v5613==v5614) goto c02_0433; else goto c02_0432; + if (v5613==v5614) goto c01_0433; else goto c01_0432; -c02_0432:; +c01_0432:; i8 v5615 = (i8)(intptr_t)(ws+4160); i8 v5616 = *(i8*)(intptr_t)v5615; @@ -16054,9 +16054,9 @@ c02_0432:; i8 v5618 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)v5618 = v5617; -c02_0433:; +c01_0433:; -c02_042f:; +c01_042f:; i8 v5619 = (i8)(intptr_t)(ws+4169); i1 v5620 = *(i1*)(intptr_t)v5619; @@ -16065,13 +16065,13 @@ c02_042f:; i8 v5623 = (i8)(intptr_t)(ws+4169); *(i1*)(intptr_t)v5623 = v5622; - goto c02_0429; + goto c01_0429; -c02_042e:; +c01_042e:; - goto c02_03f9; + goto c01_03f9; -c02_03fa:; +c01_03fa:; i8 v5624 = (i8)(intptr_t)(ws+4096); i1 v5625 = *(i1*)(intptr_t)v5624; @@ -16099,26 +16099,26 @@ c02_03fa:; *(i1*)(intptr_t)v5642 = v5639; - i8 v5728 = (i8)(intptr_t)(f391_CopyChildNodes); + i8 v5728 = (i8)(intptr_t)(f390_CopyChildNodes); ((void(*)(void))(intptr_t)v5728)(); } - void f387_InstructionMatcher(void); - void f383_IsSimpleValue(void); - void f384_SimpleValuesMatch(void); - void f31_MemCopy(void); - void f151_FindFirst(void); + void f386_InstructionMatcher(void); + void f382_IsSimpleValue(void); + void f383_SimpleValuesMatch(void); + void f30_MemCopy(void); + void f150_FindFirst(void); // FindPreferredRegister workspace at ws+4152 length ws+58 -void f392_FindPreferredRegister(void) { +void f391_FindPreferredRegister(void) { i8 v5735 = (i8)(intptr_t)(ws+4072); i8 v5736 = *(i8*)(intptr_t)v5735; *(i8*)(intptr_t)(ws+4216) = v5736; i8 v5737 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)(ws+4224) = v5737; - i8 v5738 = (i8)(intptr_t)(f383_IsSimpleValue); + i8 v5738 = (i8)(intptr_t)(f382_IsSimpleValue); ((void(*)(void))(intptr_t)v5738)(); @@ -16129,31 +16129,31 @@ void f392_FindPreferredRegister(void) { i8 v5741 = (i8)(intptr_t)(ws+4180); i1 v5742 = *(i1*)(intptr_t)v5741; i1 v5743 = (i1)+0; - if (v5742==v5743) goto c02_044d; else goto c02_044c; + if (v5742==v5743) goto c01_044d; else goto c01_044c; -c02_044c:; +c01_044c:; i8 v5744 = (i8)(intptr_t)(ws+3576); i8 v5745 = (i8)(intptr_t)(ws+4184); *(i8*)(intptr_t)v5745 = v5744; -c02_044e:; +c01_044e:; i8 v5746 = (i8)(intptr_t)(ws+4184); i8 v5747 = *(i8*)(intptr_t)v5746; i8 v5748 = (i8)(intptr_t)(ws+3696); - if (v5747==v5748) goto c02_0453; else goto c02_0452; + if (v5747==v5748) goto c01_0453; else goto c01_0452; -c02_0452:; +c01_0452:; i8 v5749 = (i8)(intptr_t)(ws+4184); i8 v5750 = *(i8*)(intptr_t)v5749; i8 v5751 = v5750+(+18); i1 v5752 = *(i1*)(intptr_t)v5751; i1 v5753 = (i1)+0; - if (v5752==v5753) goto c02_0458; else goto c02_0457; + if (v5752==v5753) goto c01_0458; else goto c01_0457; -c02_0457:; +c01_0457:; i8 v5754 = (i8)(intptr_t)(ws+4184); i8 v5755 = *(i8*)(intptr_t)v5754; @@ -16165,9 +16165,9 @@ c02_0457:; i8 v5761 = v5760+(+18); *(i1*)(intptr_t)v5761 = v5758; -c02_0458:; +c01_0458:; -c02_0454:; +c01_0454:; i8 v5762 = (i8)(intptr_t)(ws+4184); i8 v5763 = *(i8*)(intptr_t)v5762; @@ -16175,9 +16175,9 @@ c02_0454:; i8 v5765 = (i8)(intptr_t)(ws+4184); *(i8*)(intptr_t)v5765 = v5764; - goto c02_044e; + goto c01_044e; -c02_0453:; +c01_0453:; i8 v5766 = (i8)(intptr_t)(ws+3576); i8 v5767 = (i8)(intptr_t)(ws+4184); @@ -16187,21 +16187,21 @@ c02_0453:; i8 v5769 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v5769 = v5768; -c02_0459:; +c01_0459:; i8 v5770 = (i8)(intptr_t)(ws+4184); i8 v5771 = *(i8*)(intptr_t)v5770; i8 v5772 = (i8)(intptr_t)(ws+3696); - if (v5771==v5772) goto c02_045e; else goto c02_045d; + if (v5771==v5772) goto c01_045e; else goto c01_045d; -c02_045d:; +c01_045d:; i8 v5773 = (i8)(intptr_t)(ws+4160); *(i8*)(intptr_t)(ws+4216) = v5773; i8 v5774 = (i8)(intptr_t)(ws+4184); i8 v5775 = *(i8*)(intptr_t)v5774; *(i8*)(intptr_t)(ws+4224) = v5775; - i8 v5776 = (i8)(intptr_t)(f384_SimpleValuesMatch); + i8 v5776 = (i8)(intptr_t)(f383_SimpleValuesMatch); ((void(*)(void))(intptr_t)v5776)(); @@ -16214,9 +16214,9 @@ c02_045d:; i8 v5781 = v5780+(+19); i1 v5782 = *(i1*)(intptr_t)v5781; i1 v5783 = (i1)+0; - if (v5782==v5783) goto c02_0467; else goto c02_0469; + if (v5782==v5783) goto c01_0467; else goto c01_0469; -c02_0469:; +c01_0469:; i8 v5784 = (i8)(intptr_t)(ws+4153); i1 v5785 = *(i1*)(intptr_t)v5784; @@ -16224,16 +16224,16 @@ c02_0469:; i1 v5787 = *(i1*)(intptr_t)v5786; i1 v5788 = v5785&v5787; i1 v5789 = (i1)+0; - if (v5788==v5789) goto c02_0467; else goto c02_0468; + if (v5788==v5789) goto c01_0467; else goto c01_0468; -c02_0468:; +c01_0468:; i8 v5790 = (i8)(intptr_t)(ws+4192); i1 v5791 = *(i1*)(intptr_t)v5790; i1 v5792 = (i1)+0; - if (v5791==v5792) goto c02_0467; else goto c02_0466; + if (v5791==v5792) goto c01_0467; else goto c01_0466; -c02_0466:; +c01_0466:; i1 v5793 = (i1)+255; i8 v5794 = (i8)(intptr_t)(ws+4184); @@ -16243,9 +16243,9 @@ c02_0466:; return; -c02_0467:; +c01_0467:; -c02_045f:; +c01_045f:; i8 v5797 = (i8)(intptr_t)(ws+4184); i8 v5798 = *(i8*)(intptr_t)v5797; @@ -16260,9 +16260,9 @@ c02_045f:; i8 v5805 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v5805 = v5804; - goto c02_0459; + goto c01_0459; -c02_045e:; +c01_045e:; i8 v5806 = (i8)+0; i8 v5807 = (i8)(intptr_t)(ws+4200); @@ -16276,14 +16276,14 @@ c02_045e:; i8 v5811 = (i8)(intptr_t)(ws+4153); *(i1*)(intptr_t)v5811 = v5810; -c02_046a:; +c01_046a:; i8 v5812 = (i8)(intptr_t)(ws+4184); i8 v5813 = *(i8*)(intptr_t)v5812; i8 v5814 = (i8)(intptr_t)(ws+3696); - if (v5813==v5814) goto c02_046f; else goto c02_046e; + if (v5813==v5814) goto c01_046f; else goto c01_046e; -c02_046e:; +c01_046e:; i8 v5815 = (i8)(intptr_t)(ws+4153); i1 v5816 = *(i1*)(intptr_t)v5815; @@ -16291,18 +16291,18 @@ c02_046e:; i1 v5818 = *(i1*)(intptr_t)v5817; i1 v5819 = v5816&v5818; i1 v5820 = (i1)+0; - if (v5819==v5820) goto c02_0474; else goto c02_0473; + if (v5819==v5820) goto c01_0474; else goto c01_0473; -c02_0473:; +c01_0473:; i8 v5821 = (i8)(intptr_t)(ws+4184); i8 v5822 = *(i8*)(intptr_t)v5821; i8 v5823 = v5822+(+19); i1 v5824 = *(i1*)(intptr_t)v5823; i1 v5825 = (i1)+0; - if (v5824==v5825) goto c02_0478; else goto c02_0479; + if (v5824==v5825) goto c01_0478; else goto c01_0479; -c02_0478:; +c01_0478:; i8 v5826 = (i8)(intptr_t)(ws+4184); i8 v5827 = *(i8*)(intptr_t)v5826; @@ -16314,18 +16314,18 @@ c02_0478:; i8 v5831 = (i8)(intptr_t)(ws+4208); *(i1*)(intptr_t)v5831 = v5830; - goto c02_046f; + goto c01_046f; -c02_0479:; +c01_0479:; -c02_0475:; +c01_0475:; i8 v5832 = (i8)(intptr_t)(ws+4200); i8 v5833 = *(i8*)(intptr_t)v5832; i8 v5834 = (i8)+0; - if (v5833==v5834) goto c02_047d; else goto c02_047e; + if (v5833==v5834) goto c01_047d; else goto c01_047e; -c02_047d:; +c01_047d:; i8 v5835 = (i8)(intptr_t)(ws+4184); i8 v5836 = *(i8*)(intptr_t)v5835; @@ -16337,9 +16337,9 @@ c02_047d:; i8 v5840 = (i8)(intptr_t)(ws+4208); *(i1*)(intptr_t)v5840 = v5839; - goto c02_047a; + goto c01_047a; -c02_047e:; +c01_047e:; i8 v5841 = (i8)(intptr_t)(ws+4184); i8 v5842 = *(i8*)(intptr_t)v5841; @@ -16349,9 +16349,9 @@ c02_047e:; i8 v5846 = *(i8*)(intptr_t)v5845; i8 v5847 = v5846+(+18); i1 v5848 = *(i1*)(intptr_t)v5847; - if (v5844>v7469; i2 v7471 = v7470; *(i2*)(intptr_t)(ws+3992) = v7471; - i8 v7472 = (i8)(intptr_t)(f17_print_i16); + i8 v7472 = (i8)(intptr_t)(f16_print_i16); ((void(*)(void))(intptr_t)v7472)(); - i8 v7473 = (i8)(intptr_t)c02_s01da; + i8 v7473 = (i8)(intptr_t)c01_s01da; *(i8*)(intptr_t)(ws+4288) = v7473; - i8 v7474 = (i8)(intptr_t)(f12_print); + i8 v7474 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v7474)(); } -const i1 c02_s01db[] = { 0x73,0x79,0x6e,0x74,0x61,0x78,0x20,0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x63,0x6f,0x77,0x62,0x65,0x20,0x5b,0x2d,0x49,0x70,0x61,0x74,0x68,0x5d,0x20,0x3c,0x69,0x6e,0x66,0x69,0x6c,0x65,0x3e,0x20,0x3c,0x6f,0x75,0x74,0x66,0x69,0x6c,0x65,0x3e,0x0a,0 }; - void f12_print(void); - void f6_ExitWithError(void); +const i1 c01_s01db[] = { 0x73,0x79,0x6e,0x74,0x61,0x78,0x20,0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x63,0x6f,0x77,0x62,0x65,0x20,0x5b,0x2d,0x49,0x70,0x61,0x74,0x68,0x5d,0x20,0x3c,0x69,0x6e,0x66,0x69,0x6c,0x65,0x3e,0x20,0x3c,0x6f,0x75,0x74,0x66,0x69,0x6c,0x65,0x3e,0x0a,0 }; + void f11_print(void); + void f5_ExitWithError(void); // SyntaxError workspace at ws+4008 length ws+0 -void f412_SyntaxError(void) { +void f411_SyntaxError(void) { - i8 v7475 = (i8)(intptr_t)c02_s01db; + i8 v7475 = (i8)(intptr_t)c01_s01db; *(i8*)(intptr_t)(ws+4288) = v7475; - i8 v7476 = (i8)(intptr_t)(f12_print); + i8 v7476 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v7476)(); - i8 v7477 = (i8)(intptr_t)(f6_ExitWithError); + i8 v7477 = (i8)(intptr_t)(f5_ExitWithError); ((void(*)(void))(intptr_t)v7477)(); } - void f24_ArgvInit(void); - void f25_ArgvNext(void); - void f25_ArgvNext(void); - void f25_ArgvNext(void); - void f412_SyntaxError(void); + void f23_ArgvInit(void); + void f24_ArgvNext(void); + void f24_ArgvNext(void); + void f24_ArgvNext(void); + void f411_SyntaxError(void); // ParseArguments workspace at ws+3984 length ws+24 -void f413_ParseArguments(void) { +void f412_ParseArguments(void) { - i8 v7478 = (i8)(intptr_t)(f24_ArgvInit); + i8 v7478 = (i8)(intptr_t)(f23_ArgvInit); ((void(*)(void))(intptr_t)v7478)(); - i8 v7479 = (i8)(intptr_t)(f25_ArgvNext); + i8 v7479 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v7479)(); @@ -19730,7 +19730,7 @@ void f413_ParseArguments(void) { i8 v7484 = (i8)(intptr_t)(ws+24); *(i8*)(intptr_t)v7484 = v7483; - i8 v7485 = (i8)(intptr_t)(f25_ArgvNext); + i8 v7485 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v7485)(); @@ -19743,7 +19743,7 @@ void f413_ParseArguments(void) { i8 v7490 = (i8)(intptr_t)(ws+32); *(i8*)(intptr_t)v7490 = v7489; - i8 v7491 = (i8)(intptr_t)(f25_ArgvNext); + i8 v7491 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v7491)(); @@ -19754,48 +19754,48 @@ void f413_ParseArguments(void) { i8 v7494 = (i8)(intptr_t)(ws+4000); i8 v7495 = *(i8*)(intptr_t)v7494; i8 v7496 = (i8)+0; - if (v7495==v7496) goto c02_0571; else goto c02_056e; + if (v7495==v7496) goto c01_0571; else goto c01_056e; -c02_0571:; +c01_0571:; i8 v7497 = (i8)(intptr_t)(ws+24); i8 v7498 = *(i8*)(intptr_t)v7497; i8 v7499 = (i8)+0; - if (v7498==v7499) goto c02_056e; else goto c02_0570; + if (v7498==v7499) goto c01_056e; else goto c01_0570; -c02_0570:; +c01_0570:; i8 v7500 = (i8)(intptr_t)(ws+32); i8 v7501 = *(i8*)(intptr_t)v7500; i8 v7502 = (i8)+0; - if (v7501==v7502) goto c02_056e; else goto c02_056f; + if (v7501==v7502) goto c01_056e; else goto c01_056f; -c02_056e:; +c01_056e:; - i8 v7503 = (i8)(intptr_t)(f412_SyntaxError); + i8 v7503 = (i8)(intptr_t)(f411_SyntaxError); ((void(*)(void))(intptr_t)v7503)(); -c02_056f:; +c01_056f:; -c02_0567:; +c01_0567:; } -const i1 c02_s01dc[] = { 0x43,0x4f,0x57,0x42,0x45,0x3a,0x20,0 }; - void f12_print(void); - void f411_PrintFreeMemory(void); - void f413_ParseArguments(void); - void f120_InputterOpenfile(void); - void f108_EmitterOpenfile(void); - void f410_ProcessFile(void); - void f109_EmitterClosefile(void); - void f121_InputterClosefile(void); -const i1 c02_s01dd[] = { 0x64,0x6f,0x6e,0x65,0x3a,0x20,0 }; - void f12_print(void); - void f411_PrintFreeMemory(void); +const i1 c01_s01dc[] = { 0x43,0x4f,0x57,0x42,0x45,0x3a,0x20,0 }; + void f11_print(void); + void f410_PrintFreeMemory(void); + void f412_ParseArguments(void); + void f119_InputterOpenfile(void); + void f107_EmitterOpenfile(void); + void f409_ProcessFile(void); + void f108_EmitterClosefile(void); + void f120_InputterClosefile(void); +const i1 c01_s01dd[] = { 0x64,0x6f,0x6e,0x65,0x3a,0x20,0 }; + void f11_print(void); + void f410_PrintFreeMemory(void); // __main workspace at ws+0 length ws+3984 -void f3___main(void) { +void f2___main(void) { @@ -19988,7 +19988,7 @@ void f3___main(void) { *(i8*)(intptr_t)(ws+4176) = v2303; i8 v2304 = (i8)+116; *(i8*)(intptr_t)(ws+4184) = v2304; - i8 v2305 = (i8)(intptr_t)(f23_MemZero); + i8 v2305 = (i8)(intptr_t)(f22_MemZero); ((void(*)(void))(intptr_t)v2305)(); @@ -19996,7 +19996,7 @@ void f3___main(void) { *(i8*)(intptr_t)(ws+4176) = v2306; i8 v2307 = (i8)+116; *(i8*)(intptr_t)(ws+4184) = v2307; - i8 v2308 = (i8)(intptr_t)(f23_MemZero); + i8 v2308 = (i8)(intptr_t)(f22_MemZero); ((void(*)(void))(intptr_t)v2308)(); @@ -20107,57 +20107,57 @@ void f3___main(void) { - i8 v7504 = (i8)(intptr_t)c02_s01dc; + i8 v7504 = (i8)(intptr_t)c01_s01dc; *(i8*)(intptr_t)(ws+4288) = v7504; - i8 v7505 = (i8)(intptr_t)(f12_print); + i8 v7505 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v7505)(); - i8 v7506 = (i8)(intptr_t)(f411_PrintFreeMemory); + i8 v7506 = (i8)(intptr_t)(f410_PrintFreeMemory); ((void(*)(void))(intptr_t)v7506)(); - i8 v7507 = (i8)(intptr_t)(f413_ParseArguments); + i8 v7507 = (i8)(intptr_t)(f412_ParseArguments); ((void(*)(void))(intptr_t)v7507)(); i8 v7508 = (i8)(intptr_t)(ws+24); i8 v7509 = *(i8*)(intptr_t)v7508; *(i8*)(intptr_t)(ws+3984) = v7509; - i8 v7510 = (i8)(intptr_t)(f120_InputterOpenfile); + i8 v7510 = (i8)(intptr_t)(f119_InputterOpenfile); ((void(*)(void))(intptr_t)v7510)(); i8 v7511 = (i8)(intptr_t)(ws+32); i8 v7512 = *(i8*)(intptr_t)v7511; *(i8*)(intptr_t)(ws+3984) = v7512; - i8 v7513 = (i8)(intptr_t)(f108_EmitterOpenfile); + i8 v7513 = (i8)(intptr_t)(f107_EmitterOpenfile); ((void(*)(void))(intptr_t)v7513)(); - i8 v7514 = (i8)(intptr_t)(f410_ProcessFile); + i8 v7514 = (i8)(intptr_t)(f409_ProcessFile); ((void(*)(void))(intptr_t)v7514)(); - i8 v7515 = (i8)(intptr_t)(f109_EmitterClosefile); + i8 v7515 = (i8)(intptr_t)(f108_EmitterClosefile); ((void(*)(void))(intptr_t)v7515)(); - i8 v7516 = (i8)(intptr_t)(f121_InputterClosefile); + i8 v7516 = (i8)(intptr_t)(f120_InputterClosefile); ((void(*)(void))(intptr_t)v7516)(); - i8 v7517 = (i8)(intptr_t)c02_s01dd; + i8 v7517 = (i8)(intptr_t)c01_s01dd; *(i8*)(intptr_t)(ws+4288) = v7517; - i8 v7518 = (i8)(intptr_t)(f12_print); + i8 v7518 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v7518)(); - i8 v7519 = (i8)(intptr_t)(f411_PrintFreeMemory); + i8 v7519 = (i8)(intptr_t)(f410_PrintFreeMemory); ((void(*)(void))(intptr_t)v7519)(); } void cmain(void) { - f3___main(); + f2___main(); } diff --git a/bootstrap/cowfe-cgen.bootstrap.c b/bootstrap/cowfe-cgen.bootstrap.c index e8ec7848..05a45bda 100644 --- a/bootstrap/cowfe-cgen.bootstrap.c +++ b/bootstrap/cowfe-cgen.bootstrap.c @@ -3,7 +3,7 @@ static i8 workspace[0x01d5]; #define ws ((i1*)workspace) // ExitWithError workspace at ws+3672 length ws+0 -void f6_ExitWithError(void) { +void f5_ExitWithError(void) { @@ -14,7 +14,7 @@ exit(1); } // MemSet workspace at ws+3640 length ws+24 -void f7_MemSet(void) { +void f6_MemSet(void) { @@ -31,7 +31,7 @@ memset((void*)(intptr_t) } // print_char workspace at ws+3712 length ws+1 -void f9_print_char(void) { +void f8_print_char(void) { @@ -42,12 +42,12 @@ putchar( } - void f9_print_char(void); + void f8_print_char(void); // print workspace at ws+3696 length ws+9 -void f12_print(void) { +void f11_print(void) { -c02_0001:; +c01_0001:; i8 v6 = (i8)(intptr_t)(ws+3696); i8 v7 = *(i8*)(intptr_t)v6; @@ -58,20 +58,20 @@ c02_0001:; i8 v10 = (i8)(intptr_t)(ws+3704); i1 v11 = *(i1*)(intptr_t)v10; i1 v12 = (i1)+0; - if (v11==v12) goto c02_0006; else goto c02_0007; + if (v11==v12) goto c01_0006; else goto c01_0007; -c02_0006:; +c01_0006:; return; -c02_0007:; +c01_0007:; -c02_0003:; +c01_0003:; i8 v13 = (i8)(intptr_t)(ws+3704); i1 v14 = *(i1*)(intptr_t)v13; *(i1*)(intptr_t)(ws+3712) = v14; - i8 v15 = (i8)(intptr_t)(f9_print_char); + i8 v15 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v15)(); @@ -81,33 +81,33 @@ c02_0003:; i8 v19 = (i8)(intptr_t)(ws+3696); *(i8*)(intptr_t)v19 = v18; - goto c02_0001; + goto c01_0001; -c02_0002:; +c01_0002:; } - void f9_print_char(void); + void f8_print_char(void); // print_nl workspace at ws+3656 length ws+0 -void f13_print_nl(void) { +void f12_print_nl(void) { i1 v20 = (i1)+10; *(i1*)(intptr_t)(ws+3712) = v20; - i8 v21 = (i8)(intptr_t)(f9_print_char); + i8 v21 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v21)(); } // UIToA workspace at ws+3696 length ws+49 -void f14_UIToA(void) { +void f13_UIToA(void) { i8 v22 = (i8)(intptr_t)(ws+3704); i8 v23 = *(i8*)(intptr_t)v22; i8 v24 = (i8)(intptr_t)(ws+3712); *(i8*)(intptr_t)v24 = v23; -c02_0008:; +c01_0008:; i8 v25 = (i8)(intptr_t)(ws+3696); i4 v26 = *(i4*)(intptr_t)v25; @@ -130,9 +130,9 @@ c02_0008:; i8 v39 = (i8)(intptr_t)(ws+3720); i4 v40 = *(i4*)(intptr_t)v39; i4 v41 = (i4)+10; - if (v40>v147; - i8 v149 = (i8)(intptr_t)(ws+3490); + i8 v149 = (i8)(intptr_t)(ws+3290); *(i1*)(intptr_t)v149 = v148; - i8 v150 = (i8)(intptr_t)(ws+3490); + i8 v150 = (i8)(intptr_t)(ws+3290); i1 v151 = *(i1*)(intptr_t)v150; i1 v152 = (i1)+10; - if (v151>v188; - i1 v190 = v189; - *(i1*)(intptr_t)(ws+3488) = v190; - i8 v191 = (i8)(intptr_t)(f19_print_hex_i8); - - ((void(*)(void))(intptr_t)v191)(); - - i8 v192 = (i8)(intptr_t)(ws+3480); - i4 v193 = *(i4*)(intptr_t)v192; - i1 v194 = (i1)+16; - i4 v195 = ((i4)v193)>>v194; - i1 v196 = v195; - *(i1*)(intptr_t)(ws+3488) = v196; - i8 v197 = (i8)(intptr_t)(f19_print_hex_i8); - - ((void(*)(void))(intptr_t)v197)(); - - i8 v198 = (i8)(intptr_t)(ws+3480); - i4 v199 = *(i4*)(intptr_t)v198; - i1 v200 = (i1)+8; - i4 v201 = ((i4)v199)>>v200; - i1 v202 = v201; - *(i1*)(intptr_t)(ws+3488) = v202; - i8 v203 = (i8)(intptr_t)(f19_print_hex_i8); - - ((void(*)(void))(intptr_t)v203)(); - - i8 v204 = (i8)(intptr_t)(ws+3480); - i4 v205 = *(i4*)(intptr_t)v204; - i1 v206 = v205; - *(i1*)(intptr_t)(ws+3488) = v206; - i8 v207 = (i8)(intptr_t)(f19_print_hex_i8); - - ((void(*)(void))(intptr_t)v207)(); +c01_0020:; } // ArgvInit workspace at ws+3280 length ws+0 -void f24_ArgvInit(void) { +void f23_ArgvInit(void) { @@ -453,14 +406,14 @@ void f24_ArgvInit(void) { } // ArgvNext workspace at ws+3280 length ws+8 -void f25_ArgvNext(void) { +void f24_ArgvNext(void) { i8 v319 = (i8)(intptr_t)(ws+16); i8 v320 = *(i8*)(intptr_t)v319; i8 v321 = (i8)+0; - if (v320==v321) goto c02_0052; else goto c02_0053; + if (v320==v321) goto c01_0052; else goto c01_0053; -c02_0052:; +c01_0052:; i8 v322 = (i8)+0; i8 v323 = (i8)(intptr_t)(ws+3280); @@ -468,9 +421,9 @@ c02_0052:; return; -c02_0053:; +c01_0053:; -c02_004f:; +c01_004f:; i8 v324 = (i8)(intptr_t)(ws+16); i8 v325 = *(i8*)(intptr_t)v324; @@ -481,17 +434,17 @@ c02_004f:; i8 v328 = (i8)(intptr_t)(ws+3280); i8 v329 = *(i8*)(intptr_t)v328; i8 v330 = (i8)+0; - if (v329==v330) goto c02_0057; else goto c02_0058; + if (v329==v330) goto c01_0057; else goto c01_0058; -c02_0057:; +c01_0057:; i8 v331 = (i8)+0; i8 v332 = (i8)(intptr_t)(ws+16); *(i8*)(intptr_t)v332 = v331; - goto c02_0054; + goto c01_0054; -c02_0058:; +c01_0058:; i8 v333 = (i8)(intptr_t)(ws+16); i8 v334 = *(i8*)(intptr_t)v333; @@ -499,14 +452,14 @@ c02_0058:; i8 v336 = (i8)(intptr_t)(ws+16); *(i8*)(intptr_t)v336 = v335; -c02_0054:; +c01_0054:; } // StrCmp workspace at ws+3560 length ws+17 -void f26_StrCmp(void) { +void f25_StrCmp(void) { -c02_0059:; +c01_0059:; i8 v337 = (i8)(intptr_t)(ws+3560); i8 v338 = *(i8*)(intptr_t)v337; @@ -521,23 +474,23 @@ c02_0059:; i8 v345 = (i8)(intptr_t)(ws+3576); i1 v346 = *(i1*)(intptr_t)v345; i1 v347 = (i1)+0; - if (v346==v347) goto c02_0062; else goto c02_0060; + if (v346==v347) goto c01_0062; else goto c01_0060; -c02_0062:; +c01_0062:; i8 v348 = (i8)(intptr_t)(ws+3560); i8 v349 = *(i8*)(intptr_t)v348; i1 v350 = *(i1*)(intptr_t)v349; i1 v351 = (i1)+0; - if (v350==v351) goto c02_0060; else goto c02_0061; + if (v350==v351) goto c01_0060; else goto c01_0061; -c02_0060:; +c01_0060:; - goto c02_005a; + goto c01_005a; -c02_0061:; +c01_0061:; -c02_005b:; +c01_005b:; i8 v352 = (i8)(intptr_t)(ws+3560); i8 v353 = *(i8*)(intptr_t)v352; @@ -551,28 +504,28 @@ c02_005b:; i8 v359 = (i8)(intptr_t)(ws+3568); *(i8*)(intptr_t)v359 = v358; - goto c02_0059; + goto c01_0059; -c02_005a:; +c01_005a:; } // ToLower workspace at ws+3312 length ws+2 -void f27_ToLower(void) { +void f26_ToLower(void) { i8 v360 = (i8)(intptr_t)(ws+3312); i1 v361 = *(i1*)(intptr_t)v360; i1 v362 = (i1)+65; - if (v361>v3900; i1 v3902 = v3901; *(i1*)(intptr_t)(ws+3600) = v3902; - i8 v3903 = (i8)(intptr_t)(f174_E_b8); + i8 v3903 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v3903)(); } - void f175_E_b16(void); - void f175_E_b16(void); + void f174_E_b16(void); + void f174_E_b16(void); // E_b32 workspace at ws+3568 length ws+4 -void f176_E_b32(void) { +void f175_E_b32(void) { i8 v3904 = (i8)(intptr_t)(ws+3568); i4 v3905 = *(i4*)(intptr_t)v3904; i2 v3906 = v3905; *(i2*)(intptr_t)(ws+3576) = v3906; - i8 v3907 = (i8)(intptr_t)(f175_E_b16); + i8 v3907 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v3907)(); @@ -7966,30 +7923,30 @@ void f176_E_b32(void) { i4 v3911 = ((i4)v3909)>>v3910; i2 v3912 = v3911; *(i2*)(intptr_t)(ws+3576) = v3912; - i8 v3913 = (i8)(intptr_t)(f175_E_b16); + i8 v3913 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v3913)(); } - void f175_E_b16(void); + void f174_E_b16(void); // E_bsize workspace at ws+3568 length ws+2 -void f177_E_bsize(void) { +void f176_E_bsize(void) { i8 v3914 = (i8)(intptr_t)(ws+3568); i2 v3915 = *(i2*)(intptr_t)v3914; *(i2*)(intptr_t)(ws+3576) = v3915; - i8 v3916 = (i8)(intptr_t)(f175_E_b16); + i8 v3916 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v3916)(); } - void f174_E_b8(void); + void f173_E_b8(void); // E workspace at ws+3584 length ws+9 -void f184_E(void) { +void f183_E(void) { -c02_02f5:; +c01_02f5:; i8 v3929 = (i8)(intptr_t)(ws+3584); i8 v3930 = *(i8*)(intptr_t)v3929; @@ -8006,39 +7963,39 @@ c02_02f5:; i8 v3937 = (i8)(intptr_t)(ws+3592); i1 v3938 = *(i1*)(intptr_t)v3937; i1 v3939 = (i1)+0; - if (v3938==v3939) goto c02_02fa; else goto c02_02fb; + if (v3938==v3939) goto c01_02fa; else goto c01_02fb; -c02_02fa:; +c01_02fa:; - goto c02_02f6; + goto c01_02f6; -c02_02fb:; +c01_02fb:; -c02_02f7:; +c01_02f7:; i8 v3940 = (i8)(intptr_t)(ws+3592); i1 v3941 = *(i1*)(intptr_t)v3940; *(i1*)(intptr_t)(ws+3600) = v3941; - i8 v3942 = (i8)(intptr_t)(f174_E_b8); + i8 v3942 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v3942)(); - goto c02_02f5; + goto c01_02f5; -c02_02f6:; +c01_02f6:; } - void f29_StrLen(void); - void f174_E_b8(void); - void f184_E(void); + void f28_StrLen(void); + void f173_E_b8(void); + void f183_E(void); // E_countedstring workspace at ws+3568 length ws+16 -void f185_E_countedstring(void) { +void f184_E_countedstring(void) { i8 v3943 = (i8)(intptr_t)(ws+3568); i8 v3944 = *(i8*)(intptr_t)v3943; *(i8*)(intptr_t)(ws+3584) = v3944; - i8 v3945 = (i8)(intptr_t)(f29_StrLen); + i8 v3945 = (i8)(intptr_t)(f28_StrLen); ((void(*)(void))(intptr_t)v3945)(); @@ -8050,31 +8007,31 @@ void f185_E_countedstring(void) { i8 v3949 = *(i8*)(intptr_t)v3948; i1 v3950 = v3949; *(i1*)(intptr_t)(ws+3600) = v3950; - i8 v3951 = (i8)(intptr_t)(f174_E_b8); + i8 v3951 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v3951)(); i8 v3952 = (i8)(intptr_t)(ws+3568); i8 v3953 = *(i8*)(intptr_t)v3952; *(i8*)(intptr_t)(ws+3584) = v3953; - i8 v3954 = (i8)(intptr_t)(f184_E); + i8 v3954 = (i8)(intptr_t)(f183_E); ((void(*)(void))(intptr_t)v3954)(); } - void f54_FCBOpenOut(void); -const i1 c02_s00f3[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,0x70,0x65,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; - void f76_SimpleError(void); + void f53_FCBOpenOut(void); +const i1 c01_s00f4[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,0x70,0x65,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; + void f75_SimpleError(void); // EmitterOpenfile workspace at ws+3264 length ws+9 -void f196_EmitterOpenfile(void) { +void f195_EmitterOpenfile(void) { i8 v4076 = (i8)(intptr_t)(ws+936); *(i8*)(intptr_t)(ws+3280) = v4076; i8 v4077 = (i8)(intptr_t)(ws+3264); i8 v4078 = *(i8*)(intptr_t)v4077; *(i8*)(intptr_t)(ws+3288) = v4078; - i8 v4079 = (i8)(intptr_t)(f54_FCBOpenOut); + i8 v4079 = (i8)(intptr_t)(f53_FCBOpenOut); ((void(*)(void))(intptr_t)v4079)(); @@ -8085,38 +8042,38 @@ void f196_EmitterOpenfile(void) { i8 v4082 = (i8)(intptr_t)(ws+3272); i1 v4083 = *(i1*)(intptr_t)v4082; i1 v4084 = (i1)+0; - if (v4083==v4084) goto c02_031c; else goto c02_031b; + if (v4083==v4084) goto c01_031c; else goto c01_031b; -c02_031b:; +c01_031b:; - i8 v4085 = (i8)(intptr_t)c02_s00f3; + i8 v4085 = (i8)(intptr_t)c01_s00f4; *(i8*)(intptr_t)(ws+3648) = v4085; - i8 v4086 = (i8)(intptr_t)(f76_SimpleError); + i8 v4086 = (i8)(intptr_t)(f75_SimpleError); ((void(*)(void))(intptr_t)v4086)(); -c02_031c:; +c01_031c:; -c02_0318:; +c01_0318:; } - void f174_E_b8(void); - void f55_FCBClose(void); -const i1 c02_s00f4[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; - void f76_SimpleError(void); + void f173_E_b8(void); + void f54_FCBClose(void); +const i1 c01_s00f5[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; + void f75_SimpleError(void); // EmitterClosefile workspace at ws+3264 length ws+1 -void f197_EmitterClosefile(void) { +void f196_EmitterClosefile(void) { i1 v4087 = (i1)+69; *(i1*)(intptr_t)(ws+3600) = v4087; - i8 v4088 = (i8)(intptr_t)(f174_E_b8); + i8 v4088 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4088)(); i8 v4089 = (i8)(intptr_t)(ws+936); *(i8*)(intptr_t)(ws+3384) = v4089; - i8 v4090 = (i8)(intptr_t)(f55_FCBClose); + i8 v4090 = (i8)(intptr_t)(f54_FCBClose); ((void(*)(void))(intptr_t)v4090)(); @@ -8127,31 +8084,31 @@ void f197_EmitterClosefile(void) { i8 v4093 = (i8)(intptr_t)(ws+3264); i1 v4094 = *(i1*)(intptr_t)v4093; i1 v4095 = (i1)+0; - if (v4094==v4095) goto c02_0321; else goto c02_0320; + if (v4094==v4095) goto c01_0321; else goto c01_0320; -c02_0320:; +c01_0320:; - i8 v4096 = (i8)(intptr_t)c02_s00f4; + i8 v4096 = (i8)(intptr_t)c01_s00f5; *(i8*)(intptr_t)(ws+3648) = v4096; - i8 v4097 = (i8)(intptr_t)(f76_SimpleError); + i8 v4097 = (i8)(intptr_t)(f75_SimpleError); ((void(*)(void))(intptr_t)v4097)(); -c02_0321:; +c01_0321:; -c02_031d:; +c01_031d:; } - void f174_E_b8(void); - void f175_E_b16(void); - void f185_E_countedstring(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f184_E_countedstring(void); // EmitterDeclareSubroutine workspace at ws+3416 length ws+8 -void f198_EmitterDeclareSubroutine(void) { +void f197_EmitterDeclareSubroutine(void) { i1 v4098 = (i1)+78; *(i1*)(intptr_t)(ws+3600) = v4098; - i8 v4099 = (i8)(intptr_t)(f174_E_b8); + i8 v4099 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4099)(); @@ -8160,7 +8117,7 @@ void f198_EmitterDeclareSubroutine(void) { i8 v4102 = v4101+(+56); i2 v4103 = *(i2*)(intptr_t)v4102; *(i2*)(intptr_t)(ws+3576) = v4103; - i8 v4104 = (i8)(intptr_t)(f175_E_b16); + i8 v4104 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4104)(); @@ -8170,71 +8127,71 @@ void f198_EmitterDeclareSubroutine(void) { i8 v4108 = v4107+(+8); i8 v4109 = *(i8*)(intptr_t)v4108; *(i8*)(intptr_t)(ws+3568) = v4109; - i8 v4110 = (i8)(intptr_t)(f185_E_countedstring); + i8 v4110 = (i8)(intptr_t)(f184_E_countedstring); ((void(*)(void))(intptr_t)v4110)(); } - void f174_E_b8(void); - void f175_E_b16(void); - void f185_E_countedstring(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f184_E_countedstring(void); // EmitterDeclareExternalSubroutine workspace at ws+3384 length ws+16 -void f199_EmitterDeclareExternalSubroutine(void) { +void f198_EmitterDeclareExternalSubroutine(void) { i1 v4111 = (i1)+88; *(i1*)(intptr_t)(ws+3600) = v4111; - i8 v4112 = (i8)(intptr_t)(f174_E_b8); + i8 v4112 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4112)(); i8 v4113 = (i8)(intptr_t)(ws+3384); i2 v4114 = *(i2*)(intptr_t)v4113; *(i2*)(intptr_t)(ws+3576) = v4114; - i8 v4115 = (i8)(intptr_t)(f175_E_b16); + i8 v4115 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4115)(); i8 v4116 = (i8)(intptr_t)(ws+3392); i8 v4117 = *(i8*)(intptr_t)v4116; *(i8*)(intptr_t)(ws+3568) = v4117; - i8 v4118 = (i8)(intptr_t)(f185_E_countedstring); + i8 v4118 = (i8)(intptr_t)(f184_E_countedstring); ((void(*)(void))(intptr_t)v4118)(); } - void f174_E_b8(void); - void f175_E_b16(void); - void f175_E_b16(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f174_E_b16(void); // EmitterReferenceSubroutineById workspace at ws+3512 length ws+4 -void f200_EmitterReferenceSubroutineById(void) { +void f199_EmitterReferenceSubroutineById(void) { i1 v4119 = (i1)+82; *(i1*)(intptr_t)(ws+3600) = v4119; - i8 v4120 = (i8)(intptr_t)(f174_E_b8); + i8 v4120 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4120)(); i8 v4121 = (i8)(intptr_t)(ws+3512); i2 v4122 = *(i2*)(intptr_t)v4121; *(i2*)(intptr_t)(ws+3576) = v4122; - i8 v4123 = (i8)(intptr_t)(f175_E_b16); + i8 v4123 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4123)(); i8 v4124 = (i8)(intptr_t)(ws+3514); i2 v4125 = *(i2*)(intptr_t)v4124; *(i2*)(intptr_t)(ws+3576) = v4125; - i8 v4126 = (i8)(intptr_t)(f175_E_b16); + i8 v4126 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4126)(); } - void f200_EmitterReferenceSubroutineById(void); + void f199_EmitterReferenceSubroutineById(void); // EmitterReferenceSubroutine workspace at ws+3496 length ws+16 -void f201_EmitterReferenceSubroutine(void) { +void f200_EmitterReferenceSubroutine(void) { i8 v4127 = (i8)(intptr_t)(ws+3496); i8 v4128 = *(i8*)(intptr_t)v4127; @@ -8246,22 +8203,22 @@ void f201_EmitterReferenceSubroutine(void) { i8 v4133 = v4132+(+56); i2 v4134 = *(i2*)(intptr_t)v4133; *(i2*)(intptr_t)(ws+3514) = v4134; - i8 v4135 = (i8)(intptr_t)(f200_EmitterReferenceSubroutineById); + i8 v4135 = (i8)(intptr_t)(f199_EmitterReferenceSubroutineById); ((void(*)(void))(intptr_t)v4135)(); } - void f174_E_b8(void); - void f175_E_b16(void); - void f174_E_b8(void); - void f177_E_bsize(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f173_E_b8(void); + void f176_E_bsize(void); // EmitterDeclareWorkspace workspace at ws+3424 length ws+12 -void f202_EmitterDeclareWorkspace(void) { +void f201_EmitterDeclareWorkspace(void) { i1 v4136 = (i1)+87; *(i1*)(intptr_t)(ws+3600) = v4136; - i8 v4137 = (i8)(intptr_t)(f174_E_b8); + i8 v4137 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4137)(); @@ -8270,42 +8227,42 @@ void f202_EmitterDeclareWorkspace(void) { i8 v4140 = v4139+(+56); i2 v4141 = *(i2*)(intptr_t)v4140; *(i2*)(intptr_t)(ws+3576) = v4141; - i8 v4142 = (i8)(intptr_t)(f175_E_b16); + i8 v4142 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4142)(); i8 v4143 = (i8)(intptr_t)(ws+3432); i1 v4144 = *(i1*)(intptr_t)v4143; *(i1*)(intptr_t)(ws+3600) = v4144; - i8 v4145 = (i8)(intptr_t)(f174_E_b8); + i8 v4145 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4145)(); i8 v4146 = (i8)(intptr_t)(ws+3434); i2 v4147 = *(i2*)(intptr_t)v4146; *(i2*)(intptr_t)(ws+3568) = v4147; - i8 v4148 = (i8)(intptr_t)(f177_E_bsize); + i8 v4148 = (i8)(intptr_t)(f176_E_bsize); ((void(*)(void))(intptr_t)v4148)(); } - void f175_E_b16(void); - void f174_E_b8(void); - void f177_E_bsize(void); - void f185_E_countedstring(void); - void f174_E_b8(void); + void f174_E_b16(void); + void f173_E_b8(void); + void f176_E_bsize(void); + void f184_E_countedstring(void); + void f173_E_b8(void); // EmitParameterList workspace at ws+3424 length ws+8 -void f203_EmitParameterList(void) { +void f202_EmitParameterList(void) { -c02_0322:; +c01_0322:; i8 v4149 = (i8)(intptr_t)(ws+3424); i8 v4150 = *(i8*)(intptr_t)v4149; i8 v4151 = (i8)+0; - if (v4150==v4151) goto c02_0327; else goto c02_0326; + if (v4150==v4151) goto c01_0327; else goto c01_0326; -c02_0326:; +c01_0326:; i8 v4152 = (i8)(intptr_t)(ws+3424); i8 v4153 = *(i8*)(intptr_t)v4152; @@ -8315,7 +8272,7 @@ c02_0326:; i8 v4157 = v4156+(+56); i2 v4158 = *(i2*)(intptr_t)v4157; *(i2*)(intptr_t)(ws+3576) = v4158; - i8 v4159 = (i8)(intptr_t)(f175_E_b16); + i8 v4159 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4159)(); @@ -8325,7 +8282,7 @@ c02_0326:; i8 v4163 = v4162+(+26); i1 v4164 = *(i1*)(intptr_t)v4163; *(i1*)(intptr_t)(ws+3600) = v4164; - i8 v4165 = (i8)(intptr_t)(f174_E_b8); + i8 v4165 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4165)(); @@ -8335,7 +8292,7 @@ c02_0326:; i8 v4169 = v4168+(+24); i2 v4170 = *(i2*)(intptr_t)v4169; *(i2*)(intptr_t)(ws+3568) = v4170; - i8 v4171 = (i8)(intptr_t)(f177_E_bsize); + i8 v4171 = (i8)(intptr_t)(f176_E_bsize); ((void(*)(void))(intptr_t)v4171)(); @@ -8344,7 +8301,7 @@ c02_0326:; i8 v4174 = v4173+(+8); i8 v4175 = *(i8*)(intptr_t)v4174; *(i8*)(intptr_t)(ws+3568) = v4175; - i8 v4176 = (i8)(intptr_t)(f185_E_countedstring); + i8 v4176 = (i8)(intptr_t)(f184_E_countedstring); ((void(*)(void))(intptr_t)v4176)(); @@ -8356,7 +8313,7 @@ c02_0326:; i2 v4182 = *(i2*)(intptr_t)v4181; i1 v4183 = v4182; *(i1*)(intptr_t)(ws+3600) = v4183; - i8 v4184 = (i8)(intptr_t)(f174_E_b8); + i8 v4184 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4184)(); @@ -8368,23 +8325,23 @@ c02_0326:; i8 v4190 = (i8)(intptr_t)(ws+3424); *(i8*)(intptr_t)v4190 = v4189; - goto c02_0322; + goto c01_0322; -c02_0327:; +c01_0327:; } - void f174_E_b8(void); - void f175_E_b16(void); - void f174_E_b8(void); - void f99_GetInputParameter(void); - void f203_EmitParameterList(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f173_E_b8(void); + void f98_GetInputParameter(void); + void f202_EmitParameterList(void); // EmitterEmitInputParameters workspace at ws+3408 length ws+16 -void f204_EmitterEmitInputParameters(void) { +void f203_EmitterEmitInputParameters(void) { i1 v4191 = (i1)+73; *(i1*)(intptr_t)(ws+3600) = v4191; - i8 v4192 = (i8)(intptr_t)(f174_E_b8); + i8 v4192 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4192)(); @@ -8393,7 +8350,7 @@ void f204_EmitterEmitInputParameters(void) { i8 v4195 = v4194+(+56); i2 v4196 = *(i2*)(intptr_t)v4195; *(i2*)(intptr_t)(ws+3576) = v4196; - i8 v4197 = (i8)(intptr_t)(f175_E_b16); + i8 v4197 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4197)(); @@ -8402,7 +8359,7 @@ void f204_EmitterEmitInputParameters(void) { i8 v4200 = v4199+(+80); i1 v4201 = *(i1*)(intptr_t)v4200; *(i1*)(intptr_t)(ws+3600) = v4201; - i8 v4202 = (i8)(intptr_t)(f174_E_b8); + i8 v4202 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4202)(); @@ -8411,7 +8368,7 @@ void f204_EmitterEmitInputParameters(void) { *(i8*)(intptr_t)(ws+3464) = v4204; i1 v4205 = (i1)+0; *(i1*)(intptr_t)(ws+3472) = v4205; - i8 v4206 = (i8)(intptr_t)(f99_GetInputParameter); + i8 v4206 = (i8)(intptr_t)(f98_GetInputParameter); ((void(*)(void))(intptr_t)v4206)(); @@ -8422,23 +8379,23 @@ void f204_EmitterEmitInputParameters(void) { i8 v4209 = (i8)(intptr_t)(ws+3416); i8 v4210 = *(i8*)(intptr_t)v4209; *(i8*)(intptr_t)(ws+3424) = v4210; - i8 v4211 = (i8)(intptr_t)(f203_EmitParameterList); + i8 v4211 = (i8)(intptr_t)(f202_EmitParameterList); ((void(*)(void))(intptr_t)v4211)(); } - void f174_E_b8(void); - void f175_E_b16(void); - void f174_E_b8(void); - void f100_GetOutputParameter(void); - void f203_EmitParameterList(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f173_E_b8(void); + void f99_GetOutputParameter(void); + void f202_EmitParameterList(void); // EmitterEmitOutputParameters workspace at ws+3408 length ws+16 -void f205_EmitterEmitOutputParameters(void) { +void f204_EmitterEmitOutputParameters(void) { i1 v4212 = (i1)+79; *(i1*)(intptr_t)(ws+3600) = v4212; - i8 v4213 = (i8)(intptr_t)(f174_E_b8); + i8 v4213 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4213)(); @@ -8447,7 +8404,7 @@ void f205_EmitterEmitOutputParameters(void) { i8 v4216 = v4215+(+56); i2 v4217 = *(i2*)(intptr_t)v4216; *(i2*)(intptr_t)(ws+3576) = v4217; - i8 v4218 = (i8)(intptr_t)(f175_E_b16); + i8 v4218 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4218)(); @@ -8456,7 +8413,7 @@ void f205_EmitterEmitOutputParameters(void) { i8 v4221 = v4220+(+81); i1 v4222 = *(i1*)(intptr_t)v4221; *(i1*)(intptr_t)(ws+3600) = v4222; - i8 v4223 = (i8)(intptr_t)(f174_E_b8); + i8 v4223 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4223)(); @@ -8465,7 +8422,7 @@ void f205_EmitterEmitOutputParameters(void) { *(i8*)(intptr_t)(ws+3488) = v4225; i1 v4226 = (i1)+0; *(i1*)(intptr_t)(ws+3496) = v4226; - i8 v4227 = (i8)(intptr_t)(f100_GetOutputParameter); + i8 v4227 = (i8)(intptr_t)(f99_GetOutputParameter); ((void(*)(void))(intptr_t)v4227)(); @@ -8476,21 +8433,21 @@ void f205_EmitterEmitOutputParameters(void) { i8 v4230 = (i8)(intptr_t)(ws+3416); i8 v4231 = *(i8*)(intptr_t)v4230; *(i8*)(intptr_t)(ws+3424) = v4231; - i8 v4232 = (i8)(intptr_t)(f203_EmitParameterList); + i8 v4232 = (i8)(intptr_t)(f202_EmitParameterList); ((void(*)(void))(intptr_t)v4232)(); } - void f174_E_b8(void); - void f175_E_b16(void); - void f174_E_b8(void); + void f173_E_b8(void); + void f174_E_b16(void); + void f173_E_b8(void); // EmitterEmitSubroutineFlags workspace at ws+3408 length ws+8 -void f206_EmitterEmitSubroutineFlags(void) { +void f205_EmitterEmitSubroutineFlags(void) { i1 v4233 = (i1)+70; *(i1*)(intptr_t)(ws+3600) = v4233; - i8 v4234 = (i8)(intptr_t)(f174_E_b8); + i8 v4234 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4234)(); @@ -8499,7 +8456,7 @@ void f206_EmitterEmitSubroutineFlags(void) { i8 v4237 = v4236+(+56); i2 v4238 = *(i2*)(intptr_t)v4237; *(i2*)(intptr_t)(ws+3576) = v4238; - i8 v4239 = (i8)(intptr_t)(f175_E_b16); + i8 v4239 = (i8)(intptr_t)(f174_E_b16); ((void(*)(void))(intptr_t)v4239)(); @@ -8508,15 +8465,15 @@ void f206_EmitterEmitSubroutineFlags(void) { i8 v4242 = v4241+(+82); i1 v4243 = *(i1*)(intptr_t)v4242; *(i1*)(intptr_t)(ws+3600) = v4243; - i8 v4244 = (i8)(intptr_t)(f174_E_b8); + i8 v4244 = (i8)(intptr_t)(f173_E_b8); ((void(*)(void))(intptr_t)v4244)(); } - void f26_StrCmp(void); + void f25_StrCmp(void); // LookupSymbolInNamespace workspace at ws+3528 length ws+25 -void f216_LookupSymbolInNamespace(void) { +void f215_LookupSymbolInNamespace(void) { i8 v4564 = (i8)(intptr_t)(ws+3528); i8 v4565 = *(i8*)(intptr_t)v4564; @@ -8524,14 +8481,14 @@ void f216_LookupSymbolInNamespace(void) { i8 v4567 = (i8)(intptr_t)(ws+3544); *(i8*)(intptr_t)v4567 = v4566; -c02_03b0:; +c01_03b0:; i8 v4568 = (i8)(intptr_t)(ws+3544); i8 v4569 = *(i8*)(intptr_t)v4568; i8 v4570 = (i8)+0; - if (v4569==v4570) goto c02_03b5; else goto c02_03b4; + if (v4569==v4570) goto c01_03b5; else goto c01_03b4; -c02_03b4:; +c01_03b4:; i8 v4571 = (i8)(intptr_t)(ws+3544); i8 v4572 = *(i8*)(intptr_t)v4571; @@ -8541,7 +8498,7 @@ c02_03b4:; i8 v4575 = (i8)(intptr_t)(ws+3536); i8 v4576 = *(i8*)(intptr_t)v4575; *(i8*)(intptr_t)(ws+3568) = v4576; - i8 v4577 = (i8)(intptr_t)(f26_StrCmp); + i8 v4577 = (i8)(intptr_t)(f25_StrCmp); ((void(*)(void))(intptr_t)v4577)(); @@ -8552,20 +8509,20 @@ c02_03b4:; i8 v4580 = (i8)(intptr_t)(ws+3552); i1 v4581 = *(i1*)(intptr_t)v4580; i1 v4582 = (i1)+0; - if (v4581==v4582) goto c02_03b9; else goto c02_03ba; + if (v4581==v4582) goto c01_03b9; else goto c01_03ba; -c02_03b9:; +c01_03b9:; -c02_03bb:; +c01_03bb:; i8 v4583 = (i8)(intptr_t)(ws+3544); i8 v4584 = *(i8*)(intptr_t)v4583; i8 v4585 = v4584+(+32); i1 v4586 = *(i1*)(intptr_t)v4585; i1 v4587 = (i1)+39; - if (v4586==v4587) goto c02_03bf; else goto c02_03c0; + if (v4586==v4587) goto c01_03bf; else goto c01_03c0; -c02_03bf:; +c01_03bf:; i8 v4588 = (i8)(intptr_t)(ws+3544); i8 v4589 = *(i8*)(intptr_t)v4588; @@ -8573,15 +8530,15 @@ c02_03bf:; i8 v4591 = (i8)(intptr_t)(ws+3544); *(i8*)(intptr_t)v4591 = v4590; - goto c02_03bb; + goto c01_03bb; -c02_03c0:; +c01_03c0:; return; -c02_03ba:; +c01_03ba:; -c02_03b6:; +c01_03b6:; i8 v4592 = (i8)(intptr_t)(ws+3544); i8 v4593 = *(i8*)(intptr_t)v4592; @@ -8590,26 +8547,26 @@ c02_03b6:; i8 v4596 = (i8)(intptr_t)(ws+3544); *(i8*)(intptr_t)v4596 = v4595; - goto c02_03b0; + goto c01_03b0; -c02_03b5:; +c01_03b5:; i8 v4597 = (i8)+0; i8 v4598 = (i8)(intptr_t)(ws+3544); *(i8*)(intptr_t)v4598 = v4597; } - void f216_LookupSymbolInNamespace(void); + void f215_LookupSymbolInNamespace(void); // LookupSymbol workspace at ws+3488 length ws+32 -void f217_LookupSymbol(void) { +void f216_LookupSymbol(void) { i8 v4599 = (i8)(intptr_t)(ws+3488); i8 v4600 = *(i8*)(intptr_t)v4599; i8 v4601 = (i8)+0; - if (v4600==v4601) goto c02_03c4; else goto c02_03c5; + if (v4600==v4601) goto c01_03c4; else goto c01_03c5; -c02_03c4:; +c01_03c4:; i8 v4602 = (i8)(intptr_t)(ws+40); i8 v4603 = *(i8*)(intptr_t)v4602; @@ -8617,18 +8574,18 @@ c02_03c4:; i8 v4605 = (i8)(intptr_t)(ws+3488); *(i8*)(intptr_t)v4605 = v4604; -c02_03c5:; +c01_03c5:; -c02_03c1:; +c01_03c1:; -c02_03c6:; +c01_03c6:; i8 v4606 = (i8)(intptr_t)(ws+3488); i8 v4607 = *(i8*)(intptr_t)v4606; i8 v4608 = (i8)+0; - if (v4607==v4608) goto c02_03cb; else goto c02_03ca; + if (v4607==v4608) goto c01_03cb; else goto c01_03ca; -c02_03ca:; +c01_03ca:; i8 v4609 = (i8)(intptr_t)(ws+3488); i8 v4610 = *(i8*)(intptr_t)v4609; @@ -8636,7 +8593,7 @@ c02_03ca:; i8 v4611 = (i8)(intptr_t)(ws+3496); i8 v4612 = *(i8*)(intptr_t)v4611; *(i8*)(intptr_t)(ws+3536) = v4612; - i8 v4613 = (i8)(intptr_t)(f216_LookupSymbolInNamespace); + i8 v4613 = (i8)(intptr_t)(f215_LookupSymbolInNamespace); ((void(*)(void))(intptr_t)v4613)(); @@ -8652,15 +8609,15 @@ c02_03ca:; i8 v4619 = (i8)(intptr_t)(ws+3504); i8 v4620 = *(i8*)(intptr_t)v4619; i8 v4621 = (i8)+0; - if (v4620==v4621) goto c02_03d0; else goto c02_03cf; + if (v4620==v4621) goto c01_03d0; else goto c01_03cf; -c02_03cf:; +c01_03cf:; return; -c02_03d0:; +c01_03d0:; -c02_03cc:; +c01_03cc:; i8 v4622 = (i8)(intptr_t)(ws+3488); i8 v4623 = *(i8*)(intptr_t)v4622; @@ -8669,9 +8626,9 @@ c02_03cc:; i8 v4626 = (i8)(intptr_t)(ws+3488); *(i8*)(intptr_t)v4626 = v4625; - goto c02_03c6; + goto c01_03c6; -c02_03cb:; +c01_03cb:; i8 v4627 = (i8)+0; i8 v4628 = (i8)(intptr_t)(ws+3504); @@ -8680,16 +8637,16 @@ c02_03cb:; } // AddToNamespace workspace at ws+3568 length ws+16 -void f218_AddToNamespace(void) { +void f217_AddToNamespace(void) { i8 v4629 = (i8)(intptr_t)(ws+3568); i8 v4630 = *(i8*)(intptr_t)v4629; i8 v4631 = v4630+(+8); i8 v4632 = *(i8*)(intptr_t)v4631; i8 v4633 = (i8)+0; - if (v4632==v4633) goto c02_03d4; else goto c02_03d5; + if (v4632==v4633) goto c01_03d4; else goto c01_03d5; -c02_03d4:; +c01_03d4:; i8 v4634 = (i8)(intptr_t)(ws+3576); i8 v4635 = *(i8*)(intptr_t)v4634; @@ -8704,9 +8661,9 @@ c02_03d4:; i8 v4642 = v4641+(+8); *(i8*)(intptr_t)v4642 = v4639; - goto c02_03d1; + goto c01_03d1; -c02_03d5:; +c01_03d5:; i8 v4643 = (i8)(intptr_t)(ws+3576); i8 v4644 = *(i8*)(intptr_t)v4643; @@ -8724,7 +8681,7 @@ c02_03d5:; i8 v4654 = v4653+(+8); *(i8*)(intptr_t)v4654 = v4651; -c02_03d1:; +c01_03d1:; i8 v4655 = (i8)(intptr_t)(ws+3568); i8 v4656 = *(i8*)(intptr_t)v4655; @@ -8734,26 +8691,26 @@ c02_03d1:; *(i8*)(intptr_t)v4659 = v4656; } - void f64_AllocNewSymbol(void); - void f216_LookupSymbolInNamespace(void); - void f74_StartError(void); -const i1 c02_s00f5[] = { 0x73,0x79,0x6d,0x62,0x6f,0x6c,0x20,0x27,0 }; - void f12_print(void); - void f12_print(void); -const i1 c02_s00f6[] = { 0x27,0x20,0x69,0x73,0x20,0x61,0x6c,0x72,0x65,0x61,0x64,0x79,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0 }; - void f12_print(void); - void f75_EndError(void); - void f218_AddToNamespace(void); + void f63_AllocNewSymbol(void); + void f215_LookupSymbolInNamespace(void); + void f73_StartError(void); +const i1 c01_s00f6[] = { 0x73,0x79,0x6d,0x62,0x6f,0x6c,0x20,0x27,0 }; + void f11_print(void); + void f11_print(void); +const i1 c01_s00f7[] = { 0x27,0x20,0x69,0x73,0x20,0x61,0x6c,0x72,0x65,0x61,0x64,0x79,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0 }; + void f11_print(void); + void f74_EndError(void); + void f217_AddToNamespace(void); // AddSymbol workspace at ws+3488 length ws+40 -void f219_AddSymbol(void) { +void f218_AddSymbol(void) { i8 v4660 = (i8)(intptr_t)(ws+3488); i8 v4661 = *(i8*)(intptr_t)v4660; i8 v4662 = (i8)+0; - if (v4661==v4662) goto c02_03d9; else goto c02_03da; + if (v4661==v4662) goto c01_03d9; else goto c01_03da; -c02_03d9:; +c01_03d9:; i8 v4663 = (i8)(intptr_t)(ws+40); i8 v4664 = *(i8*)(intptr_t)v4663; @@ -8761,11 +8718,11 @@ c02_03d9:; i8 v4666 = (i8)(intptr_t)(ws+3488); *(i8*)(intptr_t)v4666 = v4665; -c02_03da:; +c01_03da:; -c02_03d6:; +c01_03d6:; - i8 v4667 = (i8)(intptr_t)(f64_AllocNewSymbol); + i8 v4667 = (i8)(intptr_t)(f63_AllocNewSymbol); ((void(*)(void))(intptr_t)v4667)(); @@ -8781,9 +8738,9 @@ c02_03d6:; i8 v4673 = (i8)(intptr_t)(ws+3496); i8 v4674 = *(i8*)(intptr_t)v4673; i8 v4675 = (i8)+0; - if (v4674==v4675) goto c02_03df; else goto c02_03de; + if (v4674==v4675) goto c01_03df; else goto c01_03de; -c02_03de:; +c01_03de:; i8 v4676 = (i8)(intptr_t)(ws+3488); i8 v4677 = *(i8*)(intptr_t)v4676; @@ -8791,7 +8748,7 @@ c02_03de:; i8 v4678 = (i8)(intptr_t)(ws+3496); i8 v4679 = *(i8*)(intptr_t)v4678; *(i8*)(intptr_t)(ws+3536) = v4679; - i8 v4680 = (i8)(intptr_t)(f216_LookupSymbolInNamespace); + i8 v4680 = (i8)(intptr_t)(f215_LookupSymbolInNamespace); ((void(*)(void))(intptr_t)v4680)(); @@ -8802,40 +8759,40 @@ c02_03de:; i8 v4683 = (i8)(intptr_t)(ws+3520); i8 v4684 = *(i8*)(intptr_t)v4683; i8 v4685 = (i8)+0; - if (v4684==v4685) goto c02_03e4; else goto c02_03e3; + if (v4684==v4685) goto c01_03e4; else goto c01_03e3; -c02_03e3:; +c01_03e3:; - i8 v4686 = (i8)(intptr_t)(f74_StartError); + i8 v4686 = (i8)(intptr_t)(f73_StartError); ((void(*)(void))(intptr_t)v4686)(); - i8 v4687 = (i8)(intptr_t)c02_s00f5; + i8 v4687 = (i8)(intptr_t)c01_s00f6; *(i8*)(intptr_t)(ws+3696) = v4687; - i8 v4688 = (i8)(intptr_t)(f12_print); + i8 v4688 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v4688)(); i8 v4689 = (i8)(intptr_t)(ws+3496); i8 v4690 = *(i8*)(intptr_t)v4689; *(i8*)(intptr_t)(ws+3696) = v4690; - i8 v4691 = (i8)(intptr_t)(f12_print); + i8 v4691 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v4691)(); - i8 v4692 = (i8)(intptr_t)c02_s00f6; + i8 v4692 = (i8)(intptr_t)c01_s00f7; *(i8*)(intptr_t)(ws+3696) = v4692; - i8 v4693 = (i8)(intptr_t)(f12_print); + i8 v4693 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v4693)(); - i8 v4694 = (i8)(intptr_t)(f75_EndError); + i8 v4694 = (i8)(intptr_t)(f74_EndError); ((void(*)(void))(intptr_t)v4694)(); -c02_03e4:; +c01_03e4:; -c02_03e0:; +c01_03e0:; i8 v4695 = (i8)(intptr_t)(ws+3496); i8 v4696 = *(i8*)(intptr_t)v4695; @@ -8850,19 +8807,19 @@ c02_03e0:; i8 v4702 = (i8)(intptr_t)(ws+3504); i8 v4703 = *(i8*)(intptr_t)v4702; *(i8*)(intptr_t)(ws+3576) = v4703; - i8 v4704 = (i8)(intptr_t)(f218_AddToNamespace); + i8 v4704 = (i8)(intptr_t)(f217_AddToNamespace); ((void(*)(void))(intptr_t)v4704)(); -c02_03df:; +c01_03df:; -c02_03db:; +c01_03db:; } - void f219_AddSymbol(void); + void f218_AddSymbol(void); // AddAlias workspace at ws+3400 length ws+40 -void f220_AddAlias(void) { +void f219_AddAlias(void) { i8 v4705 = (i8)(intptr_t)(ws+3400); i8 v4706 = *(i8*)(intptr_t)v4705; @@ -8870,7 +8827,7 @@ void f220_AddAlias(void) { i8 v4707 = (i8)(intptr_t)(ws+3408); i8 v4708 = *(i8*)(intptr_t)v4707; *(i8*)(intptr_t)(ws+3496) = v4708; - i8 v4709 = (i8)(intptr_t)(f219_AddSymbol); + i8 v4709 = (i8)(intptr_t)(f218_AddSymbol); ((void(*)(void))(intptr_t)v4709)(); @@ -8896,10 +8853,10 @@ void f220_AddAlias(void) { *(i8*)(intptr_t)v4722 = v4720; } - void f220_AddAlias(void); + void f219_AddAlias(void); // AddAliasString workspace at ws+3336 length ws+32 -void f221_AddAliasString(void) { +void f220_AddAliasString(void) { i8 v4723 = (i8)+0; *(i8*)(intptr_t)(ws+3400) = v4723; @@ -8909,7 +8866,7 @@ void f221_AddAliasString(void) { i8 v4726 = (i8)(intptr_t)(ws+3344); i8 v4727 = *(i8*)(intptr_t)v4726; *(i8*)(intptr_t)(ws+3416) = v4727; - i8 v4728 = (i8)(intptr_t)(f220_AddAlias); + i8 v4728 = (i8)(intptr_t)(f219_AddAlias); ((void(*)(void))(intptr_t)v4728)(); @@ -8923,33 +8880,33 @@ void f221_AddAliasString(void) { *(i8*)(intptr_t)v4733 = v4732; } - void f74_StartError(void); -const i1 c02_s00f7[] = { 0x27,0 }; - void f12_print(void); - void f12_print(void); -const i1 c02_s00f8[] = { 0x27,0x20,0x69,0x73,0x20,0x61,0x20,0x70,0x61,0x72,0x74,0x69,0x61,0x6c,0x20,0x74,0x79,0x70,0x65,0 }; - void f12_print(void); - void f75_EndError(void); + void f73_StartError(void); +const i1 c01_s00f8[] = { 0x27,0 }; + void f11_print(void); + void f11_print(void); +const i1 c01_s00f9[] = { 0x27,0x20,0x69,0x73,0x20,0x61,0x20,0x70,0x61,0x72,0x74,0x69,0x61,0x6c,0x20,0x74,0x79,0x70,0x65,0 }; + void f11_print(void); + void f74_EndError(void); // CheckNotPartialType workspace at ws+3520 length ws+8 -void f222_CheckNotPartialType(void) { +void f221_CheckNotPartialType(void) { i8 v4734 = (i8)(intptr_t)(ws+3520); i8 v4735 = *(i8*)(intptr_t)v4734; i8 v4736 = v4735+(+52); i1 v4737 = *(i1*)(intptr_t)v4736; i1 v4738 = (i1)+1; - if (v4737==v4738) goto c02_03e8; else goto c02_03e9; + if (v4737==v4738) goto c01_03e8; else goto c01_03e9; -c02_03e8:; +c01_03e8:; - i8 v4739 = (i8)(intptr_t)(f74_StartError); + i8 v4739 = (i8)(intptr_t)(f73_StartError); ((void(*)(void))(intptr_t)v4739)(); - i8 v4740 = (i8)(intptr_t)c02_s00f7; + i8 v4740 = (i8)(intptr_t)c01_s00f8; *(i8*)(intptr_t)(ws+3696) = v4740; - i8 v4741 = (i8)(intptr_t)(f12_print); + i8 v4741 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v4741)(); @@ -8960,32 +8917,32 @@ c02_03e8:; i8 v4746 = v4745+(+8); i8 v4747 = *(i8*)(intptr_t)v4746; *(i8*)(intptr_t)(ws+3696) = v4747; - i8 v4748 = (i8)(intptr_t)(f12_print); + i8 v4748 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v4748)(); - i8 v4749 = (i8)(intptr_t)c02_s00f8; + i8 v4749 = (i8)(intptr_t)c01_s00f9; *(i8*)(intptr_t)(ws+3696) = v4749; - i8 v4750 = (i8)(intptr_t)(f12_print); + i8 v4750 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v4750)(); - i8 v4751 = (i8)(intptr_t)(f75_EndError); + i8 v4751 = (i8)(intptr_t)(f74_EndError); ((void(*)(void))(intptr_t)v4751)(); -c02_03e9:; +c01_03e9:; -c02_03e5:; +c01_03e5:; } - void f64_AllocNewSymbol(void); - void f218_AddToNamespace(void); + void f63_AllocNewSymbol(void); + void f217_AddToNamespace(void); // AddTypeToNamespace workspace at ws+3528 length ws+40 -void f223_AddTypeToNamespace(void) { +void f222_AddTypeToNamespace(void) { - i8 v4752 = (i8)(intptr_t)(f64_AllocNewSymbol); + i8 v4752 = (i8)(intptr_t)(f63_AllocNewSymbol); ((void(*)(void))(intptr_t)v4752)(); @@ -9030,18 +8987,18 @@ void f223_AddTypeToNamespace(void) { i8 v4778 = (i8)(intptr_t)(ws+3560); i8 v4779 = *(i8*)(intptr_t)v4778; *(i8*)(intptr_t)(ws+3576) = v4779; - i8 v4780 = (i8)(intptr_t)(f218_AddToNamespace); + i8 v4780 = (i8)(intptr_t)(f217_AddToNamespace); ((void(*)(void))(intptr_t)v4780)(); } - void f66_AllocNewType(void); - void f223_AddTypeToNamespace(void); + void f65_AllocNewType(void); + void f222_AddTypeToNamespace(void); // MakeNumberType workspace at ws+3336 length ws+32 -void f224_MakeNumberType(void) { +void f223_MakeNumberType(void) { - i8 v4781 = (i8)(intptr_t)(f66_AllocNewType); + i8 v4781 = (i8)(intptr_t)(f65_AllocNewType); ((void(*)(void))(intptr_t)v4781)(); @@ -9099,14 +9056,14 @@ void f224_MakeNumberType(void) { i8 v4817 = (i8)(intptr_t)(ws+3344); i8 v4818 = *(i8*)(intptr_t)v4817; *(i8*)(intptr_t)(ws+3544) = v4818; - i8 v4819 = (i8)(intptr_t)(f223_AddTypeToNamespace); + i8 v4819 = (i8)(intptr_t)(f222_AddTypeToNamespace); ((void(*)(void))(intptr_t)v4819)(); } // IsTypeOfKind workspace at ws+3576 length ws+10 -void f225_IsTypeOfKind(void) { +void f224_IsTypeOfKind(void) { i1 v4820 = (i1)+0; i8 v4821 = (i8)(intptr_t)(ws+3585); @@ -9115,9 +9072,9 @@ void f225_IsTypeOfKind(void) { i8 v4822 = (i8)(intptr_t)(ws+3576); i8 v4823 = *(i8*)(intptr_t)v4822; i8 v4824 = (i8)+0; - if (v4823==v4824) goto c02_03f0; else goto c02_03f1; + if (v4823==v4824) goto c01_03f0; else goto c01_03f1; -c02_03f1:; +c01_03f1:; i8 v4825 = (i8)(intptr_t)(ws+3576); i8 v4826 = *(i8*)(intptr_t)v4825; @@ -9125,30 +9082,30 @@ c02_03f1:; i1 v4828 = *(i1*)(intptr_t)v4827; i8 v4829 = (i8)(intptr_t)(ws+3584); i1 v4830 = *(i1*)(intptr_t)v4829; - if (v4828==v4830) goto c02_03ef; else goto c02_03f0; + if (v4828==v4830) goto c01_03ef; else goto c01_03f0; -c02_03ef:; +c01_03ef:; i1 v4831 = (i1)+1; i8 v4832 = (i8)(intptr_t)(ws+3585); *(i1*)(intptr_t)v4832 = v4831; -c02_03f0:; +c01_03f0:; -c02_03ea:; +c01_03ea:; } - void f225_IsTypeOfKind(void); + void f224_IsTypeOfKind(void); // IsArray workspace at ws+3496 length ws+10 -void f226_IsArray(void) { +void f225_IsArray(void) { i8 v4833 = (i8)(intptr_t)(ws+3496); i8 v4834 = *(i8*)(intptr_t)v4833; *(i8*)(intptr_t)(ws+3576) = v4834; i1 v4835 = (i1)+4; *(i1*)(intptr_t)(ws+3584) = v4835; - i8 v4836 = (i8)(intptr_t)(f225_IsTypeOfKind); + i8 v4836 = (i8)(intptr_t)(f224_IsTypeOfKind); ((void(*)(void))(intptr_t)v4836)(); @@ -9162,17 +9119,17 @@ void f226_IsArray(void) { *(i1*)(intptr_t)v4841 = v4840; } - void f225_IsTypeOfKind(void); + void f224_IsTypeOfKind(void); // IsPtr workspace at ws+3560 length ws+10 -void f68_IsPtr(void) { +void f67_IsPtr(void) { i8 v4842 = (i8)(intptr_t)(ws+3560); i8 v4843 = *(i8*)(intptr_t)v4842; *(i8*)(intptr_t)(ws+3576) = v4843; i1 v4844 = (i1)+3; *(i1*)(intptr_t)(ws+3584) = v4844; - i8 v4845 = (i8)(intptr_t)(f225_IsTypeOfKind); + i8 v4845 = (i8)(intptr_t)(f224_IsTypeOfKind); ((void(*)(void))(intptr_t)v4845)(); @@ -9186,17 +9143,17 @@ void f68_IsPtr(void) { *(i1*)(intptr_t)v4850 = v4849; } - void f225_IsTypeOfKind(void); + void f224_IsTypeOfKind(void); // IsSubroutine workspace at ws+3560 length ws+10 -void f227_IsSubroutine(void) { +void f226_IsSubroutine(void) { i8 v4851 = (i8)(intptr_t)(ws+3560); i8 v4852 = *(i8*)(intptr_t)v4851; *(i8*)(intptr_t)(ws+3576) = v4852; i1 v4853 = (i1)+6; *(i1*)(intptr_t)(ws+3584) = v4853; - i8 v4854 = (i8)(intptr_t)(f225_IsTypeOfKind); + i8 v4854 = (i8)(intptr_t)(f224_IsTypeOfKind); ((void(*)(void))(intptr_t)v4854)(); @@ -9210,32 +9167,32 @@ void f227_IsSubroutine(void) { *(i1*)(intptr_t)v4859 = v4858; } - void f225_IsTypeOfKind(void); + void f224_IsTypeOfKind(void); // IsNum workspace at ws+3560 length ws+10 -void f228_IsNum(void) { +void f227_IsNum(void) { i8 v4860 = (i8)(intptr_t)(ws+3560); i8 v4861 = *(i8*)(intptr_t)v4860; i8 v4862 = (i8)+0; - if (v4861==v4862) goto c02_03f5; else goto c02_03f6; + if (v4861==v4862) goto c01_03f5; else goto c01_03f6; -c02_03f5:; +c01_03f5:; i1 v4863 = (i1)+1; i8 v4864 = (i8)(intptr_t)(ws+3568); *(i1*)(intptr_t)v4864 = v4863; - goto c02_03f2; + goto c01_03f2; -c02_03f6:; +c01_03f6:; i8 v4865 = (i8)(intptr_t)(ws+3560); i8 v4866 = *(i8*)(intptr_t)v4865; *(i8*)(intptr_t)(ws+3576) = v4866; i1 v4867 = (i1)+2; *(i1*)(intptr_t)(ws+3584) = v4867; - i8 v4868 = (i8)(intptr_t)(f225_IsTypeOfKind); + i8 v4868 = (i8)(intptr_t)(f224_IsTypeOfKind); ((void(*)(void))(intptr_t)v4868)(); @@ -9248,35 +9205,35 @@ c02_03f6:; i8 v4873 = (i8)(intptr_t)(ws+3568); *(i1*)(intptr_t)v4873 = v4872; -c02_03f2:; +c01_03f2:; } - void f225_IsTypeOfKind(void); + void f224_IsTypeOfKind(void); // IsSNum workspace at ws+3456 length ws+10 -void f229_IsSNum(void) { +void f228_IsSNum(void) { i8 v4874 = (i8)(intptr_t)(ws+3456); i8 v4875 = *(i8*)(intptr_t)v4874; i8 v4876 = (i8)+0; - if (v4875==v4876) goto c02_03fa; else goto c02_03fb; + if (v4875==v4876) goto c01_03fa; else goto c01_03fb; -c02_03fa:; +c01_03fa:; i1 v4877 = (i1)+1; i8 v4878 = (i8)(intptr_t)(ws+3464); *(i1*)(intptr_t)v4878 = v4877; - goto c02_03f7; + goto c01_03f7; -c02_03fb:; +c01_03fb:; i8 v4879 = (i8)(intptr_t)(ws+3456); i8 v4880 = *(i8*)(intptr_t)v4879; *(i8*)(intptr_t)(ws+3576) = v4880; i1 v4881 = (i1)+2; *(i1*)(intptr_t)(ws+3584) = v4881; - i8 v4882 = (i8)(intptr_t)(f225_IsTypeOfKind); + i8 v4882 = (i8)(intptr_t)(f224_IsTypeOfKind); ((void(*)(void))(intptr_t)v4882)(); @@ -9287,44 +9244,44 @@ c02_03fb:; i8 v4885 = (i8)(intptr_t)(ws+3465); i1 v4886 = *(i1*)(intptr_t)v4885; i1 v4887 = (i1)+0; - if (v4886==v4887) goto c02_0401; else goto c02_0402; + if (v4886==v4887) goto c01_0401; else goto c01_0402; -c02_0402:; +c01_0402:; i8 v4888 = (i8)(intptr_t)(ws+3456); i8 v4889 = *(i8*)(intptr_t)v4888; i1 v4890 = *(i1*)(intptr_t)v4889; i1 v4891 = (i1)+0; - if (v4890==v4891) goto c02_0401; else goto c02_0400; + if (v4890==v4891) goto c01_0401; else goto c01_0400; -c02_0400:; +c01_0400:; i1 v4892 = (i1)+1; i8 v4893 = (i8)(intptr_t)(ws+3464); *(i1*)(intptr_t)v4893 = v4892; - goto c02_03f7; + goto c01_03f7; -c02_0401:; +c01_0401:; i1 v4894 = (i1)+0; i8 v4895 = (i8)(intptr_t)(ws+3464); *(i1*)(intptr_t)v4895 = v4894; -c02_03f7:; +c01_03f7:; } - void f68_IsPtr(void); - void f228_IsNum(void); - void f227_IsSubroutine(void); + void f67_IsPtr(void); + void f227_IsNum(void); + void f226_IsSubroutine(void); // IsScalar workspace at ws+3544 length ws+12 -void f230_IsScalar(void) { +void f229_IsScalar(void) { i8 v4896 = (i8)(intptr_t)(ws+3544); i8 v4897 = *(i8*)(intptr_t)v4896; *(i8*)(intptr_t)(ws+3560) = v4897; - i8 v4898 = (i8)(intptr_t)(f68_IsPtr); + i8 v4898 = (i8)(intptr_t)(f67_IsPtr); ((void(*)(void))(intptr_t)v4898)(); @@ -9335,7 +9292,7 @@ void f230_IsScalar(void) { i8 v4901 = (i8)(intptr_t)(ws+3544); i8 v4902 = *(i8*)(intptr_t)v4901; *(i8*)(intptr_t)(ws+3560) = v4902; - i8 v4903 = (i8)(intptr_t)(f228_IsNum); + i8 v4903 = (i8)(intptr_t)(f227_IsNum); ((void(*)(void))(intptr_t)v4903)(); @@ -9346,7 +9303,7 @@ void f230_IsScalar(void) { i8 v4906 = (i8)(intptr_t)(ws+3544); i8 v4907 = *(i8*)(intptr_t)v4906; *(i8*)(intptr_t)(ws+3560) = v4907; - i8 v4908 = (i8)(intptr_t)(f227_IsSubroutine); + i8 v4908 = (i8)(intptr_t)(f226_IsSubroutine); ((void(*)(void))(intptr_t)v4908)(); @@ -9357,50 +9314,50 @@ void f230_IsScalar(void) { i8 v4911 = (i8)(intptr_t)(ws+3553); i1 v4912 = *(i1*)(intptr_t)v4911; i1 v4913 = (i1)+0; - if (v4912==v4913) goto c02_040d; else goto c02_040a; + if (v4912==v4913) goto c01_040d; else goto c01_040a; -c02_040d:; +c01_040d:; i8 v4914 = (i8)(intptr_t)(ws+3554); i1 v4915 = *(i1*)(intptr_t)v4914; i1 v4916 = (i1)+0; - if (v4915==v4916) goto c02_040c; else goto c02_040a; + if (v4915==v4916) goto c01_040c; else goto c01_040a; -c02_040c:; +c01_040c:; i8 v4917 = (i8)(intptr_t)(ws+3555); i1 v4918 = *(i1*)(intptr_t)v4917; i1 v4919 = (i1)+0; - if (v4918==v4919) goto c02_040b; else goto c02_040a; + if (v4918==v4919) goto c01_040b; else goto c01_040a; -c02_040a:; +c01_040a:; i1 v4920 = (i1)+1; i8 v4921 = (i8)(intptr_t)(ws+3552); *(i1*)(intptr_t)v4921 = v4920; - goto c02_0403; + goto c01_0403; -c02_040b:; +c01_040b:; i1 v4922 = (i1)+0; i8 v4923 = (i8)(intptr_t)(ws+3552); *(i1*)(intptr_t)v4923 = v4922; -c02_0403:; +c01_0403:; } - void f225_IsTypeOfKind(void); + void f224_IsTypeOfKind(void); // IsRecord workspace at ws+3488 length ws+10 -void f231_IsRecord(void) { +void f230_IsRecord(void) { i8 v4924 = (i8)(intptr_t)(ws+3488); i8 v4925 = *(i8*)(intptr_t)v4924; *(i8*)(intptr_t)(ws+3576) = v4925; i1 v4926 = (i1)+5; *(i1*)(intptr_t)(ws+3584) = v4926; - i8 v4927 = (i8)(intptr_t)(f225_IsTypeOfKind); + i8 v4927 = (i8)(intptr_t)(f224_IsTypeOfKind); ((void(*)(void))(intptr_t)v4927)(); @@ -9414,11 +9371,11 @@ void f231_IsRecord(void) { *(i1*)(intptr_t)v4932 = v4931; } - void f230_IsScalar(void); - void f162_MidDeref(void); + void f229_IsScalar(void); + void f130_MidDeref(void); // MakeLValue workspace at ws+3496 length ws+48 -void f232_MakeLValue(void) { +void f231_MakeLValue(void) { i1 v4933 = (i1)+0; i8 v4934 = (i8)(intptr_t)(ws+3512); @@ -9435,7 +9392,7 @@ void f232_MakeLValue(void) { i8 v4941 = (i8)(intptr_t)(ws+3520); i8 v4942 = *(i8*)(intptr_t)v4941; *(i8*)(intptr_t)(ws+3544) = v4942; - i8 v4943 = (i8)(intptr_t)(f230_IsScalar); + i8 v4943 = (i8)(intptr_t)(f229_IsScalar); ((void(*)(void))(intptr_t)v4943)(); @@ -9446,9 +9403,9 @@ void f232_MakeLValue(void) { i8 v4946 = (i8)(intptr_t)(ws+3528); i1 v4947 = *(i1*)(intptr_t)v4946; i1 v4948 = (i1)+0; - if (v4947==v4948) goto c02_0412; else goto c02_0411; + if (v4947==v4948) goto c01_0412; else goto c01_0411; -c02_0411:; +c01_0411:; i8 v4949 = (i8)(intptr_t)(ws+3520); i8 v4950 = *(i8*)(intptr_t)v4949; @@ -9458,9 +9415,9 @@ c02_0411:; i8 v4954 = (i8)(intptr_t)(ws+3512); *(i1*)(intptr_t)v4954 = v4953; -c02_0412:; +c01_0412:; -c02_040e:; +c01_040e:; i8 v4955 = (i8)(intptr_t)(ws+3512); i1 v4956 = *(i1*)(intptr_t)v4955; @@ -9468,7 +9425,7 @@ c02_040e:; i8 v4957 = (i8)(intptr_t)(ws+3496); i8 v4958 = *(i8*)(intptr_t)v4957; *(i8*)(intptr_t)(ws+3552) = v4958; - i8 v4959 = (i8)(intptr_t)(f162_MidDeref); + i8 v4959 = (i8)(intptr_t)(f130_MidDeref); ((void(*)(void))(intptr_t)v4959)(); @@ -9489,12 +9446,12 @@ c02_040e:; *(i8*)(intptr_t)v4969 = v4966; } -const i1 c02_s00f9[] = { 0x6c,0x76,0x61,0x6c,0x75,0x65,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0 }; - void f76_SimpleError(void); - void f63_Discard(void); +const i1 c01_s00fa[] = { 0x6c,0x76,0x61,0x6c,0x75,0x65,0x20,0x72,0x65,0x71,0x75,0x69,0x72,0x65,0x64,0 }; + void f75_SimpleError(void); + void f62_Discard(void); // UndoLValue workspace at ws+3432 length ws+17 -void f233_UndoLValue(void) { +void f232_UndoLValue(void) { i8 v4970 = (i8)(intptr_t)(ws+3432); i8 v4971 = *(i8*)(intptr_t)v4970; @@ -9506,26 +9463,26 @@ void f233_UndoLValue(void) { i8 v4975 = (i8)(intptr_t)(ws+3448); i1 v4976 = *(i1*)(intptr_t)v4975; i1 v4977 = (i1)+44; - if (v4976>v11369; - i2 v11371 = v11370; - *(i2*)(intptr_t)(ws+3656) = v11371; - i8 v11372 = (i8)(intptr_t)(f17_print_i16); + i8 v11393 = (i8)(intptr_t)(ws+3264); + i8 v11394 = *(i8*)(intptr_t)v11393; + i1 v11395 = (i1)+10; + i8 v11396 = ((i8)v11394)>>v11395; + i2 v11397 = v11396; + *(i2*)(intptr_t)(ws+3656) = v11397; + i8 v11398 = (i8)(intptr_t)(f16_print_i16); - ((void(*)(void))(intptr_t)v11372)(); + ((void(*)(void))(intptr_t)v11398)(); - i8 v11373 = (i8)(intptr_t)c02_s0193; - *(i8*)(intptr_t)(ws+3696) = v11373; - i8 v11374 = (i8)(intptr_t)(f12_print); + i8 v11399 = (i8)(intptr_t)c01_s0194; + *(i8*)(intptr_t)(ws+3696) = v11399; + i8 v11400 = (i8)(intptr_t)(f11_print); - ((void(*)(void))(intptr_t)v11374)(); + ((void(*)(void))(intptr_t)v11400)(); } -const i1 c02_s0194[] = { 0x73,0x79,0x6e,0x74,0x61,0x78,0x20,0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x63,0x6f,0x77,0x66,0x65,0x20,0x5b,0x2d,0x49,0x70,0x61,0x74,0x68,0x5d,0x20,0x3c,0x69,0x6e,0x66,0x69,0x6c,0x65,0x3e,0x20,0x3c,0x6f,0x75,0x74,0x66,0x69,0x6c,0x65,0x3e,0x0a,0 }; - void f12_print(void); - void f6_ExitWithError(void); +const i1 c01_s0195[] = { 0x73,0x79,0x6e,0x74,0x61,0x78,0x20,0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x63,0x6f,0x77,0x66,0x65,0x20,0x5b,0x2d,0x49,0x70,0x61,0x74,0x68,0x5d,0x20,0x3c,0x69,0x6e,0x66,0x69,0x6c,0x65,0x3e,0x20,0x3c,0x6f,0x75,0x74,0x66,0x69,0x6c,0x65,0x3e,0x0a,0 }; + void f11_print(void); + void f5_ExitWithError(void); // SyntaxError workspace at ws+3280 length ws+0 -void f446_SyntaxError(void) { +void f448_SyntaxError(void) { - i8 v11375 = (i8)(intptr_t)c02_s0194; - *(i8*)(intptr_t)(ws+3696) = v11375; - i8 v11376 = (i8)(intptr_t)(f12_print); + i8 v11401 = (i8)(intptr_t)c01_s0195; + *(i8*)(intptr_t)(ws+3696) = v11401; + i8 v11402 = (i8)(intptr_t)(f11_print); - ((void(*)(void))(intptr_t)v11376)(); + ((void(*)(void))(intptr_t)v11402)(); - i8 v11377 = (i8)(intptr_t)(f6_ExitWithError); + i8 v11403 = (i8)(intptr_t)(f5_ExitWithError); - ((void(*)(void))(intptr_t)v11377)(); + ((void(*)(void))(intptr_t)v11403)(); } - void f24_ArgvInit(void); - void f25_ArgvNext(void); - void f77_LexerAddIncludePath(void); - void f446_SyntaxError(void); - void f446_SyntaxError(void); - void f446_SyntaxError(void); + void f23_ArgvInit(void); + void f24_ArgvNext(void); + void f76_LexerAddIncludePath(void); + void f448_SyntaxError(void); + void f448_SyntaxError(void); + void f448_SyntaxError(void); // ParseArguments workspace at ws+3264 length ws+16 -void f447_ParseArguments(void) { +void f449_ParseArguments(void) { - i8 v11378 = (i8)(intptr_t)(f24_ArgvInit); + i8 v11404 = (i8)(intptr_t)(f23_ArgvInit); - ((void(*)(void))(intptr_t)v11378)(); + ((void(*)(void))(intptr_t)v11404)(); -c02_07a0:; +c01_07ad:; - i8 v11379 = (i8)(intptr_t)(f25_ArgvNext); + i8 v11405 = (i8)(intptr_t)(f24_ArgvNext); - ((void(*)(void))(intptr_t)v11379)(); + ((void(*)(void))(intptr_t)v11405)(); - i8 v11380 = *(i8*)(intptr_t)(ws+3280); - i8 v11381 = (i8)(intptr_t)(ws+3264); - *(i8*)(intptr_t)v11381 = v11380; + i8 v11406 = *(i8*)(intptr_t)(ws+3280); + i8 v11407 = (i8)(intptr_t)(ws+3264); + *(i8*)(intptr_t)v11407 = v11406; - i8 v11382 = (i8)(intptr_t)(ws+3264); - i8 v11383 = *(i8*)(intptr_t)v11382; - i8 v11384 = (i8)(intptr_t)(ws+3272); - *(i8*)(intptr_t)v11384 = v11383; + i8 v11408 = (i8)(intptr_t)(ws+3264); + i8 v11409 = *(i8*)(intptr_t)v11408; + i8 v11410 = (i8)(intptr_t)(ws+3272); + *(i8*)(intptr_t)v11410 = v11409; - i8 v11385 = (i8)(intptr_t)(ws+3272); - i8 v11386 = *(i8*)(intptr_t)v11385; - i8 v11387 = (i8)+0; - if (v11386==v11387) goto c02_07a5; else goto c02_07a6; + i8 v11411 = (i8)(intptr_t)(ws+3272); + i8 v11412 = *(i8*)(intptr_t)v11411; + i8 v11413 = (i8)+0; + if (v11412==v11413) goto c01_07b2; else goto c01_07b3; -c02_07a5:; +c01_07b2:; - goto c02_07a1; + goto c01_07ae; -c02_07a6:; +c01_07b3:; -c02_07a2:; +c01_07af:; - i8 v11388 = (i8)(intptr_t)(ws+3272); - i8 v11389 = *(i8*)(intptr_t)v11388; - i1 v11390 = *(i1*)(intptr_t)v11389; - i1 v11391 = (i1)+45; - if (v11390==v11391) goto c02_07aa; else goto c02_07ab; + i8 v11414 = (i8)(intptr_t)(ws+3272); + i8 v11415 = *(i8*)(intptr_t)v11414; + i1 v11416 = *(i1*)(intptr_t)v11415; + i1 v11417 = (i1)+45; + if (v11416==v11417) goto c01_07b7; else goto c01_07b8; -c02_07aa:; +c01_07b7:; - i8 v11392 = (i8)(intptr_t)(ws+3272); - i8 v11393 = *(i8*)(intptr_t)v11392; - i8 v11394 = v11393+(+1); - i8 v11395 = (i8)(intptr_t)(ws+3272); - *(i8*)(intptr_t)v11395 = v11394; + i8 v11418 = (i8)(intptr_t)(ws+3272); + i8 v11419 = *(i8*)(intptr_t)v11418; + i8 v11420 = v11419+(+1); + i8 v11421 = (i8)(intptr_t)(ws+3272); + *(i8*)(intptr_t)v11421 = v11420; - i8 v11396 = (i8)(intptr_t)(ws+3272); - i8 v11397 = *(i8*)(intptr_t)v11396; - i1 v11398 = *(i1*)(intptr_t)v11397; - i1 v11399 = (i1)+73; - if (v11398==v11399) goto c02_07af; else goto c02_07b0; + i8 v11422 = (i8)(intptr_t)(ws+3272); + i8 v11423 = *(i8*)(intptr_t)v11422; + i1 v11424 = *(i1*)(intptr_t)v11423; + i1 v11425 = (i1)+73; + if (v11424==v11425) goto c01_07bc; else goto c01_07bd; -c02_07af:; +c01_07bc:; - i8 v11400 = (i8)(intptr_t)(ws+3272); - i8 v11401 = *(i8*)(intptr_t)v11400; - i8 v11402 = v11401+(+1); - i8 v11403 = (i8)(intptr_t)(ws+3272); - *(i8*)(intptr_t)v11403 = v11402; + i8 v11426 = (i8)(intptr_t)(ws+3272); + i8 v11427 = *(i8*)(intptr_t)v11426; + i8 v11428 = v11427+(+1); + i8 v11429 = (i8)(intptr_t)(ws+3272); + *(i8*)(intptr_t)v11429 = v11428; - i8 v11404 = (i8)(intptr_t)(ws+3272); - i8 v11405 = *(i8*)(intptr_t)v11404; - *(i8*)(intptr_t)(ws+3280) = v11405; - i8 v11406 = (i8)(intptr_t)(f77_LexerAddIncludePath); + i8 v11430 = (i8)(intptr_t)(ws+3272); + i8 v11431 = *(i8*)(intptr_t)v11430; + *(i8*)(intptr_t)(ws+3280) = v11431; + i8 v11432 = (i8)(intptr_t)(f76_LexerAddIncludePath); - ((void(*)(void))(intptr_t)v11406)(); + ((void(*)(void))(intptr_t)v11432)(); - goto c02_07ac; + goto c01_07b9; -c02_07b0:; +c01_07bd:; - i8 v11407 = (i8)(intptr_t)(f446_SyntaxError); + i8 v11433 = (i8)(intptr_t)(f448_SyntaxError); - ((void(*)(void))(intptr_t)v11407)(); + ((void(*)(void))(intptr_t)v11433)(); -c02_07ac:; +c01_07b9:; - goto c02_07a7; + goto c01_07b4; -c02_07ab:; +c01_07b8:; - i8 v11408 = (i8)(intptr_t)(ws+24); - i8 v11409 = *(i8*)(intptr_t)v11408; - i8 v11410 = (i8)+0; - if (v11409==v11410) goto c02_07b4; else goto c02_07b5; + i8 v11434 = (i8)(intptr_t)(ws+24); + i8 v11435 = *(i8*)(intptr_t)v11434; + i8 v11436 = (i8)+0; + if (v11435==v11436) goto c01_07c1; else goto c01_07c2; -c02_07b4:; +c01_07c1:; - i8 v11411 = (i8)(intptr_t)(ws+3272); - i8 v11412 = *(i8*)(intptr_t)v11411; - i8 v11413 = (i8)(intptr_t)(ws+24); - *(i8*)(intptr_t)v11413 = v11412; + i8 v11437 = (i8)(intptr_t)(ws+3272); + i8 v11438 = *(i8*)(intptr_t)v11437; + i8 v11439 = (i8)(intptr_t)(ws+24); + *(i8*)(intptr_t)v11439 = v11438; - goto c02_07b1; + goto c01_07be; -c02_07b5:; +c01_07c2:; - i8 v11414 = (i8)(intptr_t)(ws+32); - i8 v11415 = *(i8*)(intptr_t)v11414; - i8 v11416 = (i8)+0; - if (v11415==v11416) goto c02_07b8; else goto c02_07b9; + i8 v11440 = (i8)(intptr_t)(ws+32); + i8 v11441 = *(i8*)(intptr_t)v11440; + i8 v11442 = (i8)+0; + if (v11441==v11442) goto c01_07c5; else goto c01_07c6; -c02_07b8:; +c01_07c5:; - i8 v11417 = (i8)(intptr_t)(ws+3272); - i8 v11418 = *(i8*)(intptr_t)v11417; - i8 v11419 = (i8)(intptr_t)(ws+32); - *(i8*)(intptr_t)v11419 = v11418; + i8 v11443 = (i8)(intptr_t)(ws+3272); + i8 v11444 = *(i8*)(intptr_t)v11443; + i8 v11445 = (i8)(intptr_t)(ws+32); + *(i8*)(intptr_t)v11445 = v11444; - goto c02_07b1; + goto c01_07be; -c02_07b9:; +c01_07c6:; - i8 v11420 = (i8)(intptr_t)(f446_SyntaxError); + i8 v11446 = (i8)(intptr_t)(f448_SyntaxError); - ((void(*)(void))(intptr_t)v11420)(); + ((void(*)(void))(intptr_t)v11446)(); -c02_07b1:; +c01_07be:; -c02_07a7:; +c01_07b4:; - goto c02_07a0; + goto c01_07ad; -c02_07a1:; +c01_07ae:; - i8 v11421 = (i8)(intptr_t)(ws+24); - i8 v11422 = *(i8*)(intptr_t)v11421; - i8 v11423 = (i8)+0; - if (v11422==v11423) goto c02_07bf; else goto c02_07c1; + i8 v11447 = (i8)(intptr_t)(ws+24); + i8 v11448 = *(i8*)(intptr_t)v11447; + i8 v11449 = (i8)+0; + if (v11448==v11449) goto c01_07cc; else goto c01_07ce; -c02_07c1:; +c01_07ce:; - i8 v11424 = (i8)(intptr_t)(ws+32); - i8 v11425 = *(i8*)(intptr_t)v11424; - i8 v11426 = (i8)+0; - if (v11425==v11426) goto c02_07bf; else goto c02_07c0; + i8 v11450 = (i8)(intptr_t)(ws+32); + i8 v11451 = *(i8*)(intptr_t)v11450; + i8 v11452 = (i8)+0; + if (v11451==v11452) goto c01_07cc; else goto c01_07cd; -c02_07bf:; +c01_07cc:; - i8 v11427 = (i8)(intptr_t)(f446_SyntaxError); + i8 v11453 = (i8)(intptr_t)(f448_SyntaxError); - ((void(*)(void))(intptr_t)v11427)(); + ((void(*)(void))(intptr_t)v11453)(); -c02_07c0:; +c01_07cd:; -c02_07ba:; +c01_07c7:; } -const i1 c02_s0195[] = { 0x43,0x4f,0x57,0x46,0x45,0x3a,0x20,0 }; - void f12_print(void); - void f445_PrintFreeMemory(void); - void f447_ParseArguments(void); -const i1 c02_s0196[] = { 0 }; - void f77_LexerAddIncludePath(void); - void f81_LexerIncludeFile(void); - void f266_CreateMainSubroutine(void); - void f240_ArchInitTypes(void); - void f196_EmitterOpenfile(void); - void f198_EmitterDeclareSubroutine(void); - void f116_MidStartfile(void); - void f257_Generate(void); +const i1 c01_s0196[] = { 0x43,0x4f,0x57,0x46,0x45,0x3a,0x20,0 }; + void f11_print(void); + void f447_PrintFreeMemory(void); + void f449_ParseArguments(void); +const i1 c01_s0197[] = { 0 }; + void f76_LexerAddIncludePath(void); + void f80_LexerIncludeFile(void); + void f265_CreateMainSubroutine(void); + void f239_ArchInitTypes(void); + void f195_EmitterOpenfile(void); + void f197_EmitterDeclareSubroutine(void); + void f153_MidStartfile(void); + void f256_Generate(void); void f157_MidStartsub(void); - void f257_Generate(void); - void f442_ParserInit(void); - void f82_LexerReadToken(void); - void f72_InternalStrDup(void); - void f72_InternalStrDup(void); - void f444_ParserFeedToken(void); - void f443_ParserDeinit(void); - void f120_MidEndsub(void); - void f257_Generate(void); - void f267_ReportWorkspaces(void); - void f148_MidEndfile(void); - void f257_Generate(void); - void f197_EmitterClosefile(void); -const i1 c02_s0197[] = { 0x64,0x6f,0x6e,0x65,0x3a,0x20,0 }; - void f12_print(void); - void f445_PrintFreeMemory(void); + void f256_Generate(void); + void f444_ParserInit(void); + void f81_LexerReadToken(void); + void f71_InternalStrDup(void); + void f71_InternalStrDup(void); + void f446_ParserFeedToken(void); + void f445_ParserDeinit(void); + void f103_MidEndsub(void); + void f256_Generate(void); + void f266_ReportWorkspaces(void); + void f152_MidEndfile(void); + void f256_Generate(void); + void f196_EmitterClosefile(void); +const i1 c01_s0198[] = { 0x64,0x6f,0x6e,0x65,0x3a,0x20,0 }; + void f11_print(void); + void f447_PrintFreeMemory(void); // __main workspace at ws+0 length ws+3264 -void f3___main(void) { +void f2___main(void) { @@ -30088,255 +30078,257 @@ void f3___main(void) { - i8 v11428 = (i8)(intptr_t)c02_s0195; - *(i8*)(intptr_t)(ws+3696) = v11428; - i8 v11429 = (i8)(intptr_t)(f12_print); - ((void(*)(void))(intptr_t)v11429)(); - i8 v11430 = (i8)(intptr_t)(f445_PrintFreeMemory); + i8 v11454 = (i8)(intptr_t)c01_s0196; + *(i8*)(intptr_t)(ws+3696) = v11454; + i8 v11455 = (i8)(intptr_t)(f11_print); - ((void(*)(void))(intptr_t)v11430)(); + ((void(*)(void))(intptr_t)v11455)(); - i8 v11431 = (i8)(intptr_t)(f447_ParseArguments); + i8 v11456 = (i8)(intptr_t)(f447_PrintFreeMemory); - ((void(*)(void))(intptr_t)v11431)(); + ((void(*)(void))(intptr_t)v11456)(); - i8 v11432 = (i8)(intptr_t)c02_s0196; - *(i8*)(intptr_t)(ws+3280) = v11432; - i8 v11433 = (i8)(intptr_t)(f77_LexerAddIncludePath); + i8 v11457 = (i8)(intptr_t)(f449_ParseArguments); - ((void(*)(void))(intptr_t)v11433)(); + ((void(*)(void))(intptr_t)v11457)(); - i8 v11434 = (i8)(intptr_t)(ws+24); - i8 v11435 = *(i8*)(intptr_t)v11434; - *(i8*)(intptr_t)(ws+3288) = v11435; - i8 v11436 = (i8)(intptr_t)(f81_LexerIncludeFile); + i8 v11458 = (i8)(intptr_t)c01_s0197; + *(i8*)(intptr_t)(ws+3280) = v11458; + i8 v11459 = (i8)(intptr_t)(f76_LexerAddIncludePath); + + ((void(*)(void))(intptr_t)v11459)(); - ((void(*)(void))(intptr_t)v11436)(); + i8 v11460 = (i8)(intptr_t)(ws+24); + i8 v11461 = *(i8*)(intptr_t)v11460; + *(i8*)(intptr_t)(ws+3288) = v11461; + i8 v11462 = (i8)(intptr_t)(f80_LexerIncludeFile); - i8 v11437 = (i8)(intptr_t)(f266_CreateMainSubroutine); + ((void(*)(void))(intptr_t)v11462)(); - ((void(*)(void))(intptr_t)v11437)(); + i8 v11463 = (i8)(intptr_t)(f265_CreateMainSubroutine); - i8 v11438 = (i8)(intptr_t)(f240_ArchInitTypes); + ((void(*)(void))(intptr_t)v11463)(); - ((void(*)(void))(intptr_t)v11438)(); + i8 v11464 = (i8)(intptr_t)(f239_ArchInitTypes); - i8 v11439 = (i8)(intptr_t)(ws+32); - i8 v11440 = *(i8*)(intptr_t)v11439; - *(i8*)(intptr_t)(ws+3264) = v11440; - i8 v11441 = (i8)(intptr_t)(f196_EmitterOpenfile); + ((void(*)(void))(intptr_t)v11464)(); - ((void(*)(void))(intptr_t)v11441)(); + i8 v11465 = (i8)(intptr_t)(ws+32); + i8 v11466 = *(i8*)(intptr_t)v11465; + *(i8*)(intptr_t)(ws+3264) = v11466; + i8 v11467 = (i8)(intptr_t)(f195_EmitterOpenfile); - i8 v11442 = (i8)(intptr_t)(ws+40); - i8 v11443 = *(i8*)(intptr_t)v11442; - *(i8*)(intptr_t)(ws+3416) = v11443; - i8 v11444 = (i8)(intptr_t)(f198_EmitterDeclareSubroutine); + ((void(*)(void))(intptr_t)v11467)(); - ((void(*)(void))(intptr_t)v11444)(); + i8 v11468 = (i8)(intptr_t)(ws+40); + i8 v11469 = *(i8*)(intptr_t)v11468; + *(i8*)(intptr_t)(ws+3416) = v11469; + i8 v11470 = (i8)(intptr_t)(f197_EmitterDeclareSubroutine); - i8 v11445 = (i8)(intptr_t)(f116_MidStartfile); + ((void(*)(void))(intptr_t)v11470)(); - ((void(*)(void))(intptr_t)v11445)(); + i8 v11471 = (i8)(intptr_t)(f153_MidStartfile); - i8 v11446 = *(i8*)(intptr_t)(ws+3264); - i8 v11447 = (i8)(intptr_t)(ws+3200); - *(i8*)(intptr_t)v11447 = v11446; + ((void(*)(void))(intptr_t)v11471)(); - i8 v11448 = (i8)(intptr_t)(ws+3200); - i8 v11449 = *(i8*)(intptr_t)v11448; - *(i8*)(intptr_t)(ws+3488) = v11449; - i8 v11450 = (i8)(intptr_t)(f257_Generate); + i8 v11472 = *(i8*)(intptr_t)(ws+3264); + i8 v11473 = (i8)(intptr_t)(ws+3200); + *(i8*)(intptr_t)v11473 = v11472; - ((void(*)(void))(intptr_t)v11450)(); + i8 v11474 = (i8)(intptr_t)(ws+3200); + i8 v11475 = *(i8*)(intptr_t)v11474; + *(i8*)(intptr_t)(ws+3488) = v11475; + i8 v11476 = (i8)(intptr_t)(f256_Generate); - i8 v11451 = (i8)(intptr_t)(ws+40); - i8 v11452 = *(i8*)(intptr_t)v11451; - *(i8*)(intptr_t)(ws+3408) = v11452; - i8 v11453 = (i8)(intptr_t)(f157_MidStartsub); + ((void(*)(void))(intptr_t)v11476)(); - ((void(*)(void))(intptr_t)v11453)(); + i8 v11477 = (i8)(intptr_t)(ws+40); + i8 v11478 = *(i8*)(intptr_t)v11477; + *(i8*)(intptr_t)(ws+3408) = v11478; + i8 v11479 = (i8)(intptr_t)(f157_MidStartsub); - i8 v11454 = *(i8*)(intptr_t)(ws+3416); - i8 v11455 = (i8)(intptr_t)(ws+3208); - *(i8*)(intptr_t)v11455 = v11454; + ((void(*)(void))(intptr_t)v11479)(); - i8 v11456 = (i8)(intptr_t)(ws+3208); - i8 v11457 = *(i8*)(intptr_t)v11456; - *(i8*)(intptr_t)(ws+3488) = v11457; - i8 v11458 = (i8)(intptr_t)(f257_Generate); + i8 v11480 = *(i8*)(intptr_t)(ws+3416); + i8 v11481 = (i8)(intptr_t)(ws+3208); + *(i8*)(intptr_t)v11481 = v11480; - ((void(*)(void))(intptr_t)v11458)(); + i8 v11482 = (i8)(intptr_t)(ws+3208); + i8 v11483 = *(i8*)(intptr_t)v11482; + *(i8*)(intptr_t)(ws+3488) = v11483; + i8 v11484 = (i8)(intptr_t)(f256_Generate); - i8 v11459 = (i8)(intptr_t)(f442_ParserInit); + ((void(*)(void))(intptr_t)v11484)(); - ((void(*)(void))(intptr_t)v11459)(); + i8 v11485 = (i8)(intptr_t)(f444_ParserInit); -c02_07c2:; + ((void(*)(void))(intptr_t)v11485)(); - i8 v11460 = (i8)(intptr_t)(f82_LexerReadToken); +c01_07cf:; - ((void(*)(void))(intptr_t)v11460)(); + i8 v11486 = (i8)(intptr_t)(f81_LexerReadToken); - i1 v11461 = *(i1*)(intptr_t)(ws+3264); - i8 v11462 = (i8)(intptr_t)(ws+3216); - *(i1*)(intptr_t)v11462 = v11461; + ((void(*)(void))(intptr_t)v11486)(); - i8 v11463 = (i8)(intptr_t)(ws+3216); - i1 v11464 = *(i1*)(intptr_t)v11463; - i8 v11465 = (i8)(intptr_t)(ws+3217); - *(i1*)(intptr_t)v11465 = v11464; + i1 v11487 = *(i1*)(intptr_t)(ws+3264); + i8 v11488 = (i8)(intptr_t)(ws+3216); + *(i1*)(intptr_t)v11488 = v11487; - i8 v11466 = (i8)(intptr_t)(ws+3217); - i1 v11467 = *(i1*)(intptr_t)v11466; + i8 v11489 = (i8)(intptr_t)(ws+3216); + i1 v11490 = *(i1*)(intptr_t)v11489; + i8 v11491 = (i8)(intptr_t)(ws+3217); + *(i1*)(intptr_t)v11491 = v11490; - if (v11467 != +34) goto c02_07c5; + i8 v11492 = (i8)(intptr_t)(ws+3217); + i1 v11493 = *(i1*)(intptr_t)v11492; - i8 v11468 = (i8)(intptr_t)(ws+396); - i4 v11469 = *(i4*)(intptr_t)v11468; - i8 v11470 = (i8)(intptr_t)(ws+3224); - *(i4*)(intptr_t)v11470 = v11469; + if (v11493 != +34) goto c01_07d2; - goto c02_07c4; + i8 v11494 = (i8)(intptr_t)(ws+396); + i4 v11495 = *(i4*)(intptr_t)v11494; + i8 v11496 = (i8)(intptr_t)(ws+3224); + *(i4*)(intptr_t)v11496 = v11495; -c02_07c5:; + goto c01_07d1; - if (v11467 != +33) goto c02_07c6; +c01_07d2:; - i8 v11471 = (i8)(intptr_t)(ws+265); - *(i8*)(intptr_t)(ws+3464) = v11471; - i8 v11472 = (i8)(intptr_t)(f72_InternalStrDup); + if (v11493 != +33) goto c01_07d3; - ((void(*)(void))(intptr_t)v11472)(); + i8 v11497 = (i8)(intptr_t)(ws+265); + *(i8*)(intptr_t)(ws+3464) = v11497; + i8 v11498 = (i8)(intptr_t)(f71_InternalStrDup); - i8 v11473 = *(i8*)(intptr_t)(ws+3472); - i8 v11474 = (i8)(intptr_t)(ws+3232); - *(i8*)(intptr_t)v11474 = v11473; + ((void(*)(void))(intptr_t)v11498)(); - i8 v11475 = (i8)(intptr_t)(ws+3232); - i8 v11476 = *(i8*)(intptr_t)v11475; - i8 v11477 = (i8)(intptr_t)(ws+3224); - *(i8*)(intptr_t)v11477 = v11476; + i8 v11499 = *(i8*)(intptr_t)(ws+3472); + i8 v11500 = (i8)(intptr_t)(ws+3232); + *(i8*)(intptr_t)v11500 = v11499; - goto c02_07c4; + i8 v11501 = (i8)(intptr_t)(ws+3232); + i8 v11502 = *(i8*)(intptr_t)v11501; + i8 v11503 = (i8)(intptr_t)(ws+3224); + *(i8*)(intptr_t)v11503 = v11502; -c02_07c6:; + goto c01_07d1; - if (v11467 != +41) goto c02_07c7; +c01_07d3:; - i8 v11478 = (i8)(intptr_t)(ws+265); - *(i8*)(intptr_t)(ws+3464) = v11478; - i8 v11479 = (i8)(intptr_t)(f72_InternalStrDup); + if (v11493 != +41) goto c01_07d4; - ((void(*)(void))(intptr_t)v11479)(); + i8 v11504 = (i8)(intptr_t)(ws+265); + *(i8*)(intptr_t)(ws+3464) = v11504; + i8 v11505 = (i8)(intptr_t)(f71_InternalStrDup); - i8 v11480 = *(i8*)(intptr_t)(ws+3472); - i8 v11481 = (i8)(intptr_t)(ws+3240); - *(i8*)(intptr_t)v11481 = v11480; + ((void(*)(void))(intptr_t)v11505)(); - i8 v11482 = (i8)(intptr_t)(ws+3240); - i8 v11483 = *(i8*)(intptr_t)v11482; - i8 v11484 = (i8)(intptr_t)(ws+3224); - *(i8*)(intptr_t)v11484 = v11483; + i8 v11506 = *(i8*)(intptr_t)(ws+3472); + i8 v11507 = (i8)(intptr_t)(ws+3240); + *(i8*)(intptr_t)v11507 = v11506; - goto c02_07c4; + i8 v11508 = (i8)(intptr_t)(ws+3240); + i8 v11509 = *(i8*)(intptr_t)v11508; + i8 v11510 = (i8)(intptr_t)(ws+3224); + *(i8*)(intptr_t)v11510 = v11509; -c02_07c7:; + goto c01_07d1; - i4 v11485 = (i4)+0; - i8 v11486 = (i8)(intptr_t)(ws+3224); - *(i4*)(intptr_t)v11486 = v11485; +c01_07d4:; -c02_07c4:; + i4 v11511 = (i4)+0; + i8 v11512 = (i8)(intptr_t)(ws+3224); + *(i4*)(intptr_t)v11512 = v11511; +c01_07d1:; - i8 v11487 = (i8)(intptr_t)(ws+3217); - i1 v11488 = *(i1*)(intptr_t)v11487; - *(i1*)(intptr_t)(ws+3264) = v11488; - i8 v11489 = (i8)(intptr_t)(ws+3224); - *(i8*)(intptr_t)(ws+3272) = v11489; - i8 v11490 = (i8)(intptr_t)(f444_ParserFeedToken); - ((void(*)(void))(intptr_t)v11490)(); + i8 v11513 = (i8)(intptr_t)(ws+3217); + i1 v11514 = *(i1*)(intptr_t)v11513; + *(i1*)(intptr_t)(ws+3264) = v11514; + i8 v11515 = (i8)(intptr_t)(ws+3224); + *(i8*)(intptr_t)(ws+3272) = v11515; + i8 v11516 = (i8)(intptr_t)(f446_ParserFeedToken); - i8 v11491 = (i8)(intptr_t)(ws+3217); - i1 v11492 = *(i1*)(intptr_t)v11491; - i1 v11493 = (i1)+0; - if (v11492==v11493) goto c02_07cb; else goto c02_07cc; + ((void(*)(void))(intptr_t)v11516)(); -c02_07cb:; + i8 v11517 = (i8)(intptr_t)(ws+3217); + i1 v11518 = *(i1*)(intptr_t)v11517; + i1 v11519 = (i1)+0; + if (v11518==v11519) goto c01_07d8; else goto c01_07d9; - goto c02_07c3; +c01_07d8:; -c02_07cc:; + goto c01_07d0; -c02_07c8:; +c01_07d9:; - goto c02_07c2; +c01_07d5:; -c02_07c3:; + goto c01_07cf; - i8 v11494 = (i8)(intptr_t)(f443_ParserDeinit); +c01_07d0:; - ((void(*)(void))(intptr_t)v11494)(); + i8 v11520 = (i8)(intptr_t)(f445_ParserDeinit); - i8 v11495 = (i8)(intptr_t)(ws+40); - i8 v11496 = *(i8*)(intptr_t)v11495; - *(i8*)(intptr_t)(ws+3408) = v11496; - i8 v11497 = (i8)(intptr_t)(f120_MidEndsub); + ((void(*)(void))(intptr_t)v11520)(); - ((void(*)(void))(intptr_t)v11497)(); + i8 v11521 = (i8)(intptr_t)(ws+40); + i8 v11522 = *(i8*)(intptr_t)v11521; + *(i8*)(intptr_t)(ws+3408) = v11522; + i8 v11523 = (i8)(intptr_t)(f103_MidEndsub); - i8 v11498 = *(i8*)(intptr_t)(ws+3416); - i8 v11499 = (i8)(intptr_t)(ws+3248); - *(i8*)(intptr_t)v11499 = v11498; + ((void(*)(void))(intptr_t)v11523)(); - i8 v11500 = (i8)(intptr_t)(ws+3248); - i8 v11501 = *(i8*)(intptr_t)v11500; - *(i8*)(intptr_t)(ws+3488) = v11501; - i8 v11502 = (i8)(intptr_t)(f257_Generate); + i8 v11524 = *(i8*)(intptr_t)(ws+3416); + i8 v11525 = (i8)(intptr_t)(ws+3248); + *(i8*)(intptr_t)v11525 = v11524; - ((void(*)(void))(intptr_t)v11502)(); + i8 v11526 = (i8)(intptr_t)(ws+3248); + i8 v11527 = *(i8*)(intptr_t)v11526; + *(i8*)(intptr_t)(ws+3488) = v11527; + i8 v11528 = (i8)(intptr_t)(f256_Generate); - i8 v11503 = (i8)(intptr_t)(ws+40); - i8 v11504 = *(i8*)(intptr_t)v11503; - *(i8*)(intptr_t)(ws+3408) = v11504; - i8 v11505 = (i8)(intptr_t)(f267_ReportWorkspaces); + ((void(*)(void))(intptr_t)v11528)(); - ((void(*)(void))(intptr_t)v11505)(); + i8 v11529 = (i8)(intptr_t)(ws+40); + i8 v11530 = *(i8*)(intptr_t)v11529; + *(i8*)(intptr_t)(ws+3408) = v11530; + i8 v11531 = (i8)(intptr_t)(f266_ReportWorkspaces); + + ((void(*)(void))(intptr_t)v11531)(); - i8 v11506 = (i8)(intptr_t)(f148_MidEndfile); + i8 v11532 = (i8)(intptr_t)(f152_MidEndfile); - ((void(*)(void))(intptr_t)v11506)(); + ((void(*)(void))(intptr_t)v11532)(); - i8 v11507 = *(i8*)(intptr_t)(ws+3264); - i8 v11508 = (i8)(intptr_t)(ws+3256); - *(i8*)(intptr_t)v11508 = v11507; + i8 v11533 = *(i8*)(intptr_t)(ws+3264); + i8 v11534 = (i8)(intptr_t)(ws+3256); + *(i8*)(intptr_t)v11534 = v11533; - i8 v11509 = (i8)(intptr_t)(ws+3256); - i8 v11510 = *(i8*)(intptr_t)v11509; - *(i8*)(intptr_t)(ws+3488) = v11510; - i8 v11511 = (i8)(intptr_t)(f257_Generate); + i8 v11535 = (i8)(intptr_t)(ws+3256); + i8 v11536 = *(i8*)(intptr_t)v11535; + *(i8*)(intptr_t)(ws+3488) = v11536; + i8 v11537 = (i8)(intptr_t)(f256_Generate); - ((void(*)(void))(intptr_t)v11511)(); + ((void(*)(void))(intptr_t)v11537)(); - i8 v11512 = (i8)(intptr_t)(f197_EmitterClosefile); + i8 v11538 = (i8)(intptr_t)(f196_EmitterClosefile); - ((void(*)(void))(intptr_t)v11512)(); + ((void(*)(void))(intptr_t)v11538)(); - i8 v11513 = (i8)(intptr_t)c02_s0197; - *(i8*)(intptr_t)(ws+3696) = v11513; - i8 v11514 = (i8)(intptr_t)(f12_print); + i8 v11539 = (i8)(intptr_t)c01_s0198; + *(i8*)(intptr_t)(ws+3696) = v11539; + i8 v11540 = (i8)(intptr_t)(f11_print); - ((void(*)(void))(intptr_t)v11514)(); + ((void(*)(void))(intptr_t)v11540)(); - i8 v11515 = (i8)(intptr_t)(f445_PrintFreeMemory); + i8 v11541 = (i8)(intptr_t)(f447_PrintFreeMemory); - ((void(*)(void))(intptr_t)v11515)(); + ((void(*)(void))(intptr_t)v11541)(); } void cmain(void) { - f3___main(); + f2___main(); } diff --git a/bootstrap/cowlink-cgen.bootstrap.c b/bootstrap/cowlink-cgen.bootstrap.c index 1590a791..94a900cf 100644 --- a/bootstrap/cowlink-cgen.bootstrap.c +++ b/bootstrap/cowlink-cgen.bootstrap.c @@ -3,7 +3,7 @@ static i8 workspace[0x01a8]; #define ws ((i1*)workspace) // ExitWithError workspace at ws+3312 length ws+0 -void f6_ExitWithError(void) { +void f5_ExitWithError(void) { @@ -14,7 +14,7 @@ exit(1); } // MemSet workspace at ws+848 length ws+24 -void f7_MemSet(void) { +void f6_MemSet(void) { @@ -31,7 +31,7 @@ memset((void*)(intptr_t) } // print_char workspace at ws+3352 length ws+1 -void f9_print_char(void) { +void f8_print_char(void) { @@ -42,12 +42,12 @@ putchar( } - void f9_print_char(void); + void f8_print_char(void); // print workspace at ws+3336 length ws+9 -void f12_print(void) { +void f11_print(void) { -c02_0001:; +c01_0001:; i8 v6 = (i8)(intptr_t)(ws+3336); i8 v7 = *(i8*)(intptr_t)v6; @@ -58,20 +58,20 @@ c02_0001:; i8 v10 = (i8)(intptr_t)(ws+3344); i1 v11 = *(i1*)(intptr_t)v10; i1 v12 = (i1)+0; - if (v11==v12) goto c02_0006; else goto c02_0007; + if (v11==v12) goto c01_0006; else goto c01_0007; -c02_0006:; +c01_0006:; return; -c02_0007:; +c01_0007:; -c02_0003:; +c01_0003:; i8 v13 = (i8)(intptr_t)(ws+3344); i1 v14 = *(i1*)(intptr_t)v13; *(i1*)(intptr_t)(ws+3352) = v14; - i8 v15 = (i8)(intptr_t)(f9_print_char); + i8 v15 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v15)(); @@ -81,33 +81,33 @@ c02_0003:; i8 v19 = (i8)(intptr_t)(ws+3336); *(i8*)(intptr_t)v19 = v18; - goto c02_0001; + goto c01_0001; -c02_0002:; +c01_0002:; } - void f9_print_char(void); + void f8_print_char(void); // print_nl workspace at ws+1056 length ws+0 -void f13_print_nl(void) { +void f12_print_nl(void) { i1 v20 = (i1)+10; *(i1*)(intptr_t)(ws+3352) = v20; - i8 v21 = (i8)(intptr_t)(f9_print_char); + i8 v21 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v21)(); } // UIToA workspace at ws+3336 length ws+49 -void f14_UIToA(void) { +void f13_UIToA(void) { i8 v22 = (i8)(intptr_t)(ws+3344); i8 v23 = *(i8*)(intptr_t)v22; i8 v24 = (i8)(intptr_t)(ws+3352); *(i8*)(intptr_t)v24 = v23; -c02_0008:; +c01_0008:; i8 v25 = (i8)(intptr_t)(ws+3336); i4 v26 = *(i4*)(intptr_t)v25; @@ -130,9 +130,9 @@ c02_0008:; i8 v39 = (i8)(intptr_t)(ws+3360); i4 v40 = *(i4*)(intptr_t)v39; i4 v41 = (i4)+10; - if (v40>v178; i1 v180 = v179; *(i1*)(intptr_t)(ws+1056) = v180; - i8 v181 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v181 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v181)(); @@ -406,18 +406,18 @@ void f20_print_hex_i16(void) { i2 v183 = *(i2*)(intptr_t)v182; i1 v184 = v183; *(i1*)(intptr_t)(ws+1056) = v184; - i8 v185 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v185 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v185)(); } - void f19_print_hex_i8(void); - void f19_print_hex_i8(void); - void f19_print_hex_i8(void); - void f19_print_hex_i8(void); + void f18_print_hex_i8(void); + void f18_print_hex_i8(void); + void f18_print_hex_i8(void); + void f18_print_hex_i8(void); // print_hex_i32 workspace at ws+1048 length ws+4 -void f21_print_hex_i32(void) { +void f20_print_hex_i32(void) { i8 v186 = (i8)(intptr_t)(ws+1048); i4 v187 = *(i4*)(intptr_t)v186; @@ -425,7 +425,7 @@ void f21_print_hex_i32(void) { i4 v189 = ((i4)v187)>>v188; i1 v190 = v189; *(i1*)(intptr_t)(ws+1056) = v190; - i8 v191 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v191 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v191)(); @@ -435,7 +435,7 @@ void f21_print_hex_i32(void) { i4 v195 = ((i4)v193)>>v194; i1 v196 = v195; *(i1*)(intptr_t)(ws+1056) = v196; - i8 v197 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v197 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v197)(); @@ -445,7 +445,7 @@ void f21_print_hex_i32(void) { i4 v201 = ((i4)v199)>>v200; i1 v202 = v201; *(i1*)(intptr_t)(ws+1056) = v202; - i8 v203 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v203 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v203)(); @@ -453,15 +453,15 @@ void f21_print_hex_i32(void) { i4 v205 = *(i4*)(intptr_t)v204; i1 v206 = v205; *(i1*)(intptr_t)(ws+1056) = v206; - i8 v207 = (i8)(intptr_t)(f19_print_hex_i8); + i8 v207 = (i8)(intptr_t)(f18_print_hex_i8); ((void(*)(void))(intptr_t)v207)(); } - void f7_MemSet(void); + void f6_MemSet(void); // MemZero workspace at ws+832 length ws+16 -void f23_MemZero(void) { +void f22_MemZero(void) { i8 v309 = (i8)(intptr_t)(ws+832); i8 v310 = *(i8*)(intptr_t)v309; @@ -471,14 +471,14 @@ void f23_MemZero(void) { i8 v312 = (i8)(intptr_t)(ws+840); i8 v313 = *(i8*)(intptr_t)v312; *(i8*)(intptr_t)(ws+864) = v313; - i8 v314 = (i8)(intptr_t)(f7_MemSet); + i8 v314 = (i8)(intptr_t)(f6_MemSet); ((void(*)(void))(intptr_t)v314)(); } // ArgvInit workspace at ws+832 length ws+0 -void f24_ArgvInit(void) { +void f23_ArgvInit(void) { @@ -496,14 +496,14 @@ void f24_ArgvInit(void) { } // ArgvNext workspace at ws+832 length ws+8 -void f25_ArgvNext(void) { +void f24_ArgvNext(void) { i8 v319 = (i8)(intptr_t)(ws+16); i8 v320 = *(i8*)(intptr_t)v319; i8 v321 = (i8)+0; - if (v320==v321) goto c02_0052; else goto c02_0053; + if (v320==v321) goto c01_0052; else goto c01_0053; -c02_0052:; +c01_0052:; i8 v322 = (i8)+0; i8 v323 = (i8)(intptr_t)(ws+832); @@ -511,9 +511,9 @@ c02_0052:; return; -c02_0053:; +c01_0053:; -c02_004f:; +c01_004f:; i8 v324 = (i8)(intptr_t)(ws+16); i8 v325 = *(i8*)(intptr_t)v324; @@ -524,17 +524,17 @@ c02_004f:; i8 v328 = (i8)(intptr_t)(ws+832); i8 v329 = *(i8*)(intptr_t)v328; i8 v330 = (i8)+0; - if (v329==v330) goto c02_0057; else goto c02_0058; + if (v329==v330) goto c01_0057; else goto c01_0058; -c02_0057:; +c01_0057:; i8 v331 = (i8)+0; i8 v332 = (i8)(intptr_t)(ws+16); *(i8*)(intptr_t)v332 = v331; - goto c02_0054; + goto c01_0054; -c02_0058:; +c01_0058:; i8 v333 = (i8)(intptr_t)(ws+16); i8 v334 = *(i8*)(intptr_t)v333; @@ -542,14 +542,14 @@ c02_0058:; i8 v336 = (i8)(intptr_t)(ws+16); *(i8*)(intptr_t)v336 = v335; -c02_0054:; +c01_0054:; } // StrCmp workspace at ws+1088 length ws+17 -void f26_StrCmp(void) { +void f25_StrCmp(void) { -c02_0059:; +c01_0059:; i8 v337 = (i8)(intptr_t)(ws+1088); i8 v338 = *(i8*)(intptr_t)v337; @@ -564,23 +564,23 @@ c02_0059:; i8 v345 = (i8)(intptr_t)(ws+1104); i1 v346 = *(i1*)(intptr_t)v345; i1 v347 = (i1)+0; - if (v346==v347) goto c02_0062; else goto c02_0060; + if (v346==v347) goto c01_0062; else goto c01_0060; -c02_0062:; +c01_0062:; i8 v348 = (i8)(intptr_t)(ws+1088); i8 v349 = *(i8*)(intptr_t)v348; i1 v350 = *(i1*)(intptr_t)v349; i1 v351 = (i1)+0; - if (v350==v351) goto c02_0060; else goto c02_0061; + if (v350==v351) goto c01_0060; else goto c01_0061; -c02_0060:; +c01_0060:; - goto c02_005a; + goto c01_005a; -c02_0061:; +c01_0061:; -c02_005b:; +c01_005b:; i8 v352 = (i8)(intptr_t)(ws+1088); i8 v353 = *(i8*)(intptr_t)v352; @@ -594,28 +594,28 @@ c02_005b:; i8 v359 = (i8)(intptr_t)(ws+1096); *(i8*)(intptr_t)v359 = v358; - goto c02_0059; + goto c01_0059; -c02_005a:; +c01_005a:; } // ToLower workspace at ws+856 length ws+2 -void f27_ToLower(void) { +void f26_ToLower(void) { i8 v360 = (i8)(intptr_t)(ws+856); i1 v361 = *(i1*)(intptr_t)v360; i1 v362 = (i1)+65; - if (v361>v1140; *(i2*)(intptr_t)(ws+840) = v1141; - i8 v1142 = (i8)(intptr_t)(f72_E_h16); + i8 v1142 = (i8)(intptr_t)(f71_E_h16); ((void(*)(void))(intptr_t)v1142)(); - i8 v1143 = (i8)(intptr_t)c02_s0009; + i8 v1143 = (i8)(intptr_t)c01_s0009; *(i8*)(intptr_t)(ws+1016) = v1143; - i8 v1144 = (i8)(intptr_t)(f65_E); + i8 v1144 = (i8)(intptr_t)(f64_E); ((void(*)(void))(intptr_t)v1144)(); - i8 v1145 = (i8)(intptr_t)c02_s000a; + i8 v1145 = (i8)(intptr_t)c01_s000a; *(i8*)(intptr_t)(ws+1016) = v1145; - i8 v1146 = (i8)(intptr_t)(f65_E); + i8 v1146 = (i8)(intptr_t)(f64_E); ((void(*)(void))(intptr_t)v1146)(); } -const i1 c02_s000b[] = { 0x76,0x6f,0x69,0x64,0x20,0x63,0x6d,0x61,0x69,0x6e,0x28,0x76,0x6f,0x69,0x64,0x29,0x20,0x7b,0x0a,0 }; - void f65_E(void); - void f64_E_b8(void); - void f77_ArchEmitSubRef(void); -const i1 c02_s000c[] = { 0x28,0x29,0x3b,0x0a,0 }; - void f65_E(void); -const i1 c02_s000d[] = { 0x7d,0x0a,0 }; - void f65_E(void); +const i1 c01_s000b[] = { 0x76,0x6f,0x69,0x64,0x20,0x63,0x6d,0x61,0x69,0x6e,0x28,0x76,0x6f,0x69,0x64,0x29,0x20,0x7b,0x0a,0 }; + void f64_E(void); + void f63_E_b8(void); + void f76_ArchEmitSubRef(void); +const i1 c01_s000c[] = { 0x28,0x29,0x3b,0x0a,0 }; + void f64_E(void); +const i1 c01_s000d[] = { 0x7d,0x0a,0 }; + void f64_E(void); // ArchEmitFooter workspace at ws+832 length ws+16 -void f80_ArchEmitFooter(void) { +void f79_ArchEmitFooter(void) { - i8 v1147 = (i8)(intptr_t)c02_s000b; + i8 v1147 = (i8)(intptr_t)c01_s000b; *(i8*)(intptr_t)(ws+1016) = v1147; - i8 v1148 = (i8)(intptr_t)(f65_E); + i8 v1148 = (i8)(intptr_t)(f64_E); ((void(*)(void))(intptr_t)v1148)(); -c02_0118:; +c01_0118:; i8 v1149 = (i8)(intptr_t)(ws+832); i8 v1150 = *(i8*)(intptr_t)v1149; i8 v1151 = (i8)+0; - if (v1150==v1151) goto c02_011d; else goto c02_011c; + if (v1150==v1151) goto c01_011d; else goto c01_011c; -c02_011c:; +c01_011c:; i8 v1152 = (i8)(intptr_t)(ws+832); i8 v1153 = *(i8*)(intptr_t)v1152; @@ -2239,32 +2239,32 @@ c02_011c:; i8 v1157 = (i8)(intptr_t)(ws+840); i8 v1158 = *(i8*)(intptr_t)v1157; i8 v1159 = (i8)+0; - if (v1158==v1159) goto c02_0122; else goto c02_0121; + if (v1158==v1159) goto c01_0122; else goto c01_0121; -c02_0121:; +c01_0121:; i1 v1160 = (i1)+9; *(i1*)(intptr_t)(ws+1032) = v1160; - i8 v1161 = (i8)(intptr_t)(f64_E_b8); + i8 v1161 = (i8)(intptr_t)(f63_E_b8); ((void(*)(void))(intptr_t)v1161)(); i8 v1162 = (i8)(intptr_t)(ws+840); i8 v1163 = *(i8*)(intptr_t)v1162; *(i8*)(intptr_t)(ws+968) = v1163; - i8 v1164 = (i8)(intptr_t)(f77_ArchEmitSubRef); + i8 v1164 = (i8)(intptr_t)(f76_ArchEmitSubRef); ((void(*)(void))(intptr_t)v1164)(); - i8 v1165 = (i8)(intptr_t)c02_s000c; + i8 v1165 = (i8)(intptr_t)c01_s000c; *(i8*)(intptr_t)(ws+1016) = v1165; - i8 v1166 = (i8)(intptr_t)(f65_E); + i8 v1166 = (i8)(intptr_t)(f64_E); ((void(*)(void))(intptr_t)v1166)(); -c02_0122:; +c01_0122:; -c02_011e:; +c01_011e:; i8 v1167 = (i8)(intptr_t)(ws+832); i8 v1168 = *(i8*)(intptr_t)v1167; @@ -2273,26 +2273,26 @@ c02_011e:; i8 v1171 = (i8)(intptr_t)(ws+832); *(i8*)(intptr_t)v1171 = v1170; - goto c02_0118; + goto c01_0118; -c02_011d:; +c01_011d:; - i8 v1172 = (i8)(intptr_t)c02_s000d; + i8 v1172 = (i8)(intptr_t)c01_s000d; *(i8*)(intptr_t)(ws+1016) = v1172; - i8 v1173 = (i8)(intptr_t)(f65_E); + i8 v1173 = (i8)(intptr_t)(f64_E); ((void(*)(void))(intptr_t)v1173)(); } - void f46_FCBGetChar(void); + void f45_FCBGetChar(void); // read_bin1 workspace at ws+1096 length ws+10 -void f81_read_bin1(void) { +void f80_read_bin1(void) { i8 v1176 = (i8)(intptr_t)(ws+1096); i8 v1177 = *(i8*)(intptr_t)v1176; *(i8*)(intptr_t)(ws+1112) = v1177; - i8 v1178 = (i8)(intptr_t)(f46_FCBGetChar); + i8 v1178 = (i8)(intptr_t)(f45_FCBGetChar); ((void(*)(void))(intptr_t)v1178)(); @@ -2306,16 +2306,16 @@ void f81_read_bin1(void) { *(i1*)(intptr_t)v1183 = v1182; } - void f81_read_bin1(void); - void f81_read_bin1(void); + void f80_read_bin1(void); + void f80_read_bin1(void); // read_bin2 workspace at ws+1048 length ws+12 -void f82_read_bin2(void) { +void f81_read_bin2(void) { i8 v1184 = (i8)(intptr_t)(ws+1048); i8 v1185 = *(i8*)(intptr_t)v1184; *(i8*)(intptr_t)(ws+1096) = v1185; - i8 v1186 = (i8)(intptr_t)(f81_read_bin1); + i8 v1186 = (i8)(intptr_t)(f80_read_bin1); ((void(*)(void))(intptr_t)v1186)(); @@ -2332,7 +2332,7 @@ void f82_read_bin2(void) { i8 v1193 = (i8)(intptr_t)(ws+1048); i8 v1194 = *(i8*)(intptr_t)v1193; *(i8*)(intptr_t)(ws+1096) = v1194; - i8 v1195 = (i8)(intptr_t)(f81_read_bin1); + i8 v1195 = (i8)(intptr_t)(f80_read_bin1); ((void(*)(void))(intptr_t)v1195)(); @@ -2352,18 +2352,18 @@ void f82_read_bin2(void) { *(i2*)(intptr_t)v1206 = v1205; } - void f33_Alloc(void); - void f81_read_bin1(void); + void f32_Alloc(void); + void f80_read_bin1(void); // read_string workspace at ws+1048 length ws+41 -void f83_read_string(void) { +void f82_read_string(void) { i8 v1207 = (i8)(intptr_t)(ws+1056); i1 v1208 = *(i1*)(intptr_t)v1207; i1 v1209 = v1208+(+1); i8 v1210 = v1209; *(i8*)(intptr_t)(ws+1136) = v1210; - i8 v1211 = (i8)(intptr_t)(f33_Alloc); + i8 v1211 = (i8)(intptr_t)(f32_Alloc); ((void(*)(void))(intptr_t)v1211)(); @@ -2381,25 +2381,25 @@ void f83_read_string(void) { i8 v1219 = (i8)(intptr_t)(ws+1080); *(i8*)(intptr_t)v1219 = v1218; -c02_0123:; +c01_0123:; i8 v1220 = (i8)(intptr_t)(ws+1056); i1 v1221 = *(i1*)(intptr_t)v1220; i1 v1222 = (i1)+0; - if (v1221==v1222) goto c02_0128; else goto c02_0129; + if (v1221==v1222) goto c01_0128; else goto c01_0129; -c02_0128:; +c01_0128:; - goto c02_0124; + goto c01_0124; -c02_0129:; +c01_0129:; -c02_0125:; +c01_0125:; i8 v1223 = (i8)(intptr_t)(ws+1048); i8 v1224 = *(i8*)(intptr_t)v1223; *(i8*)(intptr_t)(ws+1096) = v1224; - i8 v1225 = (i8)(intptr_t)(f81_read_bin1); + i8 v1225 = (i8)(intptr_t)(f80_read_bin1); ((void(*)(void))(intptr_t)v1225)(); @@ -2425,15 +2425,15 @@ c02_0125:; i8 v1239 = (i8)(intptr_t)(ws+1056); *(i1*)(intptr_t)v1239 = v1238; - goto c02_0123; + goto c01_0123; -c02_0124:; +c01_0124:; } - void f33_Alloc(void); + void f32_Alloc(void); // AddRef workspace at ws+1048 length ws+40 -void f84_AddRef(void) { +void f83_AddRef(void) { i8 v1240 = (i8)(intptr_t)(ws+1048); i8 v1241 = *(i8*)(intptr_t)v1240; @@ -2456,26 +2456,26 @@ void f84_AddRef(void) { i8 v1254 = (i8)(intptr_t)(ws+1072); *(i8*)(intptr_t)v1254 = v1253; -c02_012a:; +c01_012a:; i8 v1255 = (i8)(intptr_t)(ws+1064); i2 v1256 = *(i2*)(intptr_t)v1255; i2 v1257 = (i2)+16; - if (v1256>v2653; i2 v2655 = v2654; *(i2*)(intptr_t)(ws+3296) = v2655; - i8 v2656 = (i8)(intptr_t)(f17_print_i16); + i8 v2656 = (i8)(intptr_t)(f16_print_i16); ((void(*)(void))(intptr_t)v2656)(); - i8 v2657 = (i8)(intptr_t)c02_s0025; + i8 v2657 = (i8)(intptr_t)c01_s0025; *(i8*)(intptr_t)(ws+3336) = v2657; - i8 v2658 = (i8)(intptr_t)(f12_print); + i8 v2658 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v2658)(); @@ -5964,13 +5964,13 @@ void f3___main(void) { - i8 v2732 = (i8)(intptr_t)(f24_ArgvInit); + i8 v2732 = (i8)(intptr_t)(f23_ArgvInit); ((void(*)(void))(intptr_t)v2732)(); -c02_0273:; +c01_0273:; - i8 v2733 = (i8)(intptr_t)(f25_ArgvNext); + i8 v2733 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v2733)(); @@ -5986,22 +5986,22 @@ c02_0273:; i8 v2739 = (i8)(intptr_t)(ws+800); i8 v2740 = *(i8*)(intptr_t)v2739; i8 v2741 = (i8)+0; - if (v2740==v2741) goto c02_0278; else goto c02_0279; + if (v2740==v2741) goto c01_0278; else goto c01_0279; -c02_0278:; +c01_0278:; - goto c02_0274; + goto c01_0274; -c02_0279:; +c01_0279:; -c02_0275:; +c01_0275:; i8 v2742 = (i8)(intptr_t)(ws+800); i8 v2743 = *(i8*)(intptr_t)v2742; *(i8*)(intptr_t)(ws+832) = v2743; - i8 v2744 = (i8)(intptr_t)c02_s0028; + i8 v2744 = (i8)(intptr_t)c01_s0028; *(i8*)(intptr_t)(ws+840) = v2744; - i8 v2745 = (i8)(intptr_t)(f28_StrICmp); + i8 v2745 = (i8)(intptr_t)(f27_StrICmp); ((void(*)(void))(intptr_t)v2745)(); @@ -6012,11 +6012,11 @@ c02_0275:; i8 v2748 = (i8)(intptr_t)(ws+808); i1 v2749 = *(i1*)(intptr_t)v2748; i1 v2750 = (i1)+0; - if (v2749==v2750) goto c02_027d; else goto c02_027e; + if (v2749==v2750) goto c01_027d; else goto c01_027e; -c02_027d:; +c01_027d:; - i8 v2751 = (i8)(intptr_t)(f25_ArgvNext); + i8 v2751 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v2751)(); @@ -6029,170 +6029,170 @@ c02_027d:; i8 v2756 = (i8)(intptr_t)(ws+768); *(i8*)(intptr_t)v2756 = v2755; - goto c02_027a; + goto c01_027a; -c02_027e:; +c01_027e:; i8 v2757 = (i8)(intptr_t)(ws+800); i8 v2758 = *(i8*)(intptr_t)v2757; i1 v2759 = *(i1*)(intptr_t)v2758; i1 v2760 = (i1)+45; - if (v2759==v2760) goto c02_0281; else goto c02_0282; + if (v2759==v2760) goto c01_0281; else goto c01_0282; -c02_0281:; +c01_0281:; - i8 v2761 = (i8)(intptr_t)(f107_SyntaxError); + i8 v2761 = (i8)(intptr_t)(f106_SyntaxError); ((void(*)(void))(intptr_t)v2761)(); - goto c02_027a; + goto c01_027a; -c02_0282:; +c01_0282:; i8 v2762 = (i8)(intptr_t)(ws+800); i8 v2763 = *(i8*)(intptr_t)v2762; *(i8*)(intptr_t)(ws+832) = v2763; - i8 v2764 = (i8)(intptr_t)(f108_AddInputFile); + i8 v2764 = (i8)(intptr_t)(f107_AddInputFile); ((void(*)(void))(intptr_t)v2764)(); -c02_027a:; +c01_027a:; - goto c02_0273; + goto c01_0273; -c02_0274:; +c01_0274:; i8 v2765 = (i8)(intptr_t)(ws+776); i8 v2766 = *(i8*)(intptr_t)v2765; i8 v2767 = (i8)+0; - if (v2766==v2767) goto c02_0286; else goto c02_0287; + if (v2766==v2767) goto c01_0286; else goto c01_0287; -c02_0286:; +c01_0286:; - i8 v2768 = (i8)(intptr_t)c02_s0029; + i8 v2768 = (i8)(intptr_t)c01_s0029; *(i8*)(intptr_t)(ws+912) = v2768; - i8 v2769 = (i8)(intptr_t)(f62_SimpleError); + i8 v2769 = (i8)(intptr_t)(f61_SimpleError); ((void(*)(void))(intptr_t)v2769)(); -c02_0287:; +c01_0287:; -c02_0283:; +c01_0283:; i8 v2770 = (i8)(intptr_t)(ws+768); i8 v2771 = *(i8*)(intptr_t)v2770; i8 v2772 = (i8)+0; - if (v2771==v2772) goto c02_028b; else goto c02_028c; + if (v2771==v2772) goto c01_028b; else goto c01_028c; -c02_028b:; +c01_028b:; - i8 v2773 = (i8)(intptr_t)c02_s002a; + i8 v2773 = (i8)(intptr_t)c01_s002a; *(i8*)(intptr_t)(ws+912) = v2773; - i8 v2774 = (i8)(intptr_t)(f62_SimpleError); + i8 v2774 = (i8)(intptr_t)(f61_SimpleError); ((void(*)(void))(intptr_t)v2774)(); -c02_028c:; +c01_028c:; -c02_0288:; +c01_0288:; - i8 v2775 = (i8)(intptr_t)c02_s002b; + i8 v2775 = (i8)(intptr_t)c01_s002b; *(i8*)(intptr_t)(ws+3336) = v2775; - i8 v2776 = (i8)(intptr_t)(f12_print); + i8 v2776 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v2776)(); - i8 v2777 = (i8)(intptr_t)(f104_ResolveExternals); + i8 v2777 = (i8)(intptr_t)(f103_ResolveExternals); ((void(*)(void))(intptr_t)v2777)(); i8 v2778 = (i8)(intptr_t)(ws+776); i8 v2779 = *(i8*)(intptr_t)v2778; *(i8*)(intptr_t)(ws+832) = v2779; - i8 v2780 = (i8)(intptr_t)(f105_PlaceSubroutines); + i8 v2780 = (i8)(intptr_t)(f104_PlaceSubroutines); ((void(*)(void))(intptr_t)v2780)(); i8 v2781 = (i8)(intptr_t)(ws+768); i8 v2782 = *(i8*)(intptr_t)v2781; *(i8*)(intptr_t)(ws+832) = v2782; - i8 v2783 = (i8)(intptr_t)(f73_EmitterOpenfile); + i8 v2783 = (i8)(intptr_t)(f72_EmitterOpenfile); ((void(*)(void))(intptr_t)v2783)(); - i8 v2784 = (i8)(intptr_t)c02_s002c; + i8 v2784 = (i8)(intptr_t)c01_s002c; *(i8*)(intptr_t)(ws+3336) = v2784; - i8 v2785 = (i8)(intptr_t)(f12_print); + i8 v2785 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v2785)(); i8 v2786 = (i8)(intptr_t)(ws+768); i8 v2787 = *(i8*)(intptr_t)v2786; *(i8*)(intptr_t)(ws+3336) = v2787; - i8 v2788 = (i8)(intptr_t)(f12_print); + i8 v2788 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v2788)(); - i8 v2789 = (i8)(intptr_t)(f13_print_nl); + i8 v2789 = (i8)(intptr_t)(f12_print_nl); ((void(*)(void))(intptr_t)v2789)(); - i8 v2790 = (i8)(intptr_t)(f90_InitStreams); + i8 v2790 = (i8)(intptr_t)(f89_InitStreams); ((void(*)(void))(intptr_t)v2790)(); i1 v2791 = (i1)+7; *(i1*)(intptr_t)(ws+888) = v2791; - i8 v2792 = (i8)(intptr_t)(f91_SetStream); + i8 v2792 = (i8)(intptr_t)(f90_SetStream); ((void(*)(void))(intptr_t)v2792)(); i8 v2793 = (i8)(intptr_t)(ws+760); i8 v2794 = *(i8*)(intptr_t)v2793; *(i8*)(intptr_t)(ws+832) = v2794; - i8 v2795 = (i8)(intptr_t)(f79_ArchEmitHeader); + i8 v2795 = (i8)(intptr_t)(f78_ArchEmitHeader); ((void(*)(void))(intptr_t)v2795)(); - i8 v2796 = (i8)(intptr_t)(f95_FlushStream); + i8 v2796 = (i8)(intptr_t)(f94_FlushStream); ((void(*)(void))(intptr_t)v2796)(); i8 v2797 = (i8)(intptr_t)(ws+760); i8 v2798 = *(i8*)(intptr_t)v2797; *(i8*)(intptr_t)(ws+832) = v2798; - i8 v2799 = (i8)(intptr_t)(f103_WriteAllSubroutinesToOutputFile); + i8 v2799 = (i8)(intptr_t)(f102_WriteAllSubroutinesToOutputFile); ((void(*)(void))(intptr_t)v2799)(); i1 v2800 = (i1)+7; *(i1*)(intptr_t)(ws+888) = v2800; - i8 v2801 = (i8)(intptr_t)(f91_SetStream); + i8 v2801 = (i8)(intptr_t)(f90_SetStream); ((void(*)(void))(intptr_t)v2801)(); i8 v2802 = (i8)(intptr_t)(ws+760); i8 v2803 = *(i8*)(intptr_t)v2802; *(i8*)(intptr_t)(ws+832) = v2803; - i8 v2804 = (i8)(intptr_t)(f80_ArchEmitFooter); + i8 v2804 = (i8)(intptr_t)(f79_ArchEmitFooter); ((void(*)(void))(intptr_t)v2804)(); - i8 v2805 = (i8)(intptr_t)(f95_FlushStream); + i8 v2805 = (i8)(intptr_t)(f94_FlushStream); ((void(*)(void))(intptr_t)v2805)(); - i8 v2806 = (i8)(intptr_t)(f74_EmitterClosefile); + i8 v2806 = (i8)(intptr_t)(f73_EmitterClosefile); ((void(*)(void))(intptr_t)v2806)(); - i8 v2807 = (i8)(intptr_t)c02_s002d; + i8 v2807 = (i8)(intptr_t)c01_s002d; *(i8*)(intptr_t)(ws+3336) = v2807; - i8 v2808 = (i8)(intptr_t)(f12_print); + i8 v2808 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v2808)(); - i8 v2809 = (i8)(intptr_t)(f38_GetFreeMemory); + i8 v2809 = (i8)(intptr_t)(f37_GetFreeMemory); ((void(*)(void))(intptr_t)v2809)(); @@ -6206,17 +6206,17 @@ c02_0288:; i8 v2815 = ((i8)v2813)>>v2814; i2 v2816 = v2815; *(i2*)(intptr_t)(ws+3296) = v2816; - i8 v2817 = (i8)(intptr_t)(f17_print_i16); + i8 v2817 = (i8)(intptr_t)(f16_print_i16); ((void(*)(void))(intptr_t)v2817)(); - i8 v2818 = (i8)(intptr_t)c02_s002e; + i8 v2818 = (i8)(intptr_t)c01_s002e; *(i8*)(intptr_t)(ws+3336) = v2818; - i8 v2819 = (i8)(intptr_t)(f12_print); + i8 v2819 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v2819)(); } void cmain(void) { - f3___main(); + f2___main(); } diff --git a/bootstrap/cowwrap.bootstrap.c b/bootstrap/cowwrap.bootstrap.c index b5898814..e9e6b5b8 100644 --- a/bootstrap/cowwrap.bootstrap.c +++ b/bootstrap/cowwrap.bootstrap.c @@ -3,7 +3,7 @@ static i8 workspace[0x00b1]; #define ws ((i1*)workspace) // ExitWithError workspace at ws+1344 length ws+0 -void f6_ExitWithError(void) { +void f5_ExitWithError(void) { @@ -14,7 +14,7 @@ exit(1); } // print_char workspace at ws+1360 length ws+1 -void f9_print_char(void) { +void f8_print_char(void) { @@ -25,12 +25,12 @@ putchar( } - void f9_print_char(void); + void f8_print_char(void); // print workspace at ws+1344 length ws+9 -void f12_print(void) { +void f11_print(void) { -c02_0001:; +c01_0001:; i8 v6 = (i8)(intptr_t)(ws+1344); i8 v7 = *(i8*)(intptr_t)v6; @@ -41,20 +41,20 @@ c02_0001:; i8 v10 = (i8)(intptr_t)(ws+1352); i1 v11 = *(i1*)(intptr_t)v10; i1 v12 = (i1)+0; - if (v11==v12) goto c02_0006; else goto c02_0007; + if (v11==v12) goto c01_0006; else goto c01_0007; -c02_0006:; +c01_0006:; return; -c02_0007:; +c01_0007:; -c02_0003:; +c01_0003:; i8 v13 = (i8)(intptr_t)(ws+1352); i1 v14 = *(i1*)(intptr_t)v13; *(i1*)(intptr_t)(ws+1360) = v14; - i8 v15 = (i8)(intptr_t)(f9_print_char); + i8 v15 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v15)(); @@ -64,33 +64,33 @@ c02_0003:; i8 v19 = (i8)(intptr_t)(ws+1344); *(i8*)(intptr_t)v19 = v18; - goto c02_0001; + goto c01_0001; -c02_0002:; +c01_0002:; } - void f9_print_char(void); + void f8_print_char(void); // print_nl workspace at ws+1312 length ws+0 -void f13_print_nl(void) { +void f12_print_nl(void) { i1 v20 = (i1)+10; *(i1*)(intptr_t)(ws+1360) = v20; - i8 v21 = (i8)(intptr_t)(f9_print_char); + i8 v21 = (i8)(intptr_t)(f8_print_char); ((void(*)(void))(intptr_t)v21)(); } // UIToA workspace at ws+1232 length ws+49 -void f14_UIToA(void) { +void f13_UIToA(void) { i8 v22 = (i8)(intptr_t)(ws+1240); i8 v23 = *(i8*)(intptr_t)v22; i8 v24 = (i8)(intptr_t)(ws+1248); *(i8*)(intptr_t)v24 = v23; -c02_0008:; +c01_0008:; i8 v25 = (i8)(intptr_t)(ws+1232); i4 v26 = *(i4*)(intptr_t)v25; @@ -113,9 +113,9 @@ c02_0008:; i8 v39 = (i8)(intptr_t)(ws+1256); i4 v40 = *(i4*)(intptr_t)v39; i4 v41 = (i4)+10; - if (v40>v1051; i1 v1053 = v1052; *(i1*)(intptr_t)(ws+1296) = v1053; - i8 v1054 = (i8)(intptr_t)(f62_E_b8); + i8 v1054 = (i8)(intptr_t)(f61_E_b8); ((void(*)(void))(intptr_t)v1054)(); } - void f33_Alloc(void); - void f33_Alloc(void); + void f32_Alloc(void); + void f32_Alloc(void); // EmitterPushChunk workspace at ws+1288 length ws+24 -void f66_EmitterPushChunk(void) { +void f65_EmitterPushChunk(void) { i8 v1065 = (i8)+26; *(i8*)(intptr_t)(ws+1320) = v1065; - i8 v1066 = (i8)(intptr_t)(f33_Alloc); + i8 v1066 = (i8)(intptr_t)(f32_Alloc); ((void(*)(void))(intptr_t)v1066)(); @@ -1709,7 +1709,7 @@ void f66_EmitterPushChunk(void) { i8 v1072 = (i8)+264; *(i8*)(intptr_t)(ws+1320) = v1072; - i8 v1073 = (i8)(intptr_t)(f33_Alloc); + i8 v1073 = (i8)(intptr_t)(f32_Alloc); ((void(*)(void))(intptr_t)v1073)(); @@ -1745,22 +1745,22 @@ void f66_EmitterPushChunk(void) { *(i8*)(intptr_t)v1094 = v1093; } - void f47_FCBPutChar(void); - void f47_FCBPutChar(void); - void f47_FCBPutChar(void); - void f47_FCBPutChar(void); - void f34_Free(void); - void f34_Free(void); + void f46_FCBPutChar(void); + void f46_FCBPutChar(void); + void f46_FCBPutChar(void); + void f46_FCBPutChar(void); + void f33_Free(void); + void f33_Free(void); // EmitterPopChunk workspace at ws+1288 length ws+40 -void f67_EmitterPopChunk(void) { +void f66_EmitterPopChunk(void) { i8 v1095 = (i8)(intptr_t)(ws+576); *(i8*)(intptr_t)(ws+1328) = v1095; i8 v1096 = (i8)(intptr_t)(ws+1288); i1 v1097 = *(i1*)(intptr_t)v1096; *(i1*)(intptr_t)(ws+1336) = v1097; - i8 v1098 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1098 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1098)(); @@ -1777,7 +1777,7 @@ void f67_EmitterPopChunk(void) { i2 v1106 = *(i2*)(intptr_t)v1105; i1 v1107 = v1106; *(i1*)(intptr_t)(ws+1336) = v1107; - i8 v1108 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1108 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1108)(); @@ -1789,7 +1789,7 @@ void f67_EmitterPopChunk(void) { i2 v1113 = ((i2)v1111)>>v1112; i1 v1114 = v1113; *(i1*)(intptr_t)(ws+1336) = v1114; - i8 v1115 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1115 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1115)(); @@ -1800,20 +1800,20 @@ void f67_EmitterPopChunk(void) { i8 v1120 = (i8)(intptr_t)(ws+1296); *(i8*)(intptr_t)v1120 = v1119; -c02_0106:; +c01_0106:; i8 v1121 = (i8)(intptr_t)(ws+1296); i8 v1122 = *(i8*)(intptr_t)v1121; i8 v1123 = (i8)+0; - if (v1122==v1123) goto c02_010b; else goto c02_010a; + if (v1122==v1123) goto c01_010b; else goto c01_010a; -c02_010a:; +c01_010a:; i1 v1124 = (i1)+0; i8 v1125 = (i8)(intptr_t)(ws+1304); *(i1*)(intptr_t)v1125 = v1124; -c02_010c:; +c01_010c:; i8 v1126 = (i8)(intptr_t)(ws+1304); i1 v1127 = *(i1*)(intptr_t)v1126; @@ -1821,9 +1821,9 @@ c02_010c:; i8 v1129 = *(i8*)(intptr_t)v1128; i8 v1130 = v1129+(+255); i1 v1131 = *(i1*)(intptr_t)v1130; - if (v1127==v1131) goto c02_0111; else goto c02_0110; + if (v1127==v1131) goto c01_0111; else goto c01_0110; -c02_0110:; +c01_0110:; i8 v1132 = (i8)(intptr_t)(ws+576); *(i8*)(intptr_t)(ws+1328) = v1132; @@ -1835,7 +1835,7 @@ c02_0110:; i8 v1138 = v1134+v1137; i1 v1139 = *(i1*)(intptr_t)v1138; *(i1*)(intptr_t)(ws+1336) = v1139; - i8 v1140 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1140 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1140)(); @@ -1845,9 +1845,9 @@ c02_0110:; i8 v1144 = (i8)(intptr_t)(ws+1304); *(i1*)(intptr_t)v1144 = v1143; - goto c02_010c; + goto c01_010c; -c02_0111:; +c01_0111:; i8 v1145 = (i8)(intptr_t)(ws+1296); i8 v1146 = *(i8*)(intptr_t)v1145; @@ -1859,7 +1859,7 @@ c02_0111:; i8 v1150 = (i8)(intptr_t)(ws+1296); i8 v1151 = *(i8*)(intptr_t)v1150; *(i8*)(intptr_t)(ws+1328) = v1151; - i8 v1152 = (i8)(intptr_t)(f34_Free); + i8 v1152 = (i8)(intptr_t)(f33_Free); ((void(*)(void))(intptr_t)v1152)(); @@ -1868,9 +1868,9 @@ c02_0111:; i8 v1155 = (i8)(intptr_t)(ws+1296); *(i8*)(intptr_t)v1155 = v1154; - goto c02_0106; + goto c01_0106; -c02_010b:; +c01_010b:; i8 v1156 = (i8)(intptr_t)(ws+1104); i8 v1157 = *(i8*)(intptr_t)v1156; @@ -1881,7 +1881,7 @@ c02_010b:; i8 v1160 = (i8)(intptr_t)(ws+1104); i8 v1161 = *(i8*)(intptr_t)v1160; *(i8*)(intptr_t)(ws+1328) = v1161; - i8 v1162 = (i8)(intptr_t)(f34_Free); + i8 v1162 = (i8)(intptr_t)(f33_Free); ((void(*)(void))(intptr_t)v1162)(); @@ -1891,19 +1891,19 @@ c02_010b:; *(i8*)(intptr_t)v1165 = v1164; } - void f54_FCBOpenOut(void); -const i1 c02_s0005[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,0x70,0x65,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; - void f61_FatalError(void); + void f53_FCBOpenOut(void); +const i1 c01_s0005[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f,0x70,0x65,0x6e,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; + void f60_FatalError(void); // EmitterOpenfile workspace at ws+1192 length ws+9 -void f68_EmitterOpenfile(void) { +void f67_EmitterOpenfile(void) { i8 v1166 = (i8)(intptr_t)(ws+576); *(i8*)(intptr_t)(ws+1208) = v1166; i8 v1167 = (i8)(intptr_t)(ws+1192); i8 v1168 = *(i8*)(intptr_t)v1167; *(i8*)(intptr_t)(ws+1216) = v1168; - i8 v1169 = (i8)(intptr_t)(f54_FCBOpenOut); + i8 v1169 = (i8)(intptr_t)(f53_FCBOpenOut); ((void(*)(void))(intptr_t)v1169)(); @@ -1914,36 +1914,36 @@ void f68_EmitterOpenfile(void) { i8 v1172 = (i8)(intptr_t)(ws+1200); i1 v1173 = *(i1*)(intptr_t)v1172; i1 v1174 = (i1)+0; - if (v1173==v1174) goto c02_0116; else goto c02_0115; + if (v1173==v1174) goto c01_0116; else goto c01_0115; -c02_0115:; +c01_0115:; - i8 v1175 = (i8)(intptr_t)c02_s0005; + i8 v1175 = (i8)(intptr_t)c01_s0005; *(i8*)(intptr_t)(ws+1304) = v1175; - i8 v1176 = (i8)(intptr_t)(f61_FatalError); + i8 v1176 = (i8)(intptr_t)(f60_FatalError); ((void(*)(void))(intptr_t)v1176)(); -c02_0116:; +c01_0116:; -c02_0112:; +c01_0112:; } - void f47_FCBPutChar(void); - void f47_FCBPutChar(void); - void f47_FCBPutChar(void); - void f55_FCBClose(void); -const i1 c02_s0006[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; - void f61_FatalError(void); + void f46_FCBPutChar(void); + void f46_FCBPutChar(void); + void f46_FCBPutChar(void); + void f54_FCBClose(void); +const i1 c01_s0006[] = { 0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x63,0x6c,0x6f,0x73,0x65,0x20,0x6f,0x75,0x74,0x70,0x75,0x74,0x20,0x66,0x69,0x6c,0x65,0 }; + void f60_FatalError(void); // EmitterClosefile workspace at ws+1192 length ws+1 -void f69_EmitterClosefile(void) { +void f68_EmitterClosefile(void) { i8 v1177 = (i8)(intptr_t)(ws+576); *(i8*)(intptr_t)(ws+1328) = v1177; i1 v1178 = (i1)+69; *(i1*)(intptr_t)(ws+1336) = v1178; - i8 v1179 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1179 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1179)(); @@ -1951,7 +1951,7 @@ void f69_EmitterClosefile(void) { *(i8*)(intptr_t)(ws+1328) = v1180; i1 v1181 = (i1)+0; *(i1*)(intptr_t)(ws+1336) = v1181; - i8 v1182 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1182 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1182)(); @@ -1959,13 +1959,13 @@ void f69_EmitterClosefile(void) { *(i8*)(intptr_t)(ws+1328) = v1183; i1 v1184 = (i1)+0; *(i1*)(intptr_t)(ws+1336) = v1184; - i8 v1185 = (i8)(intptr_t)(f47_FCBPutChar); + i8 v1185 = (i8)(intptr_t)(f46_FCBPutChar); ((void(*)(void))(intptr_t)v1185)(); i8 v1186 = (i8)(intptr_t)(ws+576); *(i8*)(intptr_t)(ws+1200) = v1186; - i8 v1187 = (i8)(intptr_t)(f55_FCBClose); + i8 v1187 = (i8)(intptr_t)(f54_FCBClose); ((void(*)(void))(intptr_t)v1187)(); @@ -1976,193 +1976,193 @@ void f69_EmitterClosefile(void) { i8 v1190 = (i8)(intptr_t)(ws+1192); i1 v1191 = *(i1*)(intptr_t)v1190; i1 v1192 = (i1)+0; - if (v1191==v1192) goto c02_011b; else goto c02_011a; + if (v1191==v1192) goto c01_011b; else goto c01_011a; -c02_011a:; +c01_011a:; - i8 v1193 = (i8)(intptr_t)c02_s0006; + i8 v1193 = (i8)(intptr_t)c01_s0006; *(i8*)(intptr_t)(ws+1304) = v1193; - i8 v1194 = (i8)(intptr_t)(f61_FatalError); + i8 v1194 = (i8)(intptr_t)(f60_FatalError); ((void(*)(void))(intptr_t)v1194)(); -c02_011b:; +c01_011b:; -c02_0117:; +c01_0117:; } - void f66_EmitterPushChunk(void); - void f64_E_b16(void); - void f63_E(void); - void f67_EmitterPopChunk(void); + void f65_EmitterPushChunk(void); + void f63_E_b16(void); + void f62_E(void); + void f66_EmitterPopChunk(void); // EmitterDeclareSubroutine workspace at ws+1248 length ws+16 -void f70_EmitterDeclareSubroutine(void) { +void f69_EmitterDeclareSubroutine(void) { - i8 v1195 = (i8)(intptr_t)(f66_EmitterPushChunk); + i8 v1195 = (i8)(intptr_t)(f65_EmitterPushChunk); ((void(*)(void))(intptr_t)v1195)(); i8 v1196 = (i8)(intptr_t)(ws+1248); i2 v1197 = *(i2*)(intptr_t)v1196; *(i2*)(intptr_t)(ws+1288) = v1197; - i8 v1198 = (i8)(intptr_t)(f64_E_b16); + i8 v1198 = (i8)(intptr_t)(f63_E_b16); ((void(*)(void))(intptr_t)v1198)(); i8 v1199 = (i8)(intptr_t)(ws+1256); i8 v1200 = *(i8*)(intptr_t)v1199; *(i8*)(intptr_t)(ws+1272) = v1200; - i8 v1201 = (i8)(intptr_t)(f63_E); + i8 v1201 = (i8)(intptr_t)(f62_E); ((void(*)(void))(intptr_t)v1201)(); i1 v1202 = (i1)+78; *(i1*)(intptr_t)(ws+1288) = v1202; - i8 v1203 = (i8)(intptr_t)(f67_EmitterPopChunk); + i8 v1203 = (i8)(intptr_t)(f66_EmitterPopChunk); ((void(*)(void))(intptr_t)v1203)(); } - void f66_EmitterPushChunk(void); - void f64_E_b16(void); - void f63_E(void); - void f67_EmitterPopChunk(void); + void f65_EmitterPushChunk(void); + void f63_E_b16(void); + void f62_E(void); + void f66_EmitterPopChunk(void); // EmitterDeclareExternal workspace at ws+1256 length ws+16 -void f71_EmitterDeclareExternal(void) { +void f70_EmitterDeclareExternal(void) { - i8 v1204 = (i8)(intptr_t)(f66_EmitterPushChunk); + i8 v1204 = (i8)(intptr_t)(f65_EmitterPushChunk); ((void(*)(void))(intptr_t)v1204)(); i8 v1205 = (i8)(intptr_t)(ws+1256); i2 v1206 = *(i2*)(intptr_t)v1205; *(i2*)(intptr_t)(ws+1288) = v1206; - i8 v1207 = (i8)(intptr_t)(f64_E_b16); + i8 v1207 = (i8)(intptr_t)(f63_E_b16); ((void(*)(void))(intptr_t)v1207)(); i8 v1208 = (i8)(intptr_t)(ws+1264); i8 v1209 = *(i8*)(intptr_t)v1208; *(i8*)(intptr_t)(ws+1272) = v1209; - i8 v1210 = (i8)(intptr_t)(f63_E); + i8 v1210 = (i8)(intptr_t)(f62_E); ((void(*)(void))(intptr_t)v1210)(); i1 v1211 = (i1)+88; *(i1*)(intptr_t)(ws+1288) = v1211; - i8 v1212 = (i8)(intptr_t)(f67_EmitterPopChunk); + i8 v1212 = (i8)(intptr_t)(f66_EmitterPopChunk); ((void(*)(void))(intptr_t)v1212)(); } - void f66_EmitterPushChunk(void); - void f64_E_b16(void); - void f64_E_b16(void); - void f67_EmitterPopChunk(void); + void f65_EmitterPushChunk(void); + void f63_E_b16(void); + void f63_E_b16(void); + void f66_EmitterPopChunk(void); // EmitterReferenceSubroutine workspace at ws+1280 length ws+4 -void f72_EmitterReferenceSubroutine(void) { +void f71_EmitterReferenceSubroutine(void) { i8 v1213 = (i8)(intptr_t)(ws+1280); i2 v1214 = *(i2*)(intptr_t)v1213; i8 v1215 = (i8)(intptr_t)(ws+1282); i2 v1216 = *(i2*)(intptr_t)v1215; - if (v1214==v1216) goto c02_0120; else goto c02_011f; + if (v1214==v1216) goto c01_0120; else goto c01_011f; -c02_011f:; +c01_011f:; - i8 v1217 = (i8)(intptr_t)(f66_EmitterPushChunk); + i8 v1217 = (i8)(intptr_t)(f65_EmitterPushChunk); ((void(*)(void))(intptr_t)v1217)(); i8 v1218 = (i8)(intptr_t)(ws+1280); i2 v1219 = *(i2*)(intptr_t)v1218; *(i2*)(intptr_t)(ws+1288) = v1219; - i8 v1220 = (i8)(intptr_t)(f64_E_b16); + i8 v1220 = (i8)(intptr_t)(f63_E_b16); ((void(*)(void))(intptr_t)v1220)(); i8 v1221 = (i8)(intptr_t)(ws+1282); i2 v1222 = *(i2*)(intptr_t)v1221; *(i2*)(intptr_t)(ws+1288) = v1222; - i8 v1223 = (i8)(intptr_t)(f64_E_b16); + i8 v1223 = (i8)(intptr_t)(f63_E_b16); ((void(*)(void))(intptr_t)v1223)(); i1 v1224 = (i1)+82; *(i1*)(intptr_t)(ws+1288) = v1224; - i8 v1225 = (i8)(intptr_t)(f67_EmitterPopChunk); + i8 v1225 = (i8)(intptr_t)(f66_EmitterPopChunk); ((void(*)(void))(intptr_t)v1225)(); -c02_0120:; +c01_0120:; -c02_011c:; +c01_011c:; } - void f66_EmitterPushChunk(void); - void f64_E_b16(void); - void f62_E_b8(void); - void f64_E_b16(void); - void f67_EmitterPopChunk(void); + void f65_EmitterPushChunk(void); + void f63_E_b16(void); + void f61_E_b8(void); + void f63_E_b16(void); + void f66_EmitterPopChunk(void); // EmitterDeclareWorkspace workspace at ws+1264 length ws+6 -void f73_EmitterDeclareWorkspace(void) { +void f72_EmitterDeclareWorkspace(void) { - i8 v1226 = (i8)(intptr_t)(f66_EmitterPushChunk); + i8 v1226 = (i8)(intptr_t)(f65_EmitterPushChunk); ((void(*)(void))(intptr_t)v1226)(); i8 v1227 = (i8)(intptr_t)(ws+1264); i2 v1228 = *(i2*)(intptr_t)v1227; *(i2*)(intptr_t)(ws+1288) = v1228; - i8 v1229 = (i8)(intptr_t)(f64_E_b16); + i8 v1229 = (i8)(intptr_t)(f63_E_b16); ((void(*)(void))(intptr_t)v1229)(); i8 v1230 = (i8)(intptr_t)(ws+1266); i1 v1231 = *(i1*)(intptr_t)v1230; *(i1*)(intptr_t)(ws+1296) = v1231; - i8 v1232 = (i8)(intptr_t)(f62_E_b8); + i8 v1232 = (i8)(intptr_t)(f61_E_b8); ((void(*)(void))(intptr_t)v1232)(); i8 v1233 = (i8)(intptr_t)(ws+1268); i2 v1234 = *(i2*)(intptr_t)v1233; *(i2*)(intptr_t)(ws+1288) = v1234; - i8 v1235 = (i8)(intptr_t)(f64_E_b16); + i8 v1235 = (i8)(intptr_t)(f63_E_b16); ((void(*)(void))(intptr_t)v1235)(); i1 v1236 = (i1)+87; *(i1*)(intptr_t)(ws+1288) = v1236; - i8 v1237 = (i8)(intptr_t)(f67_EmitterPopChunk); + i8 v1237 = (i8)(intptr_t)(f66_EmitterPopChunk); ((void(*)(void))(intptr_t)v1237)(); } - void f26_StrCmp(void); - void f33_Alloc(void); - void f35_StrDup(void); + void f25_StrCmp(void); + void f32_Alloc(void); + void f34_StrDup(void); // GetSymbol workspace at ws+1280 length ws+40 -void f74_GetSymbol(void) { +void f73_GetSymbol(void) { i8 v1244 = (i8)(intptr_t)(ws+1136); i8 v1245 = *(i8*)(intptr_t)v1244; i8 v1246 = (i8)(intptr_t)(ws+1288); *(i8*)(intptr_t)v1246 = v1245; -c02_0121:; +c01_0121:; i8 v1247 = (i8)(intptr_t)(ws+1288); i8 v1248 = *(i8*)(intptr_t)v1247; i8 v1249 = (i8)+0; - if (v1248==v1249) goto c02_0126; else goto c02_0125; + if (v1248==v1249) goto c01_0126; else goto c01_0125; -c02_0125:; +c01_0125:; i8 v1250 = (i8)(intptr_t)(ws+1280); i8 v1251 = *(i8*)(intptr_t)v1250; @@ -2172,7 +2172,7 @@ c02_0125:; i8 v1254 = v1253+(+8); i8 v1255 = *(i8*)(intptr_t)v1254; *(i8*)(intptr_t)(ws+1328) = v1255; - i8 v1256 = (i8)(intptr_t)(f26_StrCmp); + i8 v1256 = (i8)(intptr_t)(f25_StrCmp); ((void(*)(void))(intptr_t)v1256)(); @@ -2183,15 +2183,15 @@ c02_0125:; i8 v1259 = (i8)(intptr_t)(ws+1296); i1 v1260 = *(i1*)(intptr_t)v1259; i1 v1261 = (i1)+0; - if (v1260==v1261) goto c02_012a; else goto c02_012b; + if (v1260==v1261) goto c01_012a; else goto c01_012b; -c02_012a:; +c01_012a:; return; -c02_012b:; +c01_012b:; -c02_0127:; +c01_0127:; i8 v1262 = (i8)(intptr_t)(ws+1288); i8 v1263 = *(i8*)(intptr_t)v1262; @@ -2199,13 +2199,13 @@ c02_0127:; i8 v1265 = (i8)(intptr_t)(ws+1288); *(i8*)(intptr_t)v1265 = v1264; - goto c02_0121; + goto c01_0121; -c02_0126:; +c01_0126:; i8 v1266 = (i8)+19; *(i8*)(intptr_t)(ws+1320) = v1266; - i8 v1267 = (i8)(intptr_t)(f33_Alloc); + i8 v1267 = (i8)(intptr_t)(f32_Alloc); ((void(*)(void))(intptr_t)v1267)(); @@ -2221,7 +2221,7 @@ c02_0126:; i8 v1273 = (i8)(intptr_t)(ws+1280); i8 v1274 = *(i8*)(intptr_t)v1273; *(i8*)(intptr_t)(ws+1320) = v1274; - i8 v1275 = (i8)(intptr_t)(f35_StrDup); + i8 v1275 = (i8)(intptr_t)(f34_StrDup); ((void(*)(void))(intptr_t)v1275)(); @@ -2261,15 +2261,15 @@ c02_0126:; *(i8*)(intptr_t)v1298 = v1297; } -const i1 c02_s0007[] = { 0x40,0 }; - void f46_FCBGetChar(void); +const i1 c01_s0007[] = { 0x40,0 }; + void f45_FCBGetChar(void); // GetC workspace at ws+1304 length ws+1 -void f76_GetC(void) { +void f75_GetC(void) { i8 v1305 = (i8)(intptr_t)(ws+40); *(i8*)(intptr_t)(ws+1312) = v1305; - i8 v1306 = (i8)(intptr_t)(f46_FCBGetChar); + i8 v1306 = (i8)(intptr_t)(f45_FCBGetChar); ((void(*)(void))(intptr_t)v1306)(); @@ -2283,124 +2283,124 @@ void f76_GetC(void) { *(i1*)(intptr_t)v1311 = v1310; } -const i1 c02_s0008[] = { 0x6d,0x61,0x6c,0x66,0x6f,0x72,0x6d,0x65,0x64,0x20,0x63,0x6f,0x77,0x77,0x72,0x61,0x70,0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x76,0x65,0 }; - void f61_FatalError(void); - void f76_GetC(void); +const i1 c01_s0008[] = { 0x6d,0x61,0x6c,0x66,0x6f,0x72,0x6d,0x65,0x64,0x20,0x63,0x6f,0x77,0x77,0x72,0x61,0x70,0x20,0x64,0x69,0x72,0x65,0x63,0x74,0x69,0x76,0x65,0 }; + void f60_FatalError(void); + void f75_GetC(void); // ExpectC workspace at ws+1280 length ws+1 -void f77_ExpectC(void) { +void f76_ExpectC(void) { i8 v1312 = (i8)(intptr_t)(ws+1192); i1 v1313 = *(i1*)(intptr_t)v1312; i8 v1314 = (i8)(intptr_t)(ws+1280); i1 v1315 = *(i1*)(intptr_t)v1314; - if (v1313==v1315) goto c02_0130; else goto c02_012f; + if (v1313==v1315) goto c01_0130; else goto c01_012f; -c02_012f:; +c01_012f:; - i8 v1316 = (i8)(intptr_t)c02_s0008; + i8 v1316 = (i8)(intptr_t)c01_s0008; *(i8*)(intptr_t)(ws+1304) = v1316; - i8 v1317 = (i8)(intptr_t)(f61_FatalError); + i8 v1317 = (i8)(intptr_t)(f60_FatalError); ((void(*)(void))(intptr_t)v1317)(); -c02_0130:; +c01_0130:; -c02_012c:; +c01_012c:; - i8 v1318 = (i8)(intptr_t)(f76_GetC); + i8 v1318 = (i8)(intptr_t)(f75_GetC); ((void(*)(void))(intptr_t)v1318)(); } - void f76_GetC(void); + void f75_GetC(void); // SkipToEndOfLine workspace at ws+1232 length ws+0 -void f78_SkipToEndOfLine(void) { +void f77_SkipToEndOfLine(void) { -c02_0131:; +c01_0131:; i8 v1319 = (i8)(intptr_t)(ws+1192); i1 v1320 = *(i1*)(intptr_t)v1319; i1 v1321 = (i1)+0; - if (v1320==v1321) goto c02_013a; else goto c02_013d; + if (v1320==v1321) goto c01_013a; else goto c01_013d; -c02_013d:; +c01_013d:; i8 v1322 = (i8)(intptr_t)(ws+1192); i1 v1323 = *(i1*)(intptr_t)v1322; i1 v1324 = (i1)+26; - if (v1323==v1324) goto c02_013a; else goto c02_013c; + if (v1323==v1324) goto c01_013a; else goto c01_013c; -c02_013c:; +c01_013c:; i8 v1325 = (i8)(intptr_t)(ws+1192); i1 v1326 = *(i1*)(intptr_t)v1325; i1 v1327 = (i1)+10; - if (v1326==v1327) goto c02_013a; else goto c02_013b; + if (v1326==v1327) goto c01_013a; else goto c01_013b; -c02_013a:; +c01_013a:; - goto c02_0132; + goto c01_0132; -c02_013b:; +c01_013b:; -c02_0133:; +c01_0133:; - i8 v1328 = (i8)(intptr_t)(f76_GetC); + i8 v1328 = (i8)(intptr_t)(f75_GetC); ((void(*)(void))(intptr_t)v1328)(); - goto c02_0131; + goto c01_0131; -c02_0132:; +c01_0132:; } - void f76_GetC(void); + void f75_GetC(void); // SkipWhitespace workspace at ws+1304 length ws+0 -void f79_SkipWhitespace(void) { +void f78_SkipWhitespace(void) { -c02_013e:; +c01_013e:; i8 v1329 = (i8)(intptr_t)(ws+1192); i1 v1330 = *(i1*)(intptr_t)v1329; i1 v1331 = (i1)+32; - if (v1330==v1331) goto c02_0146; else goto c02_0147; + if (v1330==v1331) goto c01_0146; else goto c01_0147; -c02_0147:; +c01_0147:; i8 v1332 = (i8)(intptr_t)(ws+1192); i1 v1333 = *(i1*)(intptr_t)v1332; i1 v1334 = (i1)+9; - if (v1333==v1334) goto c02_0146; else goto c02_0145; + if (v1333==v1334) goto c01_0146; else goto c01_0145; -c02_0145:; +c01_0145:; - goto c02_013f; + goto c01_013f; -c02_0146:; +c01_0146:; -c02_0140:; +c01_0140:; - i8 v1335 = (i8)(intptr_t)(f76_GetC); + i8 v1335 = (i8)(intptr_t)(f75_GetC); ((void(*)(void))(intptr_t)v1335)(); - goto c02_013e; + goto c01_013e; -c02_013f:; +c01_013f:; } - void f79_SkipWhitespace(void); -const i1 c02_s0009[] = { 0x77,0x6f,0x72,0x64,0x20,0x74,0x6f,0x6f,0x20,0x6c,0x6f,0x6e,0x67,0 }; - void f61_FatalError(void); - void f76_GetC(void); + void f78_SkipWhitespace(void); +const i1 c01_s0009[] = { 0x77,0x6f,0x72,0x64,0x20,0x74,0x6f,0x6f,0x20,0x6c,0x6f,0x6e,0x67,0 }; + void f60_FatalError(void); + void f75_GetC(void); // ReadWord workspace at ws+1296 length ws+8 -void f80_ReadWord(void) { +void f79_ReadWord(void) { - i8 v1336 = (i8)(intptr_t)(f79_SkipWhitespace); + i8 v1336 = (i8)(intptr_t)(f78_SkipWhitespace); ((void(*)(void))(intptr_t)v1336)(); @@ -2408,69 +2408,69 @@ void f80_ReadWord(void) { i8 v1338 = (i8)(intptr_t)(ws+1296); *(i8*)(intptr_t)v1338 = v1337; -c02_0148:; +c01_0148:; i8 v1339 = (i8)(intptr_t)(ws+1192); i1 v1340 = *(i1*)(intptr_t)v1339; i1 v1341 = (i1)+48; - if (v1340>v957; i2 v959 = v958; *(i2*)(intptr_t)(ws+1192) = v959; - i8 v960 = (i8)(intptr_t)(f17_print_i16); + i8 v960 = (i8)(intptr_t)(f16_print_i16); ((void(*)(void))(intptr_t)v960)(); - i8 v961 = (i8)(intptr_t)c02_s0002; + i8 v961 = (i8)(intptr_t)c01_s0002; *(i8*)(intptr_t)(ws+1344) = v961; - i8 v962 = (i8)(intptr_t)(f12_print); + i8 v962 = (i8)(intptr_t)(f11_print); ((void(*)(void))(intptr_t)v962)(); @@ -3600,11 +3600,11 @@ void f3___main(void) { - i8 v1692 = (i8)(intptr_t)(f24_ArgvInit); + i8 v1692 = (i8)(intptr_t)(f23_ArgvInit); ((void(*)(void))(intptr_t)v1692)(); - i8 v1693 = (i8)(intptr_t)(f25_ArgvNext); + i8 v1693 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v1693)(); @@ -3617,7 +3617,7 @@ void f3___main(void) { i8 v1698 = (i8)(intptr_t)(ws+24); *(i8*)(intptr_t)v1698 = v1697; - i8 v1699 = (i8)(intptr_t)(f25_ArgvNext); + i8 v1699 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v1699)(); @@ -3630,7 +3630,7 @@ void f3___main(void) { i8 v1704 = (i8)(intptr_t)(ws+32); *(i8*)(intptr_t)v1704 = v1703; - i8 v1705 = (i8)(intptr_t)(f25_ArgvNext); + i8 v1705 = (i8)(intptr_t)(f24_ArgvNext); ((void(*)(void))(intptr_t)v1705)(); @@ -3641,38 +3641,38 @@ void f3___main(void) { i8 v1708 = (i8)(intptr_t)(ws+24); i8 v1709 = *(i8*)(intptr_t)v1708; i8 v1710 = (i8)+0; - if (v1709==v1710) goto c02_01cf; else goto c02_01d2; + if (v1709==v1710) goto c01_01cf; else goto c01_01d2; -c02_01d2:; +c01_01d2:; i8 v1711 = (i8)(intptr_t)(ws+32); i8 v1712 = *(i8*)(intptr_t)v1711; i8 v1713 = (i8)+0; - if (v1712==v1713) goto c02_01cf; else goto c02_01d1; + if (v1712==v1713) goto c01_01cf; else goto c01_01d1; -c02_01d1:; +c01_01d1:; i8 v1714 = (i8)(intptr_t)(ws+1176); i8 v1715 = *(i8*)(intptr_t)v1714; i8 v1716 = (i8)+0; - if (v1715==v1716) goto c02_01d0; else goto c02_01cf; + if (v1715==v1716) goto c01_01d0; else goto c01_01cf; -c02_01cf:; +c01_01cf:; - i8 v1717 = (i8)(intptr_t)(f60_SyntaxError); + i8 v1717 = (i8)(intptr_t)(f59_SyntaxError); ((void(*)(void))(intptr_t)v1717)(); -c02_01d0:; +c01_01d0:; -c02_01c8:; +c01_01c8:; i8 v1718 = (i8)(intptr_t)(ws+40); *(i8*)(intptr_t)(ws+1192) = v1718; i8 v1719 = (i8)(intptr_t)(ws+24); i8 v1720 = *(i8*)(intptr_t)v1719; *(i8*)(intptr_t)(ws+1200) = v1720; - i8 v1721 = (i8)(intptr_t)(f52_FCBOpenIn); + i8 v1721 = (i8)(intptr_t)(f51_FCBOpenIn); ((void(*)(void))(intptr_t)v1721)(); @@ -3683,40 +3683,40 @@ c02_01c8:; i8 v1724 = (i8)(intptr_t)(ws+1184); i1 v1725 = *(i1*)(intptr_t)v1724; i1 v1726 = (i1)+0; - if (v1725==v1726) goto c02_01d7; else goto c02_01d6; + if (v1725==v1726) goto c01_01d7; else goto c01_01d6; -c02_01d6:; +c01_01d6:; - i8 v1727 = (i8)(intptr_t)c02_s0010; + i8 v1727 = (i8)(intptr_t)c01_s0010; *(i8*)(intptr_t)(ws+1304) = v1727; - i8 v1728 = (i8)(intptr_t)(f61_FatalError); + i8 v1728 = (i8)(intptr_t)(f60_FatalError); ((void(*)(void))(intptr_t)v1728)(); -c02_01d7:; +c01_01d7:; -c02_01d3:; +c01_01d3:; i8 v1729 = (i8)(intptr_t)(ws+32); i8 v1730 = *(i8*)(intptr_t)v1729; *(i8*)(intptr_t)(ws+1192) = v1730; - i8 v1731 = (i8)(intptr_t)(f68_EmitterOpenfile); + i8 v1731 = (i8)(intptr_t)(f67_EmitterOpenfile); ((void(*)(void))(intptr_t)v1731)(); - i8 v1732 = (i8)(intptr_t)(f75_ProcessFile); + i8 v1732 = (i8)(intptr_t)(f74_ProcessFile); ((void(*)(void))(intptr_t)v1732)(); - i8 v1733 = (i8)(intptr_t)(f89_CheckSymbols); + i8 v1733 = (i8)(intptr_t)(f88_CheckSymbols); ((void(*)(void))(intptr_t)v1733)(); - i8 v1734 = (i8)(intptr_t)(f69_EmitterClosefile); + i8 v1734 = (i8)(intptr_t)(f68_EmitterClosefile); ((void(*)(void))(intptr_t)v1734)(); } void cmain(void) { - f3___main(); + f2___main(); } diff --git a/update-bootstrap.sh b/update-bootstrap.sh index fe03aaab..3fc4e3ed 100755 --- a/update-bootstrap.sh +++ b/update-bootstrap.sh @@ -1,8 +1,8 @@ #!/bin/sh set -e make -j$(nproc) -cp .obj/bin/cowfe-cgen.nncgen.c bootstrap/cowfe-cgen.bootstrap.c -cp .obj/bin/cowbe-cgen.nncgen.c bootstrap/cowbe-cgen.bootstrap.c -cp .obj/bin/cowlink-cgen.nncgen.c bootstrap/cowlink-cgen.bootstrap.c -cp .obj/bin/cowwrap.nncgen.c bootstrap/cowwrap.bootstrap.c +cp .obj/src/cowfe/+cowfe-for-cgen-with-nncgen/cowlink/cowfe-for-cgen-with-nncgen.c bootstrap/cowfe-cgen.bootstrap.c +cp .obj/src/cowbe/+cowbe-for-cgen-with-nncgen/cowlink/cowbe-for-cgen-with-nncgen.c bootstrap/cowbe-cgen.bootstrap.c +cp .obj/src/cowlink/+cowlink-for-cgen-with-nncgen/cowlink/cowlink-for-cgen-with-nncgen.c bootstrap/cowlink-cgen.bootstrap.c +cp .obj/src/cowwrap/+cowwrap-with-nncgen/cowlink/cowwrap-with-nncgen.c bootstrap/cowwrap.bootstrap.c From 77bdaeed033ce34d4866a0739a0a0ff5665516fc Mon Sep 17 00:00:00 2001 From: David Given Date: Fri, 5 Apr 2024 23:47:24 +0200 Subject: [PATCH 59/69] Convert to use nils. --- src/cowbe/allocator.coh | 4 ++-- src/cowbe/codegen.coh | 34 +++++++++++++++++----------------- src/cowbe/emitter.coh | 4 ++-- src/cowbe/midcodec.coh | 4 ++-- src/cowbe/processor.coh | 8 ++++---- src/cowbe/regcache.coh | 6 +++--- src/cowbe/treewalker.coh | 6 +++--- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/cowbe/allocator.coh b/src/cowbe/allocator.coh index da591703..f084188b 100644 --- a/src/cowbe/allocator.coh +++ b/src/cowbe/allocator.coh @@ -5,7 +5,7 @@ @impl sub InternalAlloc is block := RawAlloc(length); - if block == (0 as [uint8]) then + if block == nil then #print("Emergency purge\n"); #print("before: "); #print_i32(GetFreeMemory() as uint32); @@ -19,7 +19,7 @@ #print_nl(); block := RawAlloc(length); - if block == (0 as [uint8]) then + if block == nil then print("Out of memory\n"); #print("Out of memory allocating "); #print_hex_i32(length as uint32); diff --git a/src/cowbe/codegen.coh b/src/cowbe/codegen.coh index c2f3f8c5..01568a2b 100644 --- a/src/cowbe/codegen.coh +++ b/src/cowbe/codegen.coh @@ -61,9 +61,9 @@ sub AllocSubrId(): (id: uint16) is next_subr_id := next_subr_id + 1; end sub; -var insn_freelist := (0 as [Instruction]); +var insn_freelist: [Instruction] := nil; sub AllocNewInstruction(): (insn: [Instruction]) is - if insn_freelist != (0 as [Instruction]) then + if insn_freelist != nil then insn := insn_freelist; insn_freelist := insn_freelist.next; MemSet(insn as [uint8], 0, @bytesof Instruction); @@ -78,7 +78,7 @@ sub FreeInstruction(insn: [Instruction]) is end sub; @impl sub PurgeAllFreeInstructions is - while insn_freelist != (0 as [Instruction]) loop + while insn_freelist != nil loop var b := insn_freelist as [uint8]; insn_freelist := insn_freelist.next; Free(b); @@ -338,7 +338,7 @@ sub PrintNodes(rootnode: [Node]) is PushNode(rootnode); while next_node != old_next_node loop var node := NextNode(); - if node == (0 as [Node]) then + if node == nil then break; end if; @@ -361,7 +361,7 @@ end sub; sub PrintInstructions(insn: [Instruction]) is loop - if insn == (0 as [Instruction]) then + if insn == nil then break; end if; var ruleid := insn.ruleid; @@ -423,7 +423,7 @@ sub IsSimpleValue(insn: [Instruction], value: [SimpleValue]): (res: uint8) is if node.op == MIDCODE_FALLBACK then node := node.left; end if; - if (node.left != (0 as [Node])) and (IsStackedRegister(node.produced_reg) == 0) then + if (node.left != nil) and (IsStackedRegister(node.produced_reg) == 0) then return; end if; #if (node.op == MIDCODE_DEREF1) and (node.left.op == MIDCODE_ADDRESS) then @@ -499,7 +499,7 @@ sub Generate(rootnode: [Node]) is PushNode(rootnode); while next_node != old_next_node loop var producer := AllocNewInstruction(); - if first_instruction == (0 as [Instruction]) then + if first_instruction == nil then first_instruction := producer; last_instruction := producer; else @@ -583,7 +583,7 @@ sub Generate(rootnode: [Node]) is if rule == &codegen_rules[INSTRUCTION_TEMPLATE_COUNT] then # We've reached the end of the list of rules without matching anything. - if (node.op != MIDCODE_FALLBACK) and (node.consumer != (0 as [Instruction])) then + if (node.op != MIDCODE_FALLBACK) and (node.consumer != nil) then sub ConvertNodeToFallback() is # Wrap this node in a FALLBACK instruction, in the hope that it'll # convert from whatever wanted it to the right thing. @@ -759,7 +759,7 @@ sub Generate(rootnode: [Node]) is break; end if; - if openslot == (0 as [SimpleValue]) then + if openslot == nil then openslot := v; slotreg := reg; else @@ -774,7 +774,7 @@ sub Generate(rootnode: [Node]) is reg := reg >> 1; end loop; - if openslot != (0 as [SimpleValue]) then + if openslot != nil then MemCopy(&value as [uint8], @bytesof SimpleValue, openslot as [uint8]); openslot.count := 0xff; reg := slotreg; @@ -940,7 +940,7 @@ sub Generate(rootnode: [Node]) is i := 0; while i != INSTRUCTION_TEMPLATE_DEPTH loop node := producer.n[i]; - if (node != (0 as [Node])) + if (node != nil) and (node.desired_reg == REG_SAME_AS_INSTRUCTION_RESULT) then node.desired_reg := producer.produced_reg; @@ -952,7 +952,7 @@ sub Generate(rootnode: [Node]) is while j != INSTRUCTION_TEMPLATE_DEPTH loop if i != j then node := producer.n[j]; - if (node != (0 as [Node])) then + if (node != nil) then node.desired_reg := node.desired_reg & ~producer.produced_reg; end if; end if; @@ -975,7 +975,7 @@ sub Generate(rootnode: [Node]) is sub EmitAndFreeInstructions() is loop var insn := last_instruction; - if insn == (0 as [Instruction]) then + if insn == nil then break; end if; last_instruction := last_instruction.prev; @@ -990,7 +990,7 @@ sub Generate(rootnode: [Node]) is #print(MidcodeName(insn.n[0].op)); #print(" produced="); #print_hex_i32(insn.produced_reg as uint32); - #if insn.consumer != (0 as [Node]) then + #if insn.consumer != nil then # print(" consumedby="); # print_hex_i32(insn.consumer.consumer as intptr as uint32); #end if; @@ -1012,7 +1012,7 @@ sub Generate(rootnode: [Node]) is # E_h32(insn as intptr as uint32); # E(" produced="); # E_h32(insn.produced_reg as uint32); - # if insn.consumer != (0 as [Node]) then + # if insn.consumer != nil then # E(" consumedby="); # E_h32(insn.consumer.consumer as intptr as uint32); # end if; @@ -1067,8 +1067,8 @@ sub GenerateConditional(rootnode: [Node]) is rhs.beq.falselabel := f; rhs.beq.fallthrough := r; - node.left := (0 as [Node]); - node.right := (0 as [Node]); + node.left := nil; + node.right := nil; PushNode(rhs); PushNode(lhs); Discard(node); diff --git a/src/cowbe/emitter.coh b/src/cowbe/emitter.coh index 7785891d..7b2b5ac6 100644 --- a/src/cowbe/emitter.coh +++ b/src/cowbe/emitter.coh @@ -30,7 +30,7 @@ sub FlushCurrentStream(close: uint8) is end sub; sub E_b8(byte: uint8) is - if current_stream != (0 as [EmitterStream]) then + if current_stream != nil then outputbuffer[outputbufferpos] := byte; outputbufferpos := outputbufferpos + 1; if outputbufferpos == @bytesof outputbuffer then @@ -189,7 +189,7 @@ sub E_wsref(id: uint16, wsid: uint8, off: uint16) is end sub; sub EmitterOpenStream(subr: [Subroutine]) is - if current_stream == (0 as [EmitterStream]) then + if current_stream == nil then current_stream := &streams[0]; current_stream_id := 0; else diff --git a/src/cowbe/midcodec.coh b/src/cowbe/midcodec.coh index f11add95..5033aa6d 100644 --- a/src/cowbe/midcodec.coh +++ b/src/cowbe/midcodec.coh @@ -34,7 +34,7 @@ include "midcodesbe.coh"; var node_freelist: [Node] := 0 as [Node]; @impl sub AllocateNewNode is - if node_freelist != (0 as [Node]) then + if node_freelist != nil then m := node_freelist; node_freelist := node_freelist.left; MemSet(m as [uint8], 0, @bytesof Node); @@ -55,7 +55,7 @@ sub FreeNode(node: [Node]) is end sub; @impl sub PurgeAllFreeNodes is - while node_freelist != (0 as [Node]) loop + while node_freelist != nil loop var b := node_freelist as [uint8]; node_freelist := node_freelist.left; Free(b); diff --git a/src/cowbe/processor.coh b/src/cowbe/processor.coh index b12e5174..1af43b79 100644 --- a/src/cowbe/processor.coh +++ b/src/cowbe/processor.coh @@ -10,7 +10,7 @@ sub AddSubr(subrid: uint16): (subr: [Subroutine]) is var id := subrid; var index := &subrindex; while id >= SUBR_INDEX_SIZE loop - if index.next == (0 as [SubrIndex]) then + if index.next == nil then index.next := Alloc(@bytesof SubrIndex) as [SubrIndex]; end if; index := index.next; @@ -18,7 +18,7 @@ sub AddSubr(subrid: uint16): (subr: [Subroutine]) is end loop; var slot := &index.subr[id as uint8]; - if [slot] != (0 as [Subroutine]) then + if [slot] != nil then StartError(); print("duplicate subrid 0x"); print_hex_i16(subrid); @@ -35,7 +35,7 @@ end sub; var index := &subrindex; var i := subrid; while i >= SUBR_INDEX_SIZE loop - if index.next == (0 as [SubrIndex]) then + if index.next == nil then StartError(); print("unknown subrid "); print_hex_i16(subrid); @@ -82,7 +82,7 @@ sub ReadM() is end sub; sub ReadParameters(count: uint8, paramp: [[[Parameter]]]) is - if [paramp] != (0 as [[Parameter]]) then + if [paramp] != nil then SimpleError("parameters specified twice"); end if; var p := Alloc(count as intptr * @bytesof intptr) as [[Parameter]]; diff --git a/src/cowbe/regcache.coh b/src/cowbe/regcache.coh index 6f9caaf7..e2811de7 100644 --- a/src/cowbe/regcache.coh +++ b/src/cowbe/regcache.coh @@ -61,7 +61,7 @@ sub RegCacheLeavesConstant(reg: RegId, value: Word) is end loop; p := reg_i_find_empty_slot(); - if p != (0 as [CacheSlot]) then + if p != nil then p.state := CACHE_SLOT_CONSTANT; p.number := value; p.reg := reg; @@ -80,7 +80,7 @@ sub RegCacheLeavesWsRef(reg: RegId, subr: [Subroutine], wsid: uint8, off: Size) end loop; p := reg_i_find_empty_slot(); - if p != (0 as [CacheSlot]) then + if p != nil then p.state := CACHE_SLOT_WSREF; p.subr := subr; p.wsid := wsid; @@ -106,7 +106,7 @@ sub RegCacheLeavesValue(reg: RegId, sym: [Symbol], off: Size) is end loop; p := reg_i_find_empty_slot(); - if p != (0 as [CacheSlot]) then + if p != nil then p.state := CACHE_SLOT_VALUE; p.subr := sym.subr; p.wsid := sym.wsid; diff --git a/src/cowbe/treewalker.coh b/src/cowbe/treewalker.coh index 739d8b68..3f0e034c 100644 --- a/src/cowbe/treewalker.coh +++ b/src/cowbe/treewalker.coh @@ -1,5 +1,5 @@ @impl sub PushNode is - if node != (0 as [Node]) then + if node != nil then if next_node == &nodes[@sizeof nodes] then SimpleError("node stack overflow"); end if; @@ -16,7 +16,7 @@ end sub; # Note: returns children right to left. @impl sub NextNode is node := PopNode(); - if node != (0 as [Node]) then + if node != nil then PushNode(node.left); PushNode(node.right); end if; @@ -63,7 +63,7 @@ sub I_node(): (rootnode: [Node]) is # the queue and add them to the node before queuing it. Eventually we will # end up with a single node on the queue which is the root of the tree. - var queue: [Node] := (0 as [Node]); + var queue: [Node] := nil; while rootnode != 0 as [Node] loop # Remove one item from the list. From 178f61e0ddc969deceff79e20bc8ebb7e2504742 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 6 Apr 2024 00:11:32 +0200 Subject: [PATCH 60/69] Add a bunch of nils. --- src/cowfe/allocator.coh | 12 ++++++------ src/cowfe/codegen.coh | 6 +++--- src/cowfe/emitter.coh | 2 +- src/cowlink/archataritos.coh | 4 ++-- src/cowlink/archbasic.coh | 4 ++-- src/cowlink/archbbct.coh | 4 ++-- src/cowlink/archbbcti.coh | 4 ++-- src/cowlink/archbbctn.coh | 4 ++-- src/cowlink/archcgen.coh | 4 ++-- src/cowlink/archfuzix6303.coh | 4 ++-- src/cowlink/archlx386.coh | 4 ++-- src/cowlink/archlx68k.coh | 4 ++-- src/cowlink/archlxppc.coh | 4 ++-- src/cowlink/archlxthumb2.coh | 4 ++-- src/cowlink/archmsdos.coh | 4 ++-- src/cowlink/archncpm.coh | 4 ++-- src/cowlink/archncpmz.coh | 4 ++-- src/cowlink/archrt11.coh | 4 ++-- src/cowlink/archv7unix.coh | 4 ++-- src/cowlink/asmwrite.coh | 2 +- src/cowlink/cooread.coh | 14 +++++++------- src/cowlink/graph.coh | 16 ++++++++-------- src/cowlink/main.cow | 10 +++++----- src/cowlink/streams.coh | 4 ++-- src/cowlink/types.coh | 4 ++-- 25 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/cowfe/allocator.coh b/src/cowfe/allocator.coh index 747aec8d..8829d287 100644 --- a/src/cowfe/allocator.coh +++ b/src/cowfe/allocator.coh @@ -34,7 +34,7 @@ end sub; var symbol_freelist: [Symbol] := 0 as [Symbol]; @impl sub AllocNewSymbol is - if symbol_freelist != (0 as [Symbol]) then + if symbol_freelist != nil then symbol := symbol_freelist; symbol_freelist := symbol_freelist.next; MemSet(symbol as [uint8], 0, @bytesof Symbol); @@ -58,7 +58,7 @@ end sub; var type_freelist: [Type] := 0 as [Type]; @impl sub AllocNewType is - if type_freelist != (0 as [Type]) then + if type_freelist != nil then type := type_freelist; type_freelist := type_freelist.pointerto; MemSet(type as [uint8], 0, @bytesof Type); @@ -84,19 +84,19 @@ end sub; @impl sub InternalAlloc is block := RawAlloc(length); - if block == (0 as [uint8]) then + if block == nil then #print("Emergency purge\n"); #print("before: "); #print_i32(GetFreeMemory() as uint32); #print_nl(); - while symbol_freelist != (0 as [Symbol]) loop + while symbol_freelist != nil loop block := symbol_freelist as [uint8]; symbol_freelist := symbol_freelist.next; Free(block); end loop; - while type_freelist != (0 as [Type]) loop + while type_freelist != nil loop block := type_freelist as [uint8]; type_freelist := type_freelist.pointerto; Free(block); @@ -109,7 +109,7 @@ end sub; #print_nl(); block := RawAlloc(length); - if block == (0 as [uint8]) then + if block == nil then print("Out of memory\n"); #print("Out of memory allocating "); #print_hex_i32(length as uint32); diff --git a/src/cowfe/codegen.coh b/src/cowfe/codegen.coh index 89bccce6..c2cc3728 100644 --- a/src/cowfe/codegen.coh +++ b/src/cowfe/codegen.coh @@ -18,7 +18,7 @@ sub PrintNodes(rootnode: [Node]) is PushNode(rootnode); while next_node != old_next_node loop var node := NextNode(); - if node == (0 as [Node]) then + if node == nil then break; end if; @@ -90,8 +90,8 @@ sub GenerateConditional(rootnode: [Node]) is rhs.beq.falselabel := f; rhs.beq.fallthrough := r; - node.left := (0 as [Node]); - node.right := (0 as [Node]); + node.left := nil; + node.right := nil; PushNode(rhs); PushNode(lhs); Discard(node); diff --git a/src/cowfe/emitter.coh b/src/cowfe/emitter.coh index 648a472e..480d7eae 100644 --- a/src/cowfe/emitter.coh +++ b/src/cowfe/emitter.coh @@ -181,7 +181,7 @@ sub EmitterDeclareWorkspace(subr: [Subroutine], wid: uint8, workspace: Size) is end sub; sub EmitParameterList(param: [Symbol]) is - while param != (0 as [Symbol]) loop + while param != nil loop E_b16(param.vardata.subr.id); E_b8(param.vardata.wsid); E_bsize(param.vardata.offset); diff --git a/src/cowlink/archataritos.coh b/src/cowlink/archataritos.coh index 781ae3d8..3d2ec99d 100644 --- a/src/cowlink/archataritos.coh +++ b/src/cowlink/archataritos.coh @@ -33,9 +33,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tmove.l 4(%sp), (basepage)\n"); E("\tlea (ws), %a6\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tjsr "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archbasic.coh b/src/cowlink/archbasic.coh index 14826c28..a629c469 100644 --- a/src/cowlink/archbasic.coh +++ b/src/cowlink/archbasic.coh @@ -37,9 +37,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("dim b(16)\n"); E("a=0\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("gosub "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archbbct.coh b/src/cowlink/archbbct.coh index 5696a8bb..c5aa6cf1 100644 --- a/src/cowlink/archbbct.coh +++ b/src/cowlink/archbbct.coh @@ -61,9 +61,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\ttsx\n"); E("\tstx sp\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tjsr "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archbbcti.coh b/src/cowlink/archbbcti.coh index 56fcb646..4b5c4266 100644 --- a/src/cowlink/archbbcti.coh +++ b/src/cowlink/archbbcti.coh @@ -38,9 +38,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tsta vsp\n"); E("\tjsr asmend\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\t.word "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archbbctn.coh b/src/cowlink/archbbctn.coh index f4dea671..8119fef0 100644 --- a/src/cowlink/archbbctn.coh +++ b/src/cowlink/archbbctn.coh @@ -73,9 +73,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\ttsx\r"); E("\tstx sp\r"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tjsr "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archcgen.coh b/src/cowlink/archcgen.coh index 0435b872..5c673e77 100644 --- a/src/cowlink/archcgen.coh +++ b/src/cowlink/archcgen.coh @@ -35,9 +35,9 @@ end sub; sub ArchEmitFooter(coo: [Coo]) is E("void cmain(void) {\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E_b8('\t'); ArchEmitSubRef(main); E("();\n"); diff --git a/src/cowlink/archfuzix6303.coh b/src/cowlink/archfuzix6303.coh index e867d716..32d96ea0 100644 --- a/src/cowlink/archfuzix6303.coh +++ b/src/cowlink/archfuzix6303.coh @@ -38,9 +38,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("text_start:\n"); E("sigvec rts\n"); E("entry:\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tjsr "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archlx386.coh b/src/cowlink/archlx386.coh index e5305f3f..8d9c62df 100644 --- a/src/cowlink/archlx386.coh +++ b/src/cowlink/archlx386.coh @@ -30,9 +30,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tlea 4(%esp), %eax\n"); E("\tmov %eax, (argv)\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tcall "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archlx68k.coh b/src/cowlink/archlx68k.coh index c0305494..4fbe0d4b 100644 --- a/src/cowlink/archlx68k.coh +++ b/src/cowlink/archlx68k.coh @@ -43,9 +43,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tmove.l %a0, (argv)\n"); E("\tlea (ws), %a6\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tjsr "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archlxppc.coh b/src/cowlink/archlxppc.coh index e332be59..eeb87bc9 100644 --- a/src/cowlink/archlxppc.coh +++ b/src/cowlink/archlxppc.coh @@ -41,9 +41,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tlis 4,argv@ha\n"); E("\tstw 3,argv@l(4)\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tbl "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archlxthumb2.coh b/src/cowlink/archlxthumb2.coh index 5d7601e7..021de0cf 100644 --- a/src/cowlink/archlxthumb2.coh +++ b/src/cowlink/archlxthumb2.coh @@ -34,9 +34,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tldr r0, =argv\n"); E("\tstr r1, [r0]\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tbl "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archmsdos.coh b/src/cowlink/archmsdos.coh index 12185efd..f0841255 100644 --- a/src/cowlink/archmsdos.coh +++ b/src/cowlink/archmsdos.coh @@ -33,9 +33,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tmov ax, dgroup\n"); E("\tmov ds, ax\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tcall "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archncpm.coh b/src/cowlink/archncpm.coh index 7eecdd4e..e12e1956 100644 --- a/src/cowlink/archncpm.coh +++ b/src/cowlink/archncpm.coh @@ -29,9 +29,9 @@ sub ArchEmitHeader(coo: [Coo]) is E_u16(STACK_SIZE); E_nl(); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tcall "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archncpmz.coh b/src/cowlink/archncpmz.coh index e9faaf60..dc40080f 100644 --- a/src/cowlink/archncpmz.coh +++ b/src/cowlink/archncpmz.coh @@ -29,9 +29,9 @@ sub ArchEmitHeader(coo: [Coo]) is E_u16(STACK_SIZE); E_nl(); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tcall "); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archrt11.coh b/src/cowlink/archrt11.coh index a86f4061..d3276812 100644 --- a/src/cowlink/archrt11.coh +++ b/src/cowlink/archrt11.coh @@ -31,9 +31,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("start:\n"); E("\t.serr\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tcall\t"); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/archv7unix.coh b/src/cowlink/archv7unix.coh index 806f74d0..333fe8b7 100644 --- a/src/cowlink/archv7unix.coh +++ b/src/cowlink/archv7unix.coh @@ -40,9 +40,9 @@ sub ArchEmitHeader(coo: [Coo]) is E("\tmov r0, argv\n"); E("\tmov #stack_end, sp\n"); - while coo != (0 as [Coo]) loop + while coo != nil loop var main := coo.index.subroutines[0]; - if main != (0 as [Subroutine]) then + if main != nil then E("\tcall\t"); ArchEmitSubRef(main); E_nl(); diff --git a/src/cowlink/asmwrite.coh b/src/cowlink/asmwrite.coh index aebb234c..37cd5ef7 100644 --- a/src/cowlink/asmwrite.coh +++ b/src/cowlink/asmwrite.coh @@ -65,7 +65,7 @@ sub WriteSubroutinesToOutputFile(coo: [Coo]) is end sub; sub WriteAllSubroutinesToOutputFile(coos: [Coo]) is - while coos != (0 as [Coo]) loop + while coos != nil loop print("Copying from input file: "); print(coos.name); print_nl(); diff --git a/src/cowlink/cooread.coh b/src/cowlink/cooread.coh index 7f0dafb1..6c05209e 100644 --- a/src/cowlink/cooread.coh +++ b/src/cowlink/cooread.coh @@ -28,7 +28,7 @@ sub AddRef(subr: [Subroutine], calls: [Subroutine]) is var ref := &subr.refs; while refid >= COO_REFS_SIZE loop - if ref.next == (0 as [References]) then + if ref.next == nil then ref.next := Alloc(@bytesof References) as [References]; end if; ref := ref.next; @@ -41,7 +41,7 @@ end sub; sub FindSub(coo: [Coo], id: uint16): (ptr: [[Subroutine]]) is var subindex := &coo.index; while id >= COO_INDEX_SIZE loop - if subindex.next == (0 as [CooIndex]) then + if subindex.next == nil then subindex.next := Alloc(@bytesof CooIndex) as [CooIndex]; end if; subindex := subindex.next; @@ -54,7 +54,7 @@ end sub; sub FindOrCreateSub(coo: [Coo], id: uint16): (subroutine: [Subroutine]) is var ptr := FindSub(coo, id); subroutine := [ptr]; - if subroutine == (0 as [Subroutine]) then + if subroutine == nil then subroutine := Alloc(@bytesof Subroutine) as [Subroutine]; subroutine.coo := coo; subroutine.next := subroutines; @@ -67,9 +67,9 @@ end sub; sub Deref(subin: [Subroutine]): (subout: [Subroutine]) is subout := subin; - if subin != (0 as [Subroutine]) then + if subin != nil then var external := subin.external; - if external != (0 as [External]) then + if external != nil then subout := external.impl; end if; end if; @@ -77,7 +77,7 @@ end sub; sub FindOrCreateExternal(name: string): (external: [External]) is external := externals; - while external != (0 as [External]) loop + while external != nil loop if StrCmp(external.name, name) == 0 then return; end if; @@ -132,7 +132,7 @@ sub OpenAndLoadCoo(filename: [uint8]): (coo: [Coo]) is subroutine := FindOrCreateSub(coo, id); var name := read_string(&coo.fcb, (len as uint8) - 2); var external := FindOrCreateExternal(name); - if subroutine.external != (0 as [External]) then + if subroutine.external != nil then StartError(); print("multiple external declarations of '"); print(name); diff --git a/src/cowlink/graph.coh b/src/cowlink/graph.coh index 126ffd89..f0476378 100644 --- a/src/cowlink/graph.coh +++ b/src/cowlink/graph.coh @@ -7,11 +7,11 @@ sub ResolveExternals() is # Find all external implementations. var subroutine := subroutines; - while subroutine != (0 as [Subroutine]) loop + while subroutine != nil loop if (subroutine.state & SUB_IMPLEMENTATION) != 0 then external := subroutine.external; - if external != (0 as [External]) then - if (external.impl != (0 as [Subroutine])) and (external.impl != subroutine) then + if external != nil then + if (external.impl != nil) and (external.impl != subroutine) then SimpleError("conflicting externals"); end if; external.impl := subroutine; @@ -23,9 +23,9 @@ sub ResolveExternals() is # Now find any missing implementations. subroutine := subroutines; - while subroutine != (0 as [Subroutine]) loop + while subroutine != nil loop external := subroutine.external; - if (external != (0 as [External])) and (external.impl == (0 as [Subroutine])) then + if (external != nil) and (external.impl == nil) then print("error: external '"); print(external.name); print("' unresolved\n"); @@ -91,13 +91,13 @@ sub PlaceSubroutines(subroutine: [Subroutine]) is end loop; var refs := &subroutine.refs; - while refs != (0 as [References]) loop + while refs != nil loop var j: uint8 := 0; while j != COO_REFS_SIZE loop var called := refs.calls[j]; j := j + 1; - if called == (0 as [Subroutine]) then + if called == nil then break; end if; called := Deref(called); @@ -147,7 +147,7 @@ sub PlaceSubroutines(subroutine: [Subroutine]) is # var total: uint16 := 0; # var used: uint16 := 0; # loop -# if subroutine == (0 as [Subroutine]) then +# if subroutine == nil then # break; # end if; # if subroutine.used != 0 then diff --git a/src/cowlink/main.cow b/src/cowlink/main.cow index 40d6d091..9a11d056 100644 --- a/src/cowlink/main.cow +++ b/src/cowlink/main.cow @@ -37,7 +37,7 @@ sub AddInputFile(filename: [uint8]) is print_nl(); var coo := OpenAndLoadCoo(filename); - if firstCoo == (0 as [Coo]) then + if firstCoo == nil then firstCoo := coo; coos := coo; else @@ -46,12 +46,12 @@ sub AddInputFile(filename: [uint8]) is end if; var thisMain := [FindSub(coo, 0)]; - if thisMain != (0 as [Subroutine]) then - if mainSubroutine == (0 as [Subroutine]) then + if thisMain != nil then + if mainSubroutine == nil then mainSubroutine := thisMain; end if; end if; - if mostRecentSubroutine != (0 as [Subroutine]) then + if mostRecentSubroutine != nil then AddRef(mostRecentSubroutine, thisMain); end if; mostRecentSubroutine := thisMain; @@ -60,7 +60,7 @@ end sub; ArgvInit(); loop var arg := ArgvNext(); - if arg == (0 as [uint8]) then + if arg == nil then break; end if; diff --git a/src/cowlink/streams.coh b/src/cowlink/streams.coh index 7723caa2..a6179bd3 100644 --- a/src/cowlink/streams.coh +++ b/src/cowlink/streams.coh @@ -22,7 +22,7 @@ sub SetStream(sid: uint8) is SimpleError("stream ID out of range"); end if; current_stream := &streams[sid]; - if current_stream.last_chunk == (0 as [EmitterChunk]) then + if current_stream.last_chunk == nil then var chunk := Alloc(@bytesof EmitterChunk) as [EmitterChunk]; current_stream.first_chunk := chunk; current_stream.last_chunk := chunk; @@ -136,7 +136,7 @@ end sub; sub FlushStream() is var chunk := current_stream.first_chunk; - while chunk != (0 as [EmitterChunk]) loop + while chunk != nil loop var i: uint8 := 0; while i != chunk.len loop WriteCharacterFromStream(chunk.buffer[i]); diff --git a/src/cowlink/types.coh b/src/cowlink/types.coh index 668e50e4..b27ba119 100644 --- a/src/cowlink/types.coh +++ b/src/cowlink/types.coh @@ -42,8 +42,8 @@ record External is impl: [Subroutine]; end record; -var externals: [External] := (0 as [External]); -var subroutines: [Subroutine] := (0 as [Subroutine]); +var externals: [External] := nil; +var subroutines: [Subroutine] := nil; var current_id: uint16 := 1; var current_subroutine: [Subroutine]; From a22bef6adb0904f7bbe0f8f7ed56445a1ed3e416 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 6 Apr 2024 00:27:19 +0200 Subject: [PATCH 61/69] Convert all the rest of the nils. --- examples/argv.cow | 2 +- examples/file.cow | 4 ++-- rt/ataritos/argv.coh | 2 +- rt/bbct/argv.coh | 2 +- rt/cgen/argv.coh | 4 ++-- rt/cgen/malloc.coh | 2 +- rt/cpm/argv.coh | 2 +- rt/cpmz/argv.coh | 2 +- rt/lx386/argv.coh | 4 ++-- rt/lx68k/argv.coh | 4 ++-- rt/lxppc/argv.coh | 4 ++-- rt/lxthumb2/argv.coh | 4 ++-- rt/malloc.coh | 20 ++++++++++---------- rt/msdos/argv.coh | 2 +- rt/unixv7/argv.coh | 4 ++-- src/cowasm/arch8080.cow | 14 +++++++------- src/cowasm/cowasm.coh | 14 +++++++------- src/cowasm2/symbols.coh | 2 +- src/cowbdmp/main.cow | 2 +- src/cowfe/expressions.coh | 10 +++++----- src/cowfe/lexer.coh | 10 +++++----- src/cowfe/midcodec.coh | 8 ++++---- src/cowfe/namespace.coh | 28 ++++++++++++++-------------- src/cowfe/regcache.coh | 6 +++--- src/cowfe/symbols.coh | 10 +++++----- src/cowfe/treewalker.coh | 4 ++-- src/cowwrap/emitter.coh | 4 ++-- src/cowwrap/reader.coh | 12 ++++++------ tests/null.test.cow | 2 +- 29 files changed, 94 insertions(+), 94 deletions(-) diff --git a/examples/argv.cow b/examples/argv.cow index 417e6375..ca6275eb 100644 --- a/examples/argv.cow +++ b/examples/argv.cow @@ -6,7 +6,7 @@ ArgvInit(); var i: uint8 := 0; loop var arg := ArgvNext(); - if arg == (0 as [uint8]) then + if arg == nil then break; end if; print_hex_i8(i); diff --git a/examples/file.cow b/examples/file.cow index f327dc99..da4951ac 100644 --- a/examples/file.cow +++ b/examples/file.cow @@ -8,8 +8,8 @@ var outputFilename: [uint8]; ArgvInit(); inputFilename := ArgvNext(); outputFilename := ArgvNext(); -if (inputFilename == (0 as [uint8])) or (outputFilename == (0 as [uint8])) - or (ArgvNext() != (0 as [uint8])) then +if (inputFilename == nil) or (outputFilename == nil) + or (ArgvNext() != nil) then print("Syntax error!\n"); return; end if; diff --git a/rt/ataritos/argv.coh b/rt/ataritos/argv.coh index b57490f7..be7ba911 100644 --- a/rt/ataritos/argv.coh +++ b/rt/ataritos/argv.coh @@ -13,7 +13,7 @@ end sub; sub ArgvNext(): (arg: [uint8]) is # No more arguments? - if argv_pointer == (0 as [uint8]) then + if argv_pointer == nil then arg := argv_pointer; return; end if; diff --git a/rt/bbct/argv.coh b/rt/bbct/argv.coh index c3f6f525..2aaad866 100644 --- a/rt/bbct/argv.coh +++ b/rt/bbct/argv.coh @@ -8,7 +8,7 @@ end sub; sub ArgvNext(): (arg: [uint8]) is # No more arguments? - if (argv_pointer == (0 as [uint8])) or ([argv_pointer] == 0) then + if (argv_pointer == nil) or ([argv_pointer] == 0) then arg := 0 as [uint8]; return; end if; diff --git a/rt/cgen/argv.coh b/rt/cgen/argv.coh index 1c64dc0a..bef97e72 100644 --- a/rt/cgen/argv.coh +++ b/rt/cgen/argv.coh @@ -10,12 +10,12 @@ sub ArgvNext(): (arg: [uint8]) is # No more arguments? if argv_pointer == (0 as [[uint8]]) then - arg := (0 as [uint8]); + arg := nil; return; end if; arg := [argv_pointer]; - if arg == (0 as [uint8]) then + if arg == nil then # No more arguments. argv_pointer := (0 as [[uint8]]); else diff --git a/rt/cgen/malloc.coh b/rt/cgen/malloc.coh index 41825170..aa36d852 100644 --- a/rt/cgen/malloc.coh +++ b/rt/cgen/malloc.coh @@ -8,7 +8,7 @@ end sub; sub Alloc(length: intptr): (block: [uint8]) is block := RawAlloc(length); - if block == (0 as [uint8]) then + if block == nil then print("Out of memory"); ExitWithError(); end if; diff --git a/rt/cpm/argv.coh b/rt/cpm/argv.coh index 64429e99..7f815f99 100644 --- a/rt/cpm/argv.coh +++ b/rt/cpm/argv.coh @@ -9,7 +9,7 @@ end sub; sub ArgvNext(): (arg: [uint8]) is # No more arguments? - if argv_pointer == (0 as [uint8]) then + if argv_pointer == nil then arg := argv_pointer; return; end if; diff --git a/rt/cpmz/argv.coh b/rt/cpmz/argv.coh index 64429e99..7f815f99 100644 --- a/rt/cpmz/argv.coh +++ b/rt/cpmz/argv.coh @@ -9,7 +9,7 @@ end sub; sub ArgvNext(): (arg: [uint8]) is # No more arguments? - if argv_pointer == (0 as [uint8]) then + if argv_pointer == nil then arg := argv_pointer; return; end if; diff --git a/rt/lx386/argv.coh b/rt/lx386/argv.coh index c6da5c7b..f0948dc6 100644 --- a/rt/lx386/argv.coh +++ b/rt/lx386/argv.coh @@ -11,12 +11,12 @@ sub ArgvNext(): (arg: [uint8]) is # No more arguments? if argv_pointer == (0 as [[uint8]]) then - arg := (0 as [uint8]); + arg := nil; return; end if; arg := [argv_pointer]; - if arg == (0 as [uint8]) then + if arg == nil then # No more arguments. argv_pointer := (0 as [[uint8]]); else diff --git a/rt/lx68k/argv.coh b/rt/lx68k/argv.coh index 0238a4a8..275c45fc 100644 --- a/rt/lx68k/argv.coh +++ b/rt/lx68k/argv.coh @@ -10,12 +10,12 @@ sub ArgvNext(): (arg: [uint8]) is # No more arguments? if argv_pointer == (0 as [[uint8]]) then - arg := (0 as [uint8]); + arg := nil; return; end if; arg := [argv_pointer]; - if arg == (0 as [uint8]) then + if arg == nil then # No more arguments. argv_pointer := (0 as [[uint8]]); else diff --git a/rt/lxppc/argv.coh b/rt/lxppc/argv.coh index cef760c9..cf74873b 100644 --- a/rt/lxppc/argv.coh +++ b/rt/lxppc/argv.coh @@ -13,12 +13,12 @@ sub ArgvNext(): (arg: [uint8]) is # No more arguments? if argv_pointer == (0 as [[uint8]]) then - arg := (0 as [uint8]); + arg := nil; return; end if; arg := [argv_pointer]; - if arg == (0 as [uint8]) then + if arg == nil then # No more arguments. argv_pointer := (0 as [[uint8]]); else diff --git a/rt/lxthumb2/argv.coh b/rt/lxthumb2/argv.coh index b1ee08ec..fc49ab4e 100644 --- a/rt/lxthumb2/argv.coh +++ b/rt/lxthumb2/argv.coh @@ -13,12 +13,12 @@ sub ArgvNext(): (arg: [uint8]) is # No more arguments? if argv_pointer == (0 as [[uint8]]) then - arg := (0 as [uint8]); + arg := nil; return; end if; arg := [argv_pointer]; - if arg == (0 as [uint8]) then + if arg == nil then # No more arguments. argv_pointer := (0 as [[uint8]]); else diff --git a/rt/malloc.coh b/rt/malloc.coh index 5b36f5d5..5d748114 100644 --- a/rt/malloc.coh +++ b/rt/malloc.coh @@ -17,7 +17,7 @@ sub DumpBlocks() is print("* freelist: "); print_hex_i32(p as intptr as uint32); print_nl(); - while p != (0 as [MallocFreeBlock]) loop + while p != nil loop print("* block @"); print_hex_i32(p as intptr as uint32); print("+"); @@ -39,9 +39,9 @@ end sub; sub CheckMemoryChain() is var p := freeList; - while p != (0 as [MallocFreeBlock]) loop + while p != nil loop var next := p.next; - if next == (0 as [MallocFreeBlock]) then + if next == nil then break; end if; if next <= p then @@ -77,7 +77,7 @@ sub RawAlloc(length: intptr): (block: [uint8]) is var csize: intptr := -1; # Try to find the smallest block which will fit. - while p != (0 as [MallocFreeBlock]) loop + while p != nil loop var s := p.size; if (s >= totallength) and (s < csize) then candidate := p; @@ -91,7 +91,7 @@ sub RawAlloc(length: intptr): (block: [uint8]) is prev := p; p := p.next; end loop; - if candidate == (0 as [MallocFreeBlock]) then + if candidate == nil then # Nothing was found. block := 0 as [uint8]; return; @@ -100,7 +100,7 @@ sub RawAlloc(length: intptr): (block: [uint8]) is var delta := csize - totallength; if delta < @bytesof MallocFreeBlock then # Consume the entire block. - if cprev != (0 as [MallocFreeBlock]) then + if cprev != nil then cprev.next := candidate.next; else freeList := candidate.next; @@ -135,7 +135,7 @@ end sub; sub Alloc(length: intptr): (block: [uint8]) is block := RawAlloc(length); - if block == (0 as [uint8]) then + if block == nil then print("Out of memory"); ExitWithError(); end if; @@ -174,7 +174,7 @@ sub AddFreeBlock(start: [uint8], length: intptr) is loop # Is this the last block? - if p.next == (0 as [MallocFreeBlock]) then + if p.next == nil then # Insert the new block after it. p.next := h; @@ -214,7 +214,7 @@ sub AddFreeBlock(start: [uint8], length: intptr) is end sub; sub Free(start: [uint8]) is - if start != (0 as [uint8]) then + if start != nil then var usedblock := @prev (start as [MallocUsedBlock]); AddFreeBlock(usedblock as [uint8], usedblock.size); end if; @@ -223,7 +223,7 @@ end sub; sub GetFreeMemory(): (bytes: intptr) is bytes := 0; var p := freeList; - while p != (0 as [MallocFreeBlock]) loop + while p != nil loop bytes := bytes + p.size; p := p.next; end loop; diff --git a/rt/msdos/argv.coh b/rt/msdos/argv.coh index be432025..5521cc73 100644 --- a/rt/msdos/argv.coh +++ b/rt/msdos/argv.coh @@ -26,7 +26,7 @@ end sub; sub ArgvNext(): (arg: [uint8]) is # No more arguments? - if argv_pointer == (0 as [uint8]) then + if argv_pointer == nil then arg := argv_pointer; return; end if; diff --git a/rt/unixv7/argv.coh b/rt/unixv7/argv.coh index 2b87cf11..bb899824 100644 --- a/rt/unixv7/argv.coh +++ b/rt/unixv7/argv.coh @@ -10,12 +10,12 @@ sub ArgvNext(): (arg: [uint8]) is # No more arguments? if argv_pointer == (0 as [[uint8]]) then - arg := (0 as [uint8]); + arg := nil; return; end if; arg := [argv_pointer]; - if arg == (0 as [uint8]) then + if arg == nil then # No more arguments. argv_pointer := (0 as [[uint8]]); else diff --git a/src/cowasm/arch8080.cow b/src/cowasm/arch8080.cow index 53251e34..e3373d11 100644 --- a/src/cowasm/arch8080.cow +++ b/src/cowasm/arch8080.cow @@ -173,7 +173,7 @@ sub FindSymbol(name: string): (psymbol: [[Symbol]]) is psymbol := &symbolTable[hash & 0x1f]; loop var symbol := [psymbol]; - if symbol == (0 as [Symbol]) then + if symbol == nil then break; end if; @@ -336,7 +336,7 @@ sub ReadToken(): (token: Token) is tokenBuffer[tokenLength] := 0; var psymbol := FindSymbol(&tokenBuffer[0]); - if [psymbol] == (0 as [Symbol]) then + if [psymbol] == nil then AddSymbol(psymbol, HeapifyToken()); else tokenSymbol := [psymbol]; @@ -656,7 +656,7 @@ sub TitleCb implements SymbolCallback is end sub; sub EquCb implements SymbolCallback is - if currentLabel == (0 as [Symbol]) then + if currentLabel == nil then SimpleError("equ with no label"); end if; @@ -670,7 +670,7 @@ sub EquCb implements SymbolCallback is end sub; sub SetCb implements SymbolCallback is - if currentLabel == (0 as [Symbol]) then + if currentLabel == nil then SimpleError("set with no label"); end if; @@ -970,13 +970,13 @@ sub InitialiseSymbolTable() is var p := &symbols[0]; while p != &symbols[@sizeof symbols] loop var psymbol := FindSymbol(p.name); - if [psymbol] != (0 as [Symbol]) then + if [psymbol] != nil then StartError(); print("duplicate symbol during init "); print(p.name); EndError(); end if; - p.next := (0 as [Symbol]); + p.next := nil; [psymbol] := p; p := @next p; @@ -1076,7 +1076,7 @@ sub CheckForUndefinedSymbols() is var psymbol := &symbolTable[0]; while psymbol != &symbolTable[@sizeof symbolTable] loop var symbol := [psymbol]; - while symbol != (0 as [Symbol]) loop + while symbol != nil loop if symbol.callback == UndefinedLabelCb then print("undefined symbol: "); print(symbol.name); diff --git a/src/cowasm/cowasm.coh b/src/cowasm/cowasm.coh index 7ec4e183..e17c11cb 100644 --- a/src/cowasm/cowasm.coh +++ b/src/cowasm/cowasm.coh @@ -182,7 +182,7 @@ sub FindSymbol(name: string): (psymbol: [[Symbol]]) is psymbol := &symbolTable[hash & 0x1f]; loop var symbol := [psymbol]; - if symbol == (0 as [Symbol]) then + if symbol == nil then break; end if; @@ -374,7 +374,7 @@ sub ReadToken(): (token: Token) is tokenBuffer[tokenLength] := 0; var psymbol := FindSymbol(&tokenBuffer[0]); - if [psymbol] == (0 as [Symbol]) then + if [psymbol] == nil then AddSymbol(psymbol, HeapifyToken()); else tokenSymbol := [psymbol]; @@ -734,7 +734,7 @@ sub TitleCb implements SymbolCallback is end sub; sub EquCb implements SymbolCallback is - if currentLabel == (0 as [Symbol]) then + if currentLabel == nil then SimpleError("equ with no label"); end if; @@ -753,7 +753,7 @@ sub EquCb implements SymbolCallback is end sub; sub SetCb implements SymbolCallback is - if currentLabel == (0 as [Symbol]) then + if currentLabel == nil then SimpleError("set with no label"); end if; @@ -983,7 +983,7 @@ sub CheckForUndefinedSymbols() is var psymbol := &symbolTable[0]; while psymbol != &symbolTable[@sizeof symbolTable] loop var symbol := [psymbol]; - while symbol != (0 as [Symbol]) loop + while symbol != nil loop if symbol.callback == UndefinedLabelCb then print("undefined symbol: "); print(symbol.name); @@ -1056,13 +1056,13 @@ end sub; sub AddSymbols(p: [Symbol], endp: [Symbol]) is while p != endp loop var psymbol := FindSymbol(p.name); - if [psymbol] != (0 as [Symbol]) then + if [psymbol] != nil then StartError(); print("duplicate symbol during init "); print(p.name); EndError(); end if; - p.next := (0 as [Symbol]); + p.next := nil; [psymbol] := p; p := @next p; diff --git a/src/cowasm2/symbols.coh b/src/cowasm2/symbols.coh index 7b4d6e5e..65dce023 100644 --- a/src/cowasm2/symbols.coh +++ b/src/cowasm2/symbols.coh @@ -19,7 +19,7 @@ sub FindSymbol(name: string): (symbol: [Symbol]) is var hash := [name] & 0xf; var chain := &hashtable[hash]; symbol := [chain]; - while symbol != (0 as [Symbol]) loop + while symbol != nil loop if StrCmp(symbol.name, name) == 0 then return; end if; diff --git a/src/cowbdmp/main.cow b/src/cowbdmp/main.cow index 821785df..2758d440 100644 --- a/src/cowbdmp/main.cow +++ b/src/cowbdmp/main.cow @@ -82,7 +82,7 @@ sub ReadM() is PushNode(rootnode); while next_node != old_next_node loop var node := NextNode(); - if node == (0 as [Node]) then + if node == nil then break; end if; diff --git a/src/cowfe/expressions.coh b/src/cowfe/expressions.coh index be88c8bc..7fe046cc 100644 --- a/src/cowfe/expressions.coh +++ b/src/cowfe/expressions.coh @@ -8,7 +8,7 @@ sub expr_i_cant_do_that(lhs: [Node], rhs: [Node]) is end sub; sub CheckExpressionType(node: [Node], type: [Type]) is - if node.type == (0 as [Type]) then + if node.type == nil then node.type := type; end if; @@ -31,7 +31,7 @@ sub CheckExpressionType(node: [Node], type: [Type]) is end sub; sub ResolveUntypedConstantsForAddOrSub(lhs: [Node], rhs: [Node]) is - if (lhs.type != (0 as [Type])) and (rhs.type == (0 as [Type])) then + if (lhs.type != nil) and (rhs.type == nil) then if IsNum(lhs.type) != 0 then rhs.type := lhs.type; elseif IsPtr(lhs.type) != 0 then @@ -40,7 +40,7 @@ sub ResolveUntypedConstantsForAddOrSub(lhs: [Node], rhs: [Node]) is SimpleError("cannot use an untyped constant in this context"); end if; end if; - if (lhs.type == (0 as [Type])) and (rhs.type != (0 as [Type])) then + if (lhs.type == nil) and (rhs.type != nil) then if IsNum(rhs.type) != 0 then lhs.type := rhs.type; elseif IsPtr(rhs.type) != 0 then @@ -72,10 +72,10 @@ end sub; sub ResolveUntypedConstantsSimply(lhs: [Node], rhs: [Node]) is var ltype := lhs.type; var rtype := rhs.type; - if (ltype != (0 as [Type])) and (rtype == (0 as [Type])) then + if (ltype != nil) and (rtype == nil) then CheckNilCompatible(lhs, rhs); rhs.type := ltype; - elseif (ltype == (0 as [Type])) and (rtype != (0 as [Type])) then + elseif (ltype == nil) and (rtype != nil) then CheckNilCompatible(rhs, lhs); lhs.type := rtype; elseif ltype != rtype then diff --git a/src/cowfe/lexer.coh b/src/cowfe/lexer.coh index 70a6b7d5..ea258736 100644 --- a/src/cowfe/lexer.coh +++ b/src/cowfe/lexer.coh @@ -212,7 +212,7 @@ var keyword_ids: uint8[] := { sub StartError() is print("error: "); - if current_file == (0 as [File]) then + if current_file == nil then print(""); else print(current_file.path); @@ -268,13 +268,13 @@ sub LexerIncludeFile(path: string) is f.next := current_file; f.lineno := 1; - if current_file != (0 as [File]) then + if current_file != nil then lexer_i_close(current_file); end if; var p := include_paths; var fl := StrLen(path); - while p != (0 as [IncludePath]) loop + while p != nil loop var il := StrLen(p.path); f.path := InternalAlloc(fl + il + 1); MemCopy(p.path, il, f.path); @@ -323,7 +323,7 @@ sub LexerReadToken(): (token: uint8) is end if; loop - if current_file == (0 as [File]) then + if current_file == nil then c := 0; break; end if; @@ -341,7 +341,7 @@ sub LexerReadToken(): (token: uint8) is lexer_i_close(f); Free(f as [uint8]); - if current_file != (0 as [File]) then + if current_file != nil then file_nesting := file_nesting - 1; LexerPrintSpaces(); print("< "); diff --git a/src/cowfe/midcodec.coh b/src/cowfe/midcodec.coh index 369023db..97398ea6 100644 --- a/src/cowfe/midcodec.coh +++ b/src/cowfe/midcodec.coh @@ -1,7 +1,7 @@ sub CountParameters(param: [Symbol]): (count: uint8) is count := 0; - while param != (0 as [Symbol]) loop + while param != nil loop count := count + 1; param := param.vardata.next_parameter; end loop; @@ -53,7 +53,7 @@ include "midcodesfe.coh"; var node_freelist: [Node] := 0 as [Node]; @impl sub AllocateNewNode is - if node_freelist != (0 as [Node]) then + if node_freelist != nil then m := node_freelist; node_freelist := node_freelist.left; MemSet(m as [uint8], 0, @bytesof Node); @@ -74,7 +74,7 @@ sub FreeNode(node: [Node]) is end sub; @impl sub PurgeAllFreeNodes is - while node_freelist != (0 as [Node]) loop + while node_freelist != nil loop var b := node_freelist as [uint8]; node_freelist := node_freelist.left; Free(b); @@ -83,7 +83,7 @@ end sub; sub NodeWidth(node: [Node]): (width: uint8) is width := 0; - if node.type != (0 as [Type]) then + if node.type != nil then width := node.type.width as uint8; end if; end sub; diff --git a/src/cowfe/namespace.coh b/src/cowfe/namespace.coh index 518233d8..417dc0cb 100644 --- a/src/cowfe/namespace.coh +++ b/src/cowfe/namespace.coh @@ -1,6 +1,6 @@ sub LookupSymbolInNamespace(namespace: [Namespace], name: string): (symbol: [Symbol]) is symbol := namespace.first; - while symbol != (0 as [Symbol]) loop + while symbol != nil loop if StrCmp(symbol.name, name) == 0 then while symbol.kind == TYPEDEF loop symbol := symbol.alias; @@ -9,28 +9,28 @@ sub LookupSymbolInNamespace(namespace: [Namespace], name: string): (symbol: [Sym end if; symbol := symbol.next; end loop; - symbol := (0 as [Symbol]); + symbol := nil; end sub; sub LookupSymbol(namespace: [Namespace], name: string): (symbol: [Symbol]) is - if namespace == (0 as [Namespace]) then + if namespace == nil then namespace := ¤t_subr.namespace; end if; - while namespace != (0 as [Namespace]) loop + while namespace != nil loop symbol := LookupSymbolInNamespace(namespace, name); - if symbol != (0 as [Symbol]) then + if symbol != nil then return; end if; namespace := namespace.parent; end loop; - symbol := (0 as [Symbol]); + symbol := nil; end sub; # Note: does not check for name duplications (deliberately) sub AddToNamespace(namespace: [Namespace], symbol: [Symbol]) is - if namespace.last == (0 as [Symbol]) then + if namespace.last == nil then namespace.first := symbol; namespace.last := symbol; else @@ -42,13 +42,13 @@ end sub; # Takes ownership of the string sub AddSymbol(namespace: [Namespace], name: string): (symbol: [Symbol]) is - if namespace == (0 as [Namespace]) then + if namespace == nil then namespace := ¤t_subr.namespace; end if; symbol := AllocNewSymbol(); if name != (0 as string) then - if LookupSymbolInNamespace(namespace, name) != (0 as [Symbol]) then + if LookupSymbolInNamespace(namespace, name) != nil then StartError(); print("symbol '"); print(name); @@ -107,7 +107,7 @@ end sub; sub IsTypeOfKind(type: [Type], kind: uint8): (result: uint8) is result := 0; - if (type != (0 as [Type])) and (type.kind == kind) then + if (type != nil) and (type.kind == kind) then result := 1; end if; end sub; @@ -125,7 +125,7 @@ sub IsSubroutine(type: [Type]): (result: uint8) is end sub; sub IsNum(type: [Type]): (result: uint8) is - if type == (0 as [Type]) then + if type == nil then result := 1; else result := IsTypeOfKind(type, TYPE_NUMBER); @@ -133,7 +133,7 @@ sub IsNum(type: [Type]): (result: uint8) is end sub; sub IsSNum(type: [Type]): (result: uint8) is - if type == (0 as [Type]) then + if type == nil then result := 1; elseif (IsTypeOfKind(type, TYPE_NUMBER) != 0) and (type.numbertype.is_signed != 0) then result := 1; @@ -175,7 +175,7 @@ sub UndoLValue(lvalue: [Node]): (address: [Node]) is end if; address := lvalue.left; - lvalue.left := (0 as [Node]); + lvalue.left := nil; Discard(lvalue); end sub; @@ -191,7 +191,7 @@ sub MaybeUndoLValue(lvalue: [Node]): (address: [Node]) is var k := lvalue.op; if (k >= MIDCODE_DEREF0) and (k <= MIDCODE_DEREF8) then address := lvalue.left; - lvalue.left := (0 as [Node]); + lvalue.left := nil; elseif IsPtr(lvalue.type) != 0 then address := lvalue; else diff --git a/src/cowfe/regcache.coh b/src/cowfe/regcache.coh index 2d7c1ca0..0f46e381 100644 --- a/src/cowfe/regcache.coh +++ b/src/cowfe/regcache.coh @@ -50,7 +50,7 @@ sub RegCacheLeavesConstant(reg: RegId, value: Word) is end loop; p := reg_i_find_empty_slot(); - if p != (0 as [CacheSlot]) then + if p != nil then p.state := CACHE_SLOT_CONSTANT; p.number := value; p.reg := reg; @@ -68,7 +68,7 @@ sub RegCacheLeavesAddress(reg: RegId, sym: [Symbol], off: Size) is end loop; p := reg_i_find_empty_slot(); - if p != (0 as [CacheSlot]) then + if p != nil then p.state := CACHE_SLOT_ADDRESS; p.symbol := sym; p.number := off as Word; @@ -87,7 +87,7 @@ sub RegCacheLeavesValue(reg: RegId, sym: [Symbol], off: Size) is end loop; p := reg_i_find_empty_slot(); - if p != (0 as [CacheSlot]) then + if p != nil then p.state := CACHE_SLOT_VALUE; p.symbol := sym; p.number := off as Word; diff --git a/src/cowfe/symbols.coh b/src/cowfe/symbols.coh index e5d39a86..cf2f521c 100644 --- a/src/cowfe/symbols.coh +++ b/src/cowfe/symbols.coh @@ -20,7 +20,7 @@ end sub; sub MakePointerType(type: [Type]): (ptrtype: [Type]) is ptrtype := type.pointerto; - if ptrtype == (0 as [Type]) then + if ptrtype == nil then ptrtype := AllocNewType(); ptrtype.kind := TYPE_POINTER; ptrtype.width := intptr_type.width; @@ -61,7 +61,7 @@ sub DestructSubroutineContents(subr: [Subroutine]) is # Adds all members of the namespace to the pending list. sub QueueNamespace(namespace: [Namespace]) is - while namespace.first != (0 as [Symbol]) loop + while namespace.first != nil loop var s := namespace.first; namespace.first := s.next; @@ -85,11 +85,11 @@ sub DestructSubroutineContents(subr: [Subroutine]) is # are none. pending := subr.namespace.first; - if last_parameter != (0 as [Symbol]) then + if last_parameter != nil then pending := last_parameter.next; end if; - while pending != (0 as [Symbol]) loop + while pending != nil loop var symbol := pending; pending := pending.next; @@ -113,7 +113,7 @@ sub DestructSubroutineContents(subr: [Subroutine]) is FreeSymbol(symbol); end loop; - if last_parameter != (0 as [Symbol]) then + if last_parameter != nil then last_parameter.next := 0 as [Symbol]; else subr.namespace.first := 0 as [Symbol]; diff --git a/src/cowfe/treewalker.coh b/src/cowfe/treewalker.coh index ddb2dc24..410cad08 100644 --- a/src/cowfe/treewalker.coh +++ b/src/cowfe/treewalker.coh @@ -1,5 +1,5 @@ @impl sub PushNode is - if node != (0 as [Node]) then + if node != nil then if next_node == &nodes[@sizeof nodes] then SimpleError("node stack overflow"); end if; @@ -15,7 +15,7 @@ end sub; @impl sub NextNode is node := PopNode(); - if node != (0 as [Node]) then + if node != nil then PushNode(node.left); PushNode(node.right); end if; diff --git a/src/cowwrap/emitter.coh b/src/cowwrap/emitter.coh index 79c74799..78142d97 100644 --- a/src/cowwrap/emitter.coh +++ b/src/cowwrap/emitter.coh @@ -18,7 +18,7 @@ end record; var current_chunk: [EmitterChunk]; sub E_b8(byte: uint8) is - if current_chunk != (0 as [EmitterChunk]) then + if current_chunk != nil then var r := current_chunk.current_record; if r.ptr == RECORD_SIZE then r := Alloc(@bytesof EmitterRecord) as [EmitterRecord]; @@ -69,7 +69,7 @@ sub EmitterPopChunk(type: uint8) is FCBPutChar(&outfcb, (len>>8) as uint8); var r := current_chunk.first_record; - while r != (0 as [EmitterRecord]) loop + while r != nil loop var i: uint8 := 0; while i != r.ptr loop FCBPutChar(&outfcb, r.data[i]); diff --git a/src/cowwrap/reader.coh b/src/cowwrap/reader.coh index ad959361..9585f297 100644 --- a/src/cowwrap/reader.coh +++ b/src/cowwrap/reader.coh @@ -15,11 +15,11 @@ var main_symbol: Symbol; var symbols: [Symbol] := &main_symbol; var current_id: SubId := 1; -var current_subr: [Symbol] := (0 as [Symbol]); +var current_subr: [Symbol] := nil; sub GetSymbol(name: string): (symbol: [Symbol]) is symbol := symbols; - while symbol != (0 as [Symbol]) loop + while symbol != nil loop if StrCmp(name, symbol.name) == 0 then return; end if; @@ -117,9 +117,9 @@ sub ProcessFile() is end sub; sub CloseChunk() is - if current_subr != (0 as [Symbol]) then + if current_subr != nil then EmitterPopChunk('F'); - current_subr := (0 as [Symbol]); + current_subr := nil; end if; end sub; @@ -174,7 +174,7 @@ sub ProcessFile() is end sub; sub SourceLine() is - if current_subr == (0 as [Symbol]) then + if current_subr == nil then FatalError("source text with no subroutine defined"); end if; loop @@ -249,7 +249,7 @@ end sub; sub CheckSymbols() is var success: uint8 := 1; var s := symbols; - while s != (0 as [Symbol]) loop + while s != nil loop if s.state == SYM_UNDECLARED then print("reference to undeclared symbol '"); print(s.name); diff --git a/tests/null.test.cow b/tests/null.test.cow index 6ffa512b..5edd6769 100644 --- a/tests/null.test.cow +++ b/tests/null.test.cow @@ -2,5 +2,5 @@ include "cowgol.coh"; include "tests/_framework.coh"; var p: [uint8] := nil; -print("p == 0"); if p == (0 as [uint8]) then yes(); else no(); end if; +print("p == 0"); if p == nil then yes(); else no(); end if; print("p == nil"); if p == nil then yes(); else no(); end if; From 64bf2f4f54a4eb7da005e4cb2b8264b4f842dd28 Mon Sep 17 00:00:00 2001 From: David Given Date: Sat, 6 Apr 2024 10:58:30 +0200 Subject: [PATCH 62/69] Document nil. --- doc/language.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/language.md b/doc/language.md index 90b864d4..e3078418 100644 --- a/doc/language.md +++ b/doc/language.md @@ -306,6 +306,7 @@ var p: [uint8]; # pointer type p := &v.i; # allowed: taking the address of a member p := &i; # disallowed: taking the address of a scalar variable [p] := [p] + 1; # dereference pointer +p := nil; # nil is convertible to any pointer ``` From 7ebd910285f4c0a4ee7460780e88f39601d0666f Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Tue, 7 May 2024 16:30:19 +0300 Subject: [PATCH 63/69] small optimization: % poweroftwo -> & poweroftwo-1 --- src/cowfe/midcodec.coh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cowfe/midcodec.coh b/src/cowfe/midcodec.coh index 97398ea6..efd6b035 100644 --- a/src/cowfe/midcodec.coh +++ b/src/cowfe/midcodec.coh @@ -197,6 +197,15 @@ sub MidC2Op(op: uint8, width: uint8, lhs: [Node], rhs: [Node]): (result: [Node]) end case; end if; end if; + if (op == MIDCODE_REMU0) then + value := rhs.constant.value; + exp := GetPowerOfTwo(value); + if exp != 0 then + Discard(rhs); + rhs := MidConstant((value-1) as int32); + op := MIDCODE_AND0; + end if; + end if; if (op == MIDCODE_LSHIFT0) or (op == MIDCODE_RSHIFTU0) or (op == MIDCODE_RSHIFTS0) then if rhs.constant.value == 0 then Discard(rhs); From 6114564fc02e5443cd2639aaec574116dc9e8d97 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Sat, 18 May 2024 14:46:21 +0300 Subject: [PATCH 64/69] minor bug fixes to 8080, z80, pdp11 backends --- src/cowbe/arch8080.cow.ng | 2 +- src/cowbe/archpdp11.cow.ng | 20 ++++++++++---------- src/cowbe/archz80.cow.ng | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cowbe/arch8080.cow.ng b/src/cowbe/arch8080.cow.ng index 034665e7..12b63afa 100644 --- a/src/cowbe/arch8080.cow.ng +++ b/src/cowbe/arch8080.cow.ng @@ -1487,7 +1487,7 @@ gen stk4 := CAST24(hl|de:rhs, sext==0) uses bc { E_lxi(REG_BC, 0); ArchEmitMove(REG_BC, 0); - ArchEmitMove(REG_HL, 0); + ArchEmitMove($rhs, 0); } gen stk4 := CAST24(hl|de:rhs, sext!=0) uses a|bc diff --git a/src/cowbe/archpdp11.cow.ng b/src/cowbe/archpdp11.cow.ng index e800939b..8d2ebaed 100644 --- a/src/cowbe/archpdp11.cow.ng +++ b/src/cowbe/archpdp11.cow.ng @@ -927,21 +927,21 @@ # Note that this *destroys* the source register. sub ArchEmitMove(src: RegId, dest: RegId) is - if (src & REGCLASS_R32) == 0 then - if src == 0 then + if src == 0 then + if (dest & REGCLASS_R32) == 0 then E_pop(dest); - elseif dest == 0 then + else + E_pop4(dest); + end if; + elseif dest == 0 then + if (src & REGCLASS_R32) == 0 then E_push(src); else - E_move(src, dest); + E_push4(src); end if; else - if src == 0 then - E_pop(hireg(dest)); - E_pop(loreg(dest)); - elseif dest == 0 then - E_push(loreg(src)); - E_push(hireg(src)); + if (src & REGCLASS_R32) == 0 then + E_move(src, dest); else E_move(loreg(src), loreg(dest)); E_move(hireg(src), hireg(dest)); diff --git a/src/cowbe/archz80.cow.ng b/src/cowbe/archz80.cow.ng index 9060474a..28c22d3b 100644 --- a/src/cowbe/archz80.cow.ng +++ b/src/cowbe/archz80.cow.ng @@ -242,9 +242,9 @@ end sub; sub E_stax(ptr: RegId) is - E("\tld a, ("); + E("\tld ("); E_reg(ptr); - E(")\n"); + E("), a\n"); end sub; sub E_ldax(ptr: RegId) is From 4242df577edbcae51f6bf1a431283ad6fd706968 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Sat, 18 May 2024 18:15:57 +0300 Subject: [PATCH 65/69] pdp11: use word alignment and fix apout bug related to this --- src/cowfe/archpdp11.coh | 9 +++++---- third_party/apout/defines.h | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/cowfe/archpdp11.coh b/src/cowfe/archpdp11.coh index 829724b6..e2816094 100644 --- a/src/cowfe/archpdp11.coh +++ b/src/cowfe/archpdp11.coh @@ -7,7 +7,8 @@ var int8_type: [Type]; var intptr_type: [Type]; sub ArchAlignUp(value: Size, alignment: uint8): (newvalue: Size) is - newvalue := value; + var a := (alignment-1) as Size; + newvalue := (value+a) & ~a; end sub; sub ArchInitTypes() is @@ -40,14 +41,14 @@ end sub; sub ArchInitVariable(symbol: [Symbol]) is var subr := symbol.vardata.subr; - var offset := ArchAlignUp(subr.workspace[0], symbol.vardata.type.width as uint8); + var offset := ArchAlignUp(subr.workspace[0], symbol.vardata.type.alignment as uint8); symbol.vardata.offset := offset; subr.workspace[0] := offset + symbol.vardata.type.width; end sub; sub ArchInitMember(containing: [Type], member: [Symbol], position: Size) is - member.vardata.offset := ArchAlignUp(position, member.vardata.type.width as uint8); - position := position + member.vardata.type.width; + member.vardata.offset := ArchAlignUp(position, member.vardata.type.alignment as uint8); + position := member.vardata.offset + member.vardata.type.width; if position > containing.width then containing.width := position; end if; diff --git a/third_party/apout/defines.h b/third_party/apout/defines.h index 25951e13..2337bb48 100644 --- a/third_party/apout/defines.h +++ b/third_party/apout/defines.h @@ -345,20 +345,20 @@ extern u_int16_t *adptr; #ifndef EMUV1 /* lli_word() - Load a word from the given ispace logical address. */ #define lli_word(addr, word) \ - { adptr= (u_int16_t *)&(ispace[addr]); word= *adptr; } + { adptr= (u_int16_t *)&(ispace[addr & ~1]); word= *adptr; } /* ll_word() - Load a word from the given logical address. */ #define ll_word(addr, word) \ - { adptr= (u_int16_t *)&(dspace[addr]); word= *adptr; } + { adptr= (u_int16_t *)&(dspace[addr & ~1]); word= *adptr; } /* sl_word() - Store a word at the given logical address. */ #ifdef WRITEBASE #define sl_word(addr, word) \ { if ((u_int16_t)addr < dwrite_base) seg_fault(); \ - adptr= (u_int16_t *)&(dspace[addr]); *adptr= word; } + adptr= (u_int16_t *)&(dspace[addr & ~1]); *adptr= word; } #else #define sl_word(addr, word) \ - { adptr= (u_int16_t *)&(dspace[addr]); *adptr= word; } + { adptr= (u_int16_t *)&(dspace[addr & ~1]); *adptr= word; } #endif /* lli_byte() - Load a byte from the given logical ispace address. */ @@ -388,15 +388,15 @@ extern u_int16_t *adptr; /* lli_word() - Load a word from the given ispace logical address. */ #define lli_word(addr, word) \ { if ((Binary=KE11LO) && (addr<=KE11HI)) { \ - word= kell_word(addr); \ - } else { adptr= (u_int16_t *)&(ispace[addr]); word= *adptr; } \ + word= kell_word(addr & ~1); \ + } else { adptr= (u_int16_t *)&(ispace[addr & ~1]); word= *adptr; } \ } /* ll_word() - Load a word from the given logical address. */ #define ll_word(addr, word) \ { if ((Binary=KE11LO) && (addr<=KE11HI)) { \ - word= kell_word(addr); \ - } else { adptr= (u_int16_t *)&(dspace[addr]); word= *adptr; } \ + word= kell_word(addr & ~1); \ + } else { adptr= (u_int16_t *)&(dspace[addr & ~1]); word= *adptr; } \ } /* sl_word() - Store a word at the given logical address. */ @@ -404,14 +404,14 @@ extern u_int16_t *adptr; #define sl_word(addr, word) \ { if ((u_int16_t)addr < dwrite_base) seg_fault(); \ if ((Binary=KE11LO) && (addr<=KE11HI)) { \ - kesl_word(addr, word); \ - } else { adptr= (u_int16_t *)&(dspace[addr]); *adptr= word; } \ + kesl_word(addr & ~1, word); \ + } else { adptr= (u_int16_t *)&(dspace[addr & ~1]); *adptr= word; } \ } #else #define sl_word(addr, word) \ { if ((Binary=KE11LO) && (addr<=KE11HI)) { \ - kesl_word(addr, word); \ - } else { adptr= (u_int16_t *)&(dspace[addr]); *adptr= word; } \ + kesl_word(addr & ~1, word); \ + } else { adptr= (u_int16_t *)&(dspace[addr & ~1]); *adptr= word; } \ } #endif From fa7a11042ebf2393d877768bf4cc70500dabec95 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Sat, 18 May 2024 18:46:29 +0300 Subject: [PATCH 66/69] more pdp11 bug fixes --- src/cowbe/archpdp11.cow.ng | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cowbe/archpdp11.cow.ng b/src/cowbe/archpdp11.cow.ng index 8d2ebaed..2901d6da 100644 --- a/src/cowbe/archpdp11.cow.ng +++ b/src/cowbe/archpdp11.cow.ng @@ -1370,9 +1370,13 @@ gen r32 := EOR4($$, r32:rhs) E_xor(hireg($rhs), hireg($$)); } -// always use odd registers for 8- and 16-bit multiply and division -gen r1b|r3b|r5b := MUL1(r0b|r2b|r4b:rhs, $$) { E_mul($rhs, $$); } -gen r1|r3|r5 := MUL2(r0|r2|r4:rhs, $$) { E_mul($rhs, $$); } +// always use odd registers for 8- and 16-bit multiply and division; NB: do not use register lists +gen r1b := MUL1(r0b:rhs, $$) { E_mul($rhs, $$); } +gen r3b := MUL1(r2b:rhs, $$) { E_mul($rhs, $$); } +gen r5b := MUL1(r4b:rhs, $$) { E_mul($rhs, $$); } +gen r1 := MUL2(r0:rhs, $$) { E_mul($rhs, $$); } +gen r3 := MUL2(r2:rhs, $$) { E_mul($rhs, $$); } +gen r5 := MUL2(r4:rhs, $$) { E_mul($rhs, $$); } gen r4r5 := MUL4(r2r3:lhs, r0r1:rhs) { E_mul4($$, $lhs, $rhs); } gen r0b := DIVU1(r1b, r8n01:rhs) { E_uxtb($rhs); E_uxtb(REG_R1); E_clr(REG_R0); E_div($rhs, REG_R0); } From 74eee5a0e698493f6046874f9b1d6714ef397781 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Sun, 19 May 2024 17:25:01 +0300 Subject: [PATCH 67/69] partial register cache invalidation --- src/cowbe/arch6303.cow.ng | 1 + src/cowbe/arch6502.cow.ng | 1 + src/cowbe/arch80386.cow.ng | 1 + src/cowbe/archpdp11.cow.ng | 1 + src/cowbe/archz80.cow.ng | 2 ++ src/cowbe/codegen.coh | 4 ++++ 6 files changed, 10 insertions(+) diff --git a/src/cowbe/arch6303.cow.ng b/src/cowbe/arch6303.cow.ng index 7b4c917f..fea443b4 100644 --- a/src/cowbe/arch6303.cow.ng +++ b/src/cowbe/arch6303.cow.ng @@ -328,6 +328,7 @@ when REG_IMM: RegCacheLeavesConstant(srcreg, operand.imm.value as uint16); when REG_MEM: + RegCacheFlushValue(operand.mem.sym, operand.mem.off); RegCacheLeavesValue(srcreg, operand.mem.sym, operand.mem.off); end case; end sub; diff --git a/src/cowbe/arch6502.cow.ng b/src/cowbe/arch6502.cow.ng index ededefa1..fab199bb 100644 --- a/src/cowbe/arch6502.cow.ng +++ b/src/cowbe/arch6502.cow.ng @@ -1418,6 +1418,7 @@ gen STORE1(a:lhs, DEREF1(ptrs)) uses y gen STORE1(a|x|y:lhs, DEREF1(ADDRESS():a)) { + RegCacheFlushValue(&$a.sym, $a.off); E_st($lhs); E_symref(&$a.sym, $a.off); E_nl(); diff --git a/src/cowbe/arch80386.cow.ng b/src/cowbe/arch80386.cow.ng index a05e9eae..9a982357 100644 --- a/src/cowbe/arch80386.cow.ng +++ b/src/cowbe/arch80386.cow.ng @@ -217,6 +217,7 @@ end sub; sub E_store(reg: RegId, sym: [Symbol], off: Size, index: RegId) is + RegCacheFlushValue(sym, off); E_mov(reg); E_reg(reg); E(", ("); diff --git a/src/cowbe/archpdp11.cow.ng b/src/cowbe/archpdp11.cow.ng index e800939b..8def9284 100644 --- a/src/cowbe/archpdp11.cow.ng +++ b/src/cowbe/archpdp11.cow.ng @@ -221,6 +221,7 @@ end sub; sub E_store(reg: RegId, sym: [Symbol], off: Size, byte: uint8) is + RegCacheFlushValue(sym, off); E_mov(reg); E_reg(reg); E(", "); diff --git a/src/cowbe/archz80.cow.ng b/src/cowbe/archz80.cow.ng index 9060474a..09d03b1b 100644 --- a/src/cowbe/archz80.cow.ng +++ b/src/cowbe/archz80.cow.ng @@ -341,6 +341,7 @@ end sub; sub E_store16(src: RegId, sym: [Symbol], off: Size) is + RegCacheFlushValue(sym, off); E("\tld ("); E_symref(sym, off); E("), "); @@ -1199,6 +1200,7 @@ gen STORE4(r32:val, DEREF4(ADD2(ix|iy:ptr, CONSTANT(value is indexable_32bit):c) gen STORE4(r32:val, DEREF4(ADDRESS():a)) { + RegCacheFlushValue(&$a.sym, $a.off); E_store16(wordreg($val), &$a.sym, $a.off); E_exx(); E_store16(wordreg($val), &$a.sym, $a.off+2); diff --git a/src/cowbe/codegen.coh b/src/cowbe/codegen.coh index 01568a2b..894633b5 100644 --- a/src/cowbe/codegen.coh +++ b/src/cowbe/codegen.coh @@ -129,6 +129,10 @@ sub FindLast(inreg: RegId): (outreg: RegId) is end loop; end sub; +sub RegCacheFlushValue(sym: [Symbol], off: Size) is + RegCacheFlush(FindConflictingRegisters(RegCacheFindValue(sym, off))); +end sub; + sub FindBitNumber(reg: RegId): (bit: uint8) is bit := 0; while reg != 0 loop From 9a08ad4e9b39b609445f15dfd5e55a8350153ce8 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Sun, 19 May 2024 17:43:21 +0300 Subject: [PATCH 68/69] pdp11 bug fix: target register may conflict with source in DEREF4 --- src/cowbe/archpdp11.cow.ng | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/cowbe/archpdp11.cow.ng b/src/cowbe/archpdp11.cow.ng index 2901d6da..a268714d 100644 --- a/src/cowbe/archpdp11.cow.ng +++ b/src/cowbe/archpdp11.cow.ng @@ -1220,7 +1220,14 @@ gen r32 := CAST24(r16:val):c { E_move($val, loreg($$)); if ($c.sext != 0) then gen r8 := DEREF1(r16:rhs) { E_loadix($$, $rhs, 0, 1); } gen r16 := DEREF2(r16:rhs) { E_loadix($$, $rhs, 0, 0); } -gen r32 := DEREF4(r16:rhs) { E_loadix(loreg($$), $rhs, 0, 0); E_loadix(hireg($$), $rhs, 2, 0); } +gen r32 := DEREF4(r16:rhs) +{ + if $rhs == loreg($$) then + E_loadix(hireg($$), $rhs, 2, 0); E_loadix(loreg($$), $rhs, 0, 0); + else + E_loadix(loreg($$), $rhs, 0, 0); E_loadix(hireg($$), $rhs, 2, 0); + end if; +} gen r8 := DEREF1(ADD1(r16:rhs, CONSTANT():c)) { E_loadix($$, $rhs, $c.value, 1); } gen r16 := DEREF2(ADD2(r16:rhs, CONSTANT():c)) { E_loadix($$, $rhs, $c.value, 0); } @@ -1238,8 +1245,13 @@ gen r32 := DEREF4(ADDRESS():a) } gen r32 := DEREF4(ADD2(r16:rhs, CONSTANT():c)) { - E_loadix(loreg($$), $rhs, $c.value, 0); - E_loadix(hireg($$), $rhs, $c.value + 2, 0); + if $rhs == loreg($$) then + E_loadix(hireg($$), $rhs, $c.value + 2, 0); + E_loadix(loreg($$), $rhs, $c.value, 0); + else + E_loadix(loreg($$), $rhs, $c.value, 0); + E_loadix(hireg($$), $rhs, $c.value + 2, 0); + end if; } gen r32 := DEREF4(ADD2(ADDRESS():a), CONSTANT():c) { From 9e59661dd49fb04ef68587d4ef0ef16a0b9cd929 Mon Sep 17 00:00:00 2001 From: David Given Date: Wed, 22 May 2024 16:45:38 +0200 Subject: [PATCH 69/69] Enable CI builds on pull requests. --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 9ef2be00..acd90d71 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -1,6 +1,6 @@ name: C/C++ CI -on: [push] +on: [push, pull_request] jobs: build-linux: