When running a program which loads data, such as helloworld, I get a TypeError :
$ ./golf.py examples/helloworld.bin
Traceback (most recent call last):
File "./golf.py", line 230, in <module>
ret = golf.run()
File "./golf.py", line 204, in run
self.execute_instr(instr_name, instr_args)
File "./golf.py", line 151, in execute_instr
elif instr == "lbu": self.regs[args[0]] = self.load(args[1], 1)
File "./golf.py", line 89, in load
return struct.unpack_from("<" + fmts[width], bytes(r + [0] * width))[0]
TypeError: can't concat bytes to list
I have been able to fix it by changing line 89 to :
return struct.unpack_from("<" + fmts[width], bytes(list(r) * width))[0]
I use python 3.4.2
When running a program which loads data, such as helloworld, I get a TypeError :
I have been able to fix it by changing line 89 to :
I use python 3.4.2