示例#1
0
    def optimizedWithContext(self, ctx):
        bank = self.bank.optimizedWithContext(ctx)
        addr = self.addr.optimizedWithContext(ctx)

        if hasattr(addr, 'value') and addr.value is not None and hasattr(bank, 'value') and bank.value is not None:
            return ProcAddress(address.fromVirtualAndBank(addr.value, bank.value))

        return ComputedProcAddress(bank, addr)
示例#2
0
def getLimit(proj, addr):
    if addr.inPhysicalMem():
        bank_limit = address.fromVirtualAndBank(0x4000, addr.bank() + 1)
    else:
        bank_limit = address.fromVirtual(0xFFFF)

    next_owned = proj.database.getNextOwnedAddress(addr)

    if not next_owned or bank_limit < next_owned:
        return bank_limit
    else:
        return next_owned
示例#3
0
def getLimit(proj, addr):
    if addr.inPhysicalMem():
        bank_limit = address.fromVirtualAndBank(0x4000, addr.bank()+1)
    else:
        bank_limit = address.fromVirtual(0xFFFF)

    next_owned = proj.database.getNextOwnedAddress(addr)

    if not next_owned or bank_limit < next_owned:
        return bank_limit
    else:
        return next_owned