def p4(self): print("pass 4: Rom validity check") for item in self.datainstlist: #print(item) inst=int(item[0]) data=int(item[1]) if inst<libbaltcalc.mni(9) or inst>libbaltcalc.mpi(9): print("Out of range instruction word found!") print("source line: " + str(item[2])) return 1 if data<libbaltcalc.mni(9) or data>libbaltcalc.mpi(9): print("Out of range data word found!") print("source line: " + str(item[2])) return 1 if len(self.datainstlist)>19683: print("Memory Space Overflow!") return 1 return 0
elif (usercalllst[0]).lower() == "mpi": try: arg = usercalllst[1] #calculate the MPI of the user-specifed number of trits print libbaltcalc.mpi(int(arg)) except IndexError: print "please specify one decimal integer" except TypeError: print "Please specify one decimal integer." except ValueError: print "Please specify one decimal integer." elif (usercalllst[0]).lower() == "mni": try: arg = usercalllst[1] #calculate the MPI of the user-specifed number of trits print libbaltcalc.mni(int(arg)) except IndexError: print "please specify one decimal integer" except TypeError: print "Please specify one decimal integer." except ValueError: print "Please specify one decimal integer." elif (usercalllst[0]).lower() == "mcv": try: arg = usercalllst[1] print libbaltcalc.mcv(int(arg)) except IndexError: print "please specify one decimal integer" except TypeError: print "Please specify one decimal integer." except ValueError:
STAT="copy RESULT to B" scupdate=1 if copybax.collidepoint(event.pos)==1 and event.button==1: DA=DB TA=libbaltcalc.DECTOBT(DA) STAT="COPY B TO A" scupdate=1 if invertbx.collidepoint(event.pos)==1 and event.button==1: DB=( - DB) TB=libbaltcalc.DECTOBT(DB) STAT="INVERT B" scupdate=1 #row 3 if mnix.collidepoint(event.pos)==1 and event.button==1: if abs(DA)<=mcalclimit: DR=libbaltcalc.mni(abs(DA)) TR=libbaltcalc.DECTOBT(DR) STAT="mni of A (DEC)" scupdate=1 docopy=1 else: STAT="mni of over 36 is too large" scupdate=1 if swapx.collidepoint(event.pos)==1 and event.button==1: TEMPD=DA DA=DB DB=TEMPD TA=libbaltcalc.DECTOBT(DA) TB=libbaltcalc.DECTOBT(DB) STAT="swap A & B" scupdate=1
def __init__(self, fileobj, addrstart=libbaltcalc.mni(9)): self.fileobj=fileobj self.addrstart=addrstart