aboutsummaryrefslogtreecommitdiff
path: root/VexRiscv/src/test/python/tool/hexToAsm.py
blob: 676c202c3c3ca77fe906a5f633ef98ff191e69bf (plain)
1
2
3
4
5
6
7
8
9
10
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")