diff --git a/infernal b/infernal new file mode 120000 index 0000000..798d0f3 --- /dev/null +++ b/infernal @@ -0,0 +1 @@ +./main.py \ No newline at end of file diff --git a/infernal.py b/main.py old mode 100644 new mode 100755 similarity index 87% rename from infernal.py rename to main.py index 9fd8599..6668d3d --- a/infernal.py +++ b/main.py @@ -1,3 +1,4 @@ +#!/usr/bin/python2 import sys @@ -13,16 +14,21 @@ def parse_args (): parser.add_argument('-i', '--input-file', default='-', help = '.S file to use as input', dest = 'input-file') parser.add_argument('-o', '--output-file', default='-', help = '.S file to use as output', dest = 'output-file') for register in REGISTERS: - parser.add_argument('--'+register[1:], nargs = 1, type = int, default = [Junk.Junk()], dest = register) + parser.add_argument('--'+register[1:], nargs = 1, type = int, default = None, dest = register, help = 'the initial value of the register') args = vars(parser.parse_args()) # Determine args # registers_init = {} for register in REGISTERS: - registers_init[register[1:]] = args[register][0] + registers_init[register[1:]] = Junk.Junk('prev '+register) + # registers_init['rip'] = 0 registers_init['rsp'] = 0 registers_init['rbp'] = Junk.Junk('old bp') + # + for register in REGISTERS: + if args[register]: + registers_init[register[1:]] = args[register][0] # program = ""