def get_binary_code(self,operator): code = self.operations[operator] c = Convert() dec_code = c.to_decimal(code+"H") binary = c.decimal_to_binary(int(dec_code),8) binary = binary[0:-2] del c return binary
def get_address_tarjet(self, value): c = Convert() addressing = value[0] + "H" addressing = int(c.to_decimal(addressing)) val = value bina = c.decimal_to_binary(addressing, 4) bina = c.mask_and(bina, "1000") if bina == "1000": val = self.hex.subs(value, "8000H") x = self.get_x_value() val = self.hex.plus(val, x) val = self.reg.filter_number(val) return val
def operations_code(self,operator,m,is_index): r = Register("T") c = Convert() op = self.operations[operator] op = op+"H" op = c.to_decimal(op) op = int(op) binary = c.decimal_to_binary(op,24) binary = c.shift_binary_left(binary,16) if is_index: binary = c.mask_or(binary,"000000001000000000000000") m = c.to_decimal(m) m = int(m) m = c.decimal_to_binary(m,24) binary = c.mask_or(binary,m) val = int(binary,2) val = c.decimal_to_hexadecimal(val) val = r.filter_number(val) val = r.adjust_bytes(val,6,False) del r del c return val