I have error message about usage of unassigned variable when I use store_and operation. I was wondering why this operation didn't work if the first variable (destionation) 's not assigned before, for store_add did work with same condition. I found what's difference between store_add and store_and declaration in header_operations.py. store_add 's marked as member of lhs_operations, and store_and is not. I tried a test here :
compiled to be :
It's ok, there're 3 local variables defined there.
Same goes to store_or operation.
on module_scripts.py :
compiled to be :
It's ok, there're 3 local variables defined there.
插入代码块:
("test_op",
[(assign, ":a", 0x10),
(assign, ":b", 0x11),
(store_add, ":c", ":a", ":b"),
(assign, reg0, ":c"),
]),
插入代码块:
test_op -1
4 2133 2 1224979098644774912 16 2133 2 1224979098644774913 17 2120 3 1224979098644774914 1224979098644774912 1224979098644774913 2133 2 72057594037927936 1224979098644774914
on module_scripts.py :
compiled to be :
Error, MS didn't define 3rd local variable.
插入代码块:
("test_op",
[(assign, ":a", 0x10),
(assign, ":b", 0x11),
(store_and, ":c", ":a", ":b"),
(assign, reg0, ":c"),
]),
插入代码块:
test_op -1
4 2133 2 1224979098644774912 16 2133 2 1224979098644774913 17 2117 3 -1 1224979098644774912 1224979098644774913 2133 2 72057594037927936 -1
on module_scripts.py :
compiled to be :
It's ok, there're 3 local variables defined there, but (assign, ":c", 0x00), 's useless.
插入代码块:
("test_op",
[(assign, ":a", 0x10),
(assign, ":b", 0x11),
(assign, ":c", 0x00),
(store_and, ":c", ":a", ":b"),
(assign, reg0, ":c"),
]),
插入代码块:
test_op -1
5 2133 2 1224979098644774912 16 2133 2 1224979098644774913 17 2133 2 1224979098644774914 0 2117 3 1224979098644774914 1224979098644774912 1224979098644774913 2133 2 72057594037927936 1224979098644774914
插入代码块:
lhs_operations = [try_for_range,
..... <CUT for SPACE>
store_mod,
store_add,
store_and, ### TRIAL to insert this
store_sub,
插入代码块:
test_op -1
4 2133 2 1224979098644774912 16 2133 2 1224979098644774913 17 2117 3 1224979098644774914 1224979098644774912 1224979098644774913 2133 2 72057594037927936 1224979098644774914


