示例#1
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
示例#2
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
示例#3
0
def setup(binfile, direction):
    fn = os.path.join(os.path.dirname(__file__), binfile)
    cx = mc6800.mc6800()
    m = mem.ByteMem(0x0000, 0x2000)
    if direction == 1:
        m.load_binfile(0, 1, fn)
    else:
        m.load_binfile(0x1fff, -1, fn)
    cx.m.map(m, 0x6000)
    cx.m.map(m, lo=0xfff8, hi=0x10000, offset=0x1ff8)
    eprom(cx, 0x6000, 0x8000, 0x0400)
    cx.vectors()
    return cx
示例#4
0
文件: utils.py 项目: liveck/PyReveng3
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
示例#5
0
def example():
    m = mem.Stackup(
        FILENAMES,
        nextto=__file__,
    )

    cx = mc6800.mc6800()
    cx.m.map(m, 0x6800)
    nmi = m.bu16(m.hi - 4)
    print("NMI %x" % nmi)
    cx.m.map(m, 0x8000 | nmi, 0x10000, offset=nmi - 0x6800)

    for a, l in SYMBOLS.items():
        cx.m.set_label(a, l)

    def rom(lo, hi):
        cx.m.add_range(lo, hi, txt="ROM")
        s = 0
        for a in range(lo, hi):
            s += cx.m[a]
        s &= 0xff
        if s == 0:
            print("ROM %04x-%04x sum good (%02x)" % (lo, hi, s))
        else:
            print("ROM %04x-%04x sum BAD (%02x)" % (lo, hi, s))

    rom(0x6800, 0x7000)
    rom(0x7000, 0x7800)
    rom(0x7800, 0x8000)

    for i in (0x6fff, 0x77ff, 0x7ff7):
        c = data.Data(cx.m, i, i + 1, "csum")
        c.rendered = c.tag

    cx.vectors()

    def jmptbl(lo, hi, x=None):
        c = cx.m.add_range(lo, hi, txt="jmptbl (%04x-%04x)" % (lo, hi))
        # c.rendered = c.tag
        n = 0
        for a in range(lo, hi, 2):
            y = cx.codeptr(a)
            if x != None and len(x) > n:
                cx.m.set_label(y.dst, "CMD_" + x[n])
            n += 1

    jmptbl(0x7768, 0x77b6, '9876543210.-@ABCDEFGHIJKLMNOPQRSTUVWXYZ')
    jmptbl(0x7860, 0x787c)
    jmptbl(0x78a0, 0x78bc)
    jmptbl(0x78c0, 0x78dc)

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

    def tblx(a):
        c = data.Data(cx.m, a, a + 16, "tblx")
        s = ""
        for i in range(10):
            v = cx.m[a + i]
            s += " %02x" % v
        s += "  "
        for i in range(10, 16):
            v = cx.m[a + i]
            s += " %02x" % v
        c.rendered = "TBLX " + s
        c.compact = True

    for a in range(0x7000, 0x70a0, 16):
        tblx(a)

    for a in range(0x7100, 0x71a0, 16):
        tblx(a)

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

    seven_segment.table(cx.m,
                        0x7800,
                        0x7810,
                        drive=(128, 64, 32, 16, 8, 4, 2, 1, 0),
                        inv=True,
                        verbose=False)

    return NAME, (cx.m, )
示例#6
0
def setup():
    pj = job.Job(mem_setup(), "HP3335A")
    cpu = mc6800.mc6800(mask=0x7fff)

    return pj, cpu