emualtor working
This commit is contained in:
@@ -121,6 +121,41 @@ class PseudocodeTest(unittest.TestCase):
|
||||
self.assertIn("loc_0110:", text)
|
||||
self.assertIn("return;", text)
|
||||
|
||||
def test_zero_extends_byte_immediate_to_word_destination(self):
|
||||
payload = {
|
||||
"vectors": [{"address": 0, "name": "reset", "target": 0x4067, "target_label": "loc_4067"}],
|
||||
"call_graph": {
|
||||
"nodes": [
|
||||
{
|
||||
"start": 0x4067,
|
||||
"end": 0x4067,
|
||||
"label": "loc_4067",
|
||||
"sources": ["reset"],
|
||||
"instruction_count": 1,
|
||||
"calls": [],
|
||||
},
|
||||
],
|
||||
"edges": [],
|
||||
},
|
||||
"instructions": [
|
||||
{
|
||||
"address": 0x4067,
|
||||
"text": "MOV:G.W #H'00, @(-H'0790,R2)",
|
||||
"mnemonic": "MOV:G.W",
|
||||
"operands": "#H'00, @(-H'0790,R2)",
|
||||
"kind": "normal",
|
||||
"targets": [],
|
||||
"references": [],
|
||||
"comment": "",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
text = generate_pseudocode(payload, options=PseudocodeOptions(structured=False))
|
||||
|
||||
self.assertIn("zero_extend8_to16(0x00)", text)
|
||||
self.assertIn("byte immediate zero-extended into word destination", text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user