예제 #1
0
        symbols[i] = result

    return symbols


symbols = get_symbols(rom)
symbolrepr = symbols[:]

consts = [*range(1, 16)] + [rom[0x160E + i] for i in range(25)]
for i, x in enumerate(consts):
    symbolrepr[x] = 'cs' + str(i + 1)
convs = [*range(0xD7, 0xFF)]
for i, x in enumerate(convs):
    symbolrepr[x] = 'cv' + str(i + 1)

set_symbolrepr(symbolrepr)

if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('-t',
                        '--target',
                        default='overflow',
                        choices=('none', 'overflow', 'loader'),
                        help='how will the output be used')
    parser.add_argument('-f',
                        '--format',
                        default='key',
                        choices=('hex', 'key'),
                        help='output format')
예제 #2
0
		ptr_adr = 0x148E + 2*i  # referenced at code address 02BBE
		ptr = rom[ptr_adr+1] << 8 | rom[ptr_adr]

		info = rom[0x168E + i]
		symbol_len = info & 0xF
		symbol_type = info >> 4 # if 15 then func else normal

		if symbol_type != 15: ptr += symbol_type

		result = to_font(rom[ptr:ptr+symbol_len])
		if symbol_type == 15: result = result + '('
		symbols[i] = result

	return symbols
symbols = get_symbols(rom)
set_symbolrepr(symbols)

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-t', '--target', default='overflow',
		choices=('none', 'overflow', 'loader'),
		help='how will the output be used')
parser.add_argument('-f', '--format', default='key',
		choices=('hex', 'key'),
		help='output format')
args = parser.parse_args()

program = sys.stdin.read().split('\n')

process_program(args, program, overflow_initial_sp=0x8DAE)
예제 #3
0
    return result


# TODO iterator workaround until get_char_table is implemented for this calculator
os.chdir("../580vnx/")
sys.path.append(".")
from get_char_table import f as get_symbol
assert sys.path[-1] == "."
sys.path.pop()
os.chdir("../991cnx_emu/")
symbols = [
    ''.join(map(FONT.__getitem__,get_symbol(x)[1]))
   for x in range(0xf0)] + \
 ['@']*0x10 # TODO wrong

set_symbolrepr(symbols[:])

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('-t',
                    '--target',
                    default='none',
                    choices=('none', ),
                    help='how will the output be used')
parser.add_argument('-f',
                    '--format',
                    default='key',
                    choices=('hex', 'key'),
                    help='output format')
parser.add_argument('-g',