1
0

emualtor working

This commit is contained in:
Aiden
2026-05-25 21:00:25 +10:00
parent 3ab79648ff
commit 752148c585
22 changed files with 588 additions and 22 deletions

View File

@@ -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()