summaryrefslogtreecommitdiff
path: root/python/examples/nes.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-05-08 23:46:20 -0400
committerRusty Wagner <rusty@vector35.com>2016-05-08 23:48:17 -0400
commit3ab807811a7efdcfeff4be101822be9d383c15e1 (patch)
tree52115a5182525d8ad557af54b6135800f9b9a9a5 /python/examples/nes.py
parentecaf78b419d323f6b589aac4b9ff5ff24b314bc6 (diff)
Add additional IL stage for flags resolution
Diffstat (limited to 'python/examples/nes.py')
-rw-r--r--python/examples/nes.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/python/examples/nes.py b/python/examples/nes.py
index 8d3d9269..21b02dfa 100644
--- a/python/examples/nes.py
+++ b/python/examples/nes.py
@@ -291,9 +291,9 @@ InstructionIL = {
"bcs": lambda il, operand: cond_branch(il, il.flag_condition(LLFC_ULT), operand),
"beq": lambda il, operand: cond_branch(il, il.flag_condition(LLFC_E), operand),
"bit": lambda il, operand: il.and_expr(1, il.reg(1, "a"), operand, flags = "czs"),
- "bmi": lambda il, operand: cond_branch(il, il.flag("s"), operand),
+ "bmi": lambda il, operand: cond_branch(il, il.flag_condition(LLFC_NEG), operand),
"bne": lambda il, operand: cond_branch(il, il.flag_condition(LLFC_NE), operand),
- "bpl": lambda il, operand: cond_branch(il, il.not_expr(0, il.flag("s")), operand),
+ "bpl": lambda il, operand: cond_branch(il, il.flag_condition(LLFC_POS), operand),
"brk": lambda il, operand: il.system_call(),
"bvc": lambda il, operand: cond_branch(il, il.not_expr(0, il.flag("v")), operand),
"bvs": lambda il, operand: cond_branch(il, il.flag("v"), operand),
@@ -368,7 +368,9 @@ class M6502(Architecture):
LLFC_UGE: ["c"],
LLFC_ULT: ["c"],
LLFC_E: ["z"],
- LLFC_NE: ["z"]
+ LLFC_NE: ["z"],
+ LLFC_NEG: ["s"],
+ LLFC_POS: ["s"]
}
flags_written_by_flag_write_type = {
"*": ["c", "z", "v", "s"],