def parse_DEC(self, context, operands): if operands: op = Decimal(" ".join(operands)) if op.isValid(): context.currentRecord.code = [op.value] context.currentRecord.operandType = RecordType.CONST context.currentRecord.complete = True else: context.syntax("DEC operand must be a decimal number")
def parse_DEC(self, context, operands): if operands: op = Decimal(" ".join(operands)) if op.isValid(): context.currentRecord.code = [ op.value ] context.currentRecord.operandType = RecordType.CONST context.currentRecord.complete = True else: context.syntax("DEC operand must be a decimal number")
def parse_VN(self, context, operands): if operands: op = Decimal(operands[0]) if op.isValid(): lower = int(operands[0][-2:]) upper = int(operands[0][:-2]) context.currentRecord.code = [upper * 128 + lower] context.currentRecord.operandType = RecordType.CONST context.currentRecord.complete = True else: context.syntax("operand must be a decimal number")
def parse_VN(self, context, operands): if operands: op = Decimal(operands[0]) if op.isValid(): lower = int(operands[0][-2:]) upper = int(operands[0][:-2]) context.currentRecord.code = [ upper * 128 + lower ] context.currentRecord.operandType = RecordType.CONST context.currentRecord.complete = True else: context.syntax("operand must be a decimal number")