Ejemplo n.º 1
0
def setup(pg=4):
	if pg < 4:
		m = mem.byte_mem(0x4000, 0x8000)
		fi = open(fwd + "/08904-87008.hex")
		for i in fi:
			j = i.split()
			if int(j[0],10) == pg:
				m.wr(int(j[1],16), int(j[2],16))
		fi.close()
	else:
		m = mem.byte_mem(0x8000, 0x10000)
		m.load_binfile(0x8000, 1, fwd + "08904-87007.bin")

	pj = job.Job(m, "HP8904A_pg%d" % pg)
	pj.pg = pg
	return pj,m
Ejemplo n.º 2
0
def mem_setup():
    m = mem.byte_mem(0x6800, 0x8000)
    dn = os.path.dirname(__file__)
    m.load_binfile(0x6800, 1, os.path.join(dn, "A13U2.bin"))
    m.load_binfile(0x7000, 1, os.path.join(dn, "A13U3.bin"))
    m.load_binfile(0x7800, 1, os.path.join(dn, "A13U4.bin"))
    return m
Ejemplo n.º 3
0
def mem_setup():
    m = mem.byte_mem(0x0000, 0x2000)
    fn = os.path.join(os.path.dirname(__file__), "HP6034A_U25.hex")
    for i in open(fn):
        j = i.split()
        m.wr(int(j[0], 16), int(j[1], 16))
    return m
Ejemplo n.º 4
0
def setup():

	m = mem.byte_mem(0x0, 0x900)
	def hexfile(bn, a0):
		fn = os.path.join(os.path.dirname(__file__), bn)
		fi = open(fn)
		for i in fi:
			j = i.split()
			if len(j) == 0:
				continue
			if j[0][0] == "#":
				continue
			a = int(j[0], 16)
			b = int(j[1], 16)
			m.wr(a0 + a, b)
		fi.close()

	hexfile("P8316.hex", 0)
	hexfile("P1702.hex", 0x800)

	pj = job.Job(m, "Micrologic_ML200")

	cpu = mcs4.mcs4()

	return pj, cpu
Ejemplo n.º 5
0
def setup():

	#######################################################################
	# Slightly confusing mapping of memory for this one.  Probably an
	# artifact of a chance from smaller to bigger ROMS along the way.

	m = mem.byte_mem(0x0000, 0x4000)

	fn = os.path.join(os.path.dirname(__file__), "A6U1.bin")
	fi = open(fn, "rb")
	d = bytearray(fi.read())
	fi.close()
	m.load_data(0x0000, 1, d[:0x1000])
	m.load_data(0x2000, 1, d[0x1000:])

	fn = os.path.join(os.path.dirname(__file__), "A6U2.bin")
	fi = open(fn, "rb")
	d = bytearray(fi.read())
	fi.close()
	m.load_data(0x1000, 1, d[:0x1000])
	m.load_data(0x3000, 1, d[0x1000:])

	#######################################################################

	pj = job.Job(m, "HP3325A")

	#######################################################################

	dx = hp_nanoproc.hp_nanoproc_pg()
	return pj, dx
Ejemplo n.º 6
0
def mem_setup():
    m = mem.byte_mem(0x0000, 0x7800)
    dn = os.path.dirname(__file__)
    m.load_binfile(0x0000, 1, os.path.join(dn, "EPROM_ROA_375.bin"))

    for a in range(0x797):
        m.wr(0x7000 + a, m.rd(0x0069 + a))
    return m
Ejemplo n.º 7
0
def setup(pg):
	if pg < 4:
		m = mem.byte_mem(0x4000, 0x8000)
		fi = open(fwd + "/08904-87008.hex")
		for i in fi:
			j = i.split()
			if int(j[0],10) == pg:
				m.wr(int(j[1],16), int(j[2],16))
		fi.close()
	else:
		m = mem.byte_mem(0x8000, 0x10000)
		m.load_binfile(0x8000, 1, fwd + "08904-87007.bin")

	pj = job.Job(m, "HP8904A_pg%d" % pg)
	pj.pg = pg
	pj.banks.append([0x4000,0x100000])
	return pj,m
Ejemplo n.º 8
0
def setup():
	m = mem.byte_mem(0x0000, 0x1000)
	fn = os.path.join(os.path.dirname(__file__),
	    "618TCA_CDU_U20_U12_PN_138_0192_V_2_2_C_U5.bin")
	m.load_binfile(0x0000, 1, fn)
	pj  = job.Job(m, "Apollo618c_cdu")
	cx = mcs51.i8032()
	return pj, cx
Ejemplo n.º 9
0
def mem_setup():
    m = mem.byte_mem(0x0000, 0x10000)
    dn = os.path.dirname(__file__)
    m.load_binfile(0x0000, 1, os.path.join(dn, "EPROM_ROB_357.bin"))

    for a in range(0x7ee):
        m.wr(0xa000 + a, m.rd(0x0012 + a))
    return m
Ejemplo n.º 10
0
def setup():

    m = mem.byte_mem(0x8000, 0x10000)
    fn = os.path.join(os.path.dirname(__file__), "PL99.mc68hc11.bin")
    m.load_binfile(0x8000, 1, fn)

    pj = job.Job(m, "PL99")
    cx = mc6800.mc68hc11()
    return pj, cx
Ejemplo n.º 11
0
def setup():
	m = mem.byte_mem(0xd000,0x10000)
	dn = os.path.dirname(__file__)
	m.load_binfile(0xf000, 1, os.path.join(dn, "Rev107f0.BIN"))
	m.load_binfile(0xe000, 1, os.path.join(dn, "Rev107f1.BIN"))
	m.load_binfile(0xd000, 1, os.path.join(dn, "Rev107f2.BIN"))

	pj = job.Job(m, "Austron2100F_107")
	cx = mc6800.mc6800()
	return pj, cx
Ejemplo n.º 12
0
def setup():
        m = mem.byte_mem(0x0000, 0x10000)
        dn = os.path.dirname(__file__)
        m.load_binfile(0x0000, 1, os.path.join(dn, "EPROM_ROB_357.bin"))

	for a in range(0x7ee):
		m.wr(0xa000 + a, m.rd(0x0012 + a))

        pj = job.Job(m, "RC702_bootrom_rob_357")
        cx = z80.z80()
        return pj, cx
Ejemplo n.º 13
0
def setup():

	m = mem.byte_mem(0x0000, 0x4000)
	fn = os.path.join(os.path.dirname(__file__), "hp3336.bin")
	m.load_binfile(0, 1, fn)

	pj = job.Job(m, "HP3336")

	dx = hp_nanoproc.hp_nanoproc_pg()

	return pj, dx
Ejemplo n.º 14
0
def setup():
        m = mem.byte_mem(0x0000, 0x7800)
        dn = os.path.dirname(__file__)
        m.load_binfile(0x0000, 1, os.path.join(dn, "EPROM_ROA_375.bin"))

	for a in range(0x797):
		m.wr(0x7000 + a, m.rd(0x0069 + a))

        pj = job.Job(m, "RC702_bootrom_roa_375")
        cx = z80.z80()
        return pj, cx
Ejemplo n.º 15
0
def mem_setup():
	m = mem.byte_mem(0x0, 0x20000)
	for b,n in (
		(0x00000, "85680-80116.BIN"),
		(0x00001, "85680-80115.BIN"),
		(0x10000, "85680-80114.BIN"),
		(0x10001, "85680-80113.BIN"),
	):
		m.load_binfile(first = b, step = 0x2,
		    filename=os.path.join(os.path.dirname(__file__), n))
	return m
Ejemplo n.º 16
0
def setup():

	m = mem.byte_mem(0xe0000, 0x100000)
        fn = os.path.join(os.path.dirname(__file__),
	    "618TCA_R_U2_C_U15_PN_138_0193_V4_4.bin")
	m.load_binfile(0xe0000, 1, fn)

	pj  = job.Job(m, "Apollo618c")

	cx = i8086.i8086()
	cx.has_8087()
	return pj,cx
Ejemplo n.º 17
0
def setup():

    m = mem.byte_mem(0x6800, 0x8000)

    dn = os.path.dirname(__file__)
    m.load_binfile(0x6800, 1, os.path.join(dn, "A13U2.bin"))
    m.load_binfile(0x7000, 1, os.path.join(dn, "A13U3.bin"))
    m.load_binfile(0x7800, 1, os.path.join(dn, "A13U4.bin"))

    pj = job.Job(m, "HP3335A")
    cpu = mc6800.mc6800(mask=0x7FFF)

    return pj, cpu
Ejemplo n.º 18
0
def setup():

	m = mem.byte_mem(0x0000, 0x2000)

	fn = os.path.join(os.path.dirname(__file__), "HP6034A_U25.hex")
	fi = open(fn)
	for i in fi:
		j = i.split()
		m.wr(int(j[0], 16), int(j[1], 16))

	pj = job.Job(m, "HP6034A")
	cx = tms9900.Tms9981()
	return pj, cx
Ejemplo n.º 19
0
def mem_setup():
    # Slightly confusing mapping of memory for this one.  Probably an
    # artifact of a chance from smaller to bigger ROMS along the way.
    m = mem.byte_mem(0x0000, 0x4000)
    fn = os.path.join(os.path.dirname(__file__), "A6U1.bin")
    d = bytearray(open(fn, "rb").read())
    m.load_data(0x0000, 1, d[:0x1000])
    m.load_data(0x2000, 1, d[0x1000:])
    fn = os.path.join(os.path.dirname(__file__), "A6U2.bin")
    d = bytearray(open(fn, "rb").read())
    m.load_data(0x1000, 1, d[:0x1000])
    m.load_data(0x3000, 1, d[0x1000:])
    return m
Ejemplo n.º 20
0
def setup(name, binfile, direction):
	print("\n\nDoing: " + binfile)
	m = mem.byte_mem(0x6000, 0x8000)
	fn = os.path.join(os.path.dirname(__file__), binfile)
	if direction == 1:
		m.load_binfile(0x6000, 1, fn)
	else:
		m.load_binfile(0x7fff, -1, fn)
	pj = job.Job(m, name)
	cx = mc6800.mc6800(mask = 0x7fff)
	eprom(pj, cx.disass, m.lo, m.hi, 0x0400)

	cx.vectors(pj, 0x7ff8)
	return pj,cx
Ejemplo n.º 21
0
def mem_setup():
	m = mem.byte_mem(0x0000, 0x10000)
	dn = os.path.dirname(__file__)
	m.load_binfile(0x0000, 1,
	    os.path.join(dn, "hp1347a_proto.low.rom"))
	m.load_binfile(0xe000, 1,
	    os.path.join(dn, "hp1347a_proto.high.rom"))

	s = 0
	for a in range(0x0000, 0x2000, 2):
		s += m.bu16(a)
	print("SUM 0x0000-0x1fff = 0x%x" % s)

	s = 0
	for a in range(0xe000, 0x10000, 2):
		s += m.bu16(a)
	print("SUM 0xe000-0xffff = 0x%x" % s)

	return m
Ejemplo n.º 22
0
def mem_setup():
	m = mem.byte_mem(0x0, 0x900)
	def hexfile(bn, a0):
		fn = os.path.join(os.path.dirname(__file__), bn)
		fi = open(fn)
		for i in fi:
			j = i.split()
			if len(j) == 0:
				continue
			if j[0][0] == "#":
				continue
			a = int(j[0], 16)
			b = int(j[1], 16)
			m.wr(a0 + a, b)
		fi.close()

	hexfile("P8316.hex", 0)
	hexfile("P1702.hex", 0x800)
	return m
Ejemplo n.º 23
0
def do_one(fn, alist):

    print("--------------", fn)

    m = mem.byte_mem(0x000, 0x800)

    orig_src = dict()

    labels = dict()

    def load_xx(m):
        fi = open(fn)
        for i in fi:
            if i[0] != ' ':
                continue
            j = i.strip()
            if j == "":
                continue
            j = i.split('*', 1)[0].rstrip()
            if len(j) < 15:
                continue
            if j[8] != "-":
                continue
            if not j[14].isdigit():
                continue
            if j[14:18] == '    ':
                continue
            a = int(j[14:18], 8)
            d = int(j[20:23], 8)
            orig_src[a] = j
            m.wr(a, d)
            lb = j[25:30].strip()
            if lb != "":
                labels[a] = lb
        fi.close()

    load_xx(m)

    pj = pyreveng.Job(m, "HP-9411")

    dx = hp_nanoproc.hp_nanoproc()

    if True:
        for i in alist:
            pj.todo(i, dx.disass)

    pj.apct = "%04o"
    pj.apct = "%03x"

    while pj.run():
        pass

    def fixit(i, a, b):
        if i == a.lo:
            # Check if there are instructions our disass don't know
            if a.mne != b[31:34]:
                print(a.im, b)
        a.lcmt += b + "\n"

    for i, j in orig_src.items():
        x = pj.t.find_range(i, i + 1)
        if len(x[1]) > 0:
            fixit(i, x[1][0], j)
        elif len(x[0]) > 0:
            fixit(i, x[0][0], j)
        else:
            x = pj.add(i, i + 1, "origsrc")
            x.lcmt += j + "\n"
            # print(x)

    for i in labels:
        pj.set_label(i, labels[i])

    if True:
        code.lcmt_flows(pj)
    listing.Listing(pj, fn="/tmp/_.HP" + fn, fmt="o", ncol=1)
Ejemplo n.º 24
0
def mem_setup():
    m = mem.byte_mem(0x8000, 0x10000)
    for i in open(fwd + "06626-80005-REV-A-00-04.hex"):
        j = i.split()
        m.wr(int(j[0], 16), int(j[1], 16))
    return m
Ejemplo n.º 25
0
def mem_setup():
    m = mem.byte_mem(0x0000, 0x1000)
    fn = os.path.join(os.path.dirname(__file__),
                      "618TCA_CDU_U20_U12_PN_138_0192_V_2_2_C_U5.bin")
    m.load_binfile(0x0000, 1, fn)
    return m
Ejemplo n.º 26
0
def mem_setup():

    m = mem.byte_mem(0x8000, 0x10000)
    fn = os.path.join(os.path.dirname(__file__), "PL99.mc68hc11.bin")
    m.load_binfile(0x8000, 1, fn)
    return m
Ejemplo n.º 27
0
def do_one(fn, alist):

    print("--------------", fn)

    m = mem.byte_mem(0x000, 0x800)

    orig_src = dict()

    labels = dict()

    def load_xx(m):
        fi = open(fn)
        for i in fi:
            if i[0] != " ":
                continue
            j = i.strip()
            if j == "":
                continue
            j = i.split("*", 1)[0].rstrip()
            if len(j) < 15:
                continue
            if j[8] != "-":
                continue
            if not j[14].isdigit():
                continue
            if j[14:18] == "    ":
                continue
            a = int(j[14:18], 8)
            d = int(j[20:23], 8)
            orig_src[a] = j
            m.wr(a, d)
            lb = j[25:30].strip()
            if lb != "":
                labels[a] = lb
        fi.close()

    load_xx(m)

    pj = pyreveng.Job(m, "HP-9411")

    dx = hp_nanoproc.hp_nanoproc()

    if True:
        for i in alist:
            pj.todo(i, dx.disass)

    pj.apct = "%04o"
    pj.apct = "%03x"

    while pj.run():
        pass

    def fixit(i, a, b):
        if i == a.lo:
            # Check if there are instructions our disass don't know
            if a.mne != b[31:34]:
                print(a.im, b)
        a.lcmt += b + "\n"

    for i, j in orig_src.items():
        x = pj.t.find_range(i, i + 1)
        if len(x[1]) > 0:
            fixit(i, x[1][0], j)
        elif len(x[0]) > 0:
            fixit(i, x[0][0], j)
        else:
            x = pj.add(i, i + 1, "origsrc")
            x.lcmt += j + "\n"
            # print(x)

    for i in labels:
        pj.set_label(i, labels[i])

    if True:
        code.lcmt_flows(pj)
    listing.Listing(pj, fn="/tmp/_.HP" + fn, fmt="o", ncol=1)
Ejemplo n.º 28
0
def mem_setup():
    m = mem.byte_mem(0x0000, 0x4000)
    fn = os.path.join(os.path.dirname(__file__), "hp3336.bin")
    m.load_binfile(0, 1, fn)
    return m
Ejemplo n.º 29
0
def mem_setup():
	m = mem.byte_mem(0x0000, 0x0200)
	fn = os.path.join(os.path.dirname(__file__), "1818-2270B.bin")
	m.load_binfile(0, 1, fn)
	return m
Ejemplo n.º 30
0
def mem_setup():
    m = mem.byte_mem(0xe0000, 0x100000)
    fn = os.path.join(os.path.dirname(__file__),
                      "618TCA_R_U2_C_U15_PN_138_0193_V4_4.bin")
    m.load_binfile(0xe0000, 1, fn)
    return m
Ejemplo n.º 31
0
def mem_setup():
    m = mem.byte_mem(0x0, 0x400)
    m.load_binfile(0x0, 1, os.path.join(os.path.dirname(__file__), fw))
    return m