
class Instruction:
	"""Represents an URCL instruction."""
	def __init__(self, *operands):
		self.Operands = list(operands)
	
	@property
	def OperandA(self): return self.Operands[0]
	
	@property
	def OperandB(self): return self.Operands[0]

	@property
	def OperandB(self): return self.Operands[1]

	@property
	def OperandC(self): return self.Operands[2]

	def GetOperandCount(self):
		"""Get the number of operands in this instruction."""
		return len(self.Operands)
	
	def GetOperands(self):
		"""Get a list of the operands in this instruction."""
		return self.Operands
	
	def __str__(self):
		"""Convert the instruction to a string."""
		return f"{self.Operation} {str.join(' ', [str(operand) for operand in self.Operands])}"

class NOP(Instruction): Operation = "NOP"
class HLT(Instruction):
	Operation = "HLT"
	__doc__ = "stops stt"
class BRK(Instruction): Operation = "BRK"

class ADD(Instruction): Operation = "ADD"
class SUB(Instruction): Operation = "SUB"
class INC(Instruction): Operation = "INC"
class DEC(Instruction): Operation = "DEC"
class MLT(Instruction): Operation = "MLT"
class DIV(Instruction): Operation = "DIV"
class MOD(Instruction): Operation = "MOD"
class OR(Instruction):  Operation = "OR"
class AND(Instruction): Operation = "AND"
class XOR(Instruction): Operation = "XOR"
class NOT(Instruction): Operation = "NOT"
class LSH(Instruction): Operation = "LSH"
class RSH(Instruction): Operation = "RSH"
class BSL(Instruction): Operation = "RSL"
class BSR(Instruction): Operation = "BSR"

class MOV(Instruction): Operation = "MOV"
class IMM(Instruction): Operation = "IMM"
class LOD(Instruction): Operation = "LOD"
class STR(Instruction): Operation = "STR"
class CPY(Instruction): Operation = "CPY"

class PSH(Instruction): Operation = "PSH"
class POP(Instruction): Operation = "POP"
class CAL(Instruction): Operation = "CAL"
class RET(Instruction): Operation = "RET"

class JMP(Instruction): Operation = "JMP"
class BRZ(Instruction): Operation = "BRZ"
class BNZ(Instruction): Operation = "BNZ"
class BRE(Instruction): Operation = "BRE"
class BNE(Instruction): Operation = "BNE"
class BRL(Instruction): Operation = "BRL"
class BLE(Instruction): Operation = "BLE"
class BRG(Instruction): Operation = "BRG"