def decodificacio(INSTRUCCIO): if (INSTRUCCIO & ZERO_OPERAND) == 0: print "Instruccio sense operand" elif ((INSTRUCCIO & ONE_OPERAND) == 050000) or ((INSTRUCCIO & ONE_OPERAND) == 060000): print "Instruccio amb un operand" elif (INSTRUCCIO & ONE_OPERAND) == 070000: ins = INSTRUCCIO & 07000 if ins == 0: print "Instruccio DIV" elif ins == 01000: print "Instruccio MUL" elif ins == 02000: print "Instruccio ASH" elif ins == 03000: print "Instruccio ASHC" elif ins == 04000: print "Instruccio XOR" elif ins == 07000: print "Instruccio SOB" else: print "Not known instruction"