mirror of
https://github.com/michaelcmartin/Ophis.git
synced 2024-12-13 05:29:14 +00:00
Fix 16-bit immediate mode.
This commit is contained in:
parent
dcc37f5751
commit
bcfd08c750
@ -324,7 +324,7 @@ class PCTracker(Pass):
|
||||
env.incPC(2)
|
||||
|
||||
def visitImmediateLong(self, node, env):
|
||||
env.incPC(2)
|
||||
env.incPC(3)
|
||||
|
||||
def visitIndirectX(self, node, env):
|
||||
env.incPC(2)
|
||||
@ -480,6 +480,15 @@ class Collapse(PCTracker):
|
||||
# the branch extension pass. Force them to Absolute equivalents
|
||||
# if this happens.
|
||||
|
||||
def visitImmediate(self, node, env):
|
||||
if node.data[1].value(env) >= 0x100:
|
||||
if Ops.opcodes[node.data[0]][Ops.modes.index("ImmediateLong")] is not None:
|
||||
node.nodetype = "ImmediateLong"
|
||||
PCTracker.visitImmediateLong(self, node, env)
|
||||
self.changed = True
|
||||
return
|
||||
PCTracker.visitImmediate(self, node, env)
|
||||
|
||||
def visitZeroPage(self, node, env):
|
||||
if node.data[1].value(env) >= 0x100:
|
||||
if Ops.opcodes[node.data[0]][Ops.modes.index("Absolute")] is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user