diff options
Diffstat (limited to 'VexRiscv/src/test/python/tool/hexToAsm.py')
-rwxr-xr-x | VexRiscv/src/test/python/tool/hexToAsm.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/VexRiscv/src/test/python/tool/hexToAsm.py b/VexRiscv/src/test/python/tool/hexToAsm.py new file mode 100755 index 0000000..676c202 --- /dev/null +++ b/VexRiscv/src/test/python/tool/hexToAsm.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python3 + +from os import system +from sys import argv + +with open("disasm.s", "w") as f: + instr = int(argv[1], 16) + print(".word 0x%04x" % (instr), file=f) + +system("riscv64-unknown-elf-gcc -c disasm.s") +system("riscv64-unknown-elf-objdump -d -M numeric,no-aliases disasm.o") |