Ejemplo n.º 1
0
   def writeMul(self, A, B, Destination):
      NewInstruction = ImmediateInstruction(ImmediateInstruction.EnumType.MUL, self.ImmediateInstructionCounter)
      NewInstruction.A = A
      NewInstruction.B = B
      NewInstruction.Destination = Destination

      self.ImmCodeData.append(NewInstruction)
      self.ImmediateInstructionCounter += 1      
Ejemplo n.º 2
0
   def writeAdd(self, A, B, Destination):
      NewInstruction = ImmediateInstruction(ImmediateInstruction.EnumType.ADD, self.ImmediateInstructionCounter)
      NewInstruction.A = A
      NewInstruction.B = B
      NewInstruction.Destination = Destination
      NewInstruction.StaticCarry = False

      self.ImmCodeData.append(NewInstruction)
      self.ImmediateInstructionCounter += 1
Ejemplo n.º 3
0
    def writeMul(self, A, B, Destination):
        NewInstruction = ImmediateInstruction(
            ImmediateInstruction.EnumType.MUL,
            self.ImmediateInstructionCounter)
        NewInstruction.A = A
        NewInstruction.B = B
        NewInstruction.Destination = Destination

        self.ImmCodeData.append(NewInstruction)
        self.ImmediateInstructionCounter += 1
Ejemplo n.º 4
0
   def writeIf(self, A, B, IfType, TrueLabelId, FalseLabelId):
      NewInstruction = ImmediateInstruction(ImmediateInstruction.EnumType.IF, self.ImmediateInstructionCounter)
      NewInstruction.IfType       = IfType
      NewInstruction.A            = A
      NewInstruction.B            = B
      NewInstruction.TrueLabelId  = TrueLabelId
      NewInstruction.FalseLabelId = FalseLabelId

      self.ImmCodeData.append(NewInstruction)
      self.ImmediateInstructionCounter += 1
Ejemplo n.º 5
0
    def writeAdd(self, A, B, Destination):
        NewInstruction = ImmediateInstruction(
            ImmediateInstruction.EnumType.ADD,
            self.ImmediateInstructionCounter)
        NewInstruction.A = A
        NewInstruction.B = B
        NewInstruction.Destination = Destination
        NewInstruction.StaticCarry = False

        self.ImmCodeData.append(NewInstruction)
        self.ImmediateInstructionCounter += 1
Ejemplo n.º 6
0
    def writeIf(self, A, B, IfType, TrueLabelId, FalseLabelId):
        NewInstruction = ImmediateInstruction(ImmediateInstruction.EnumType.IF,
                                              self.ImmediateInstructionCounter)
        NewInstruction.IfType = IfType
        NewInstruction.A = A
        NewInstruction.B = B
        NewInstruction.TrueLabelId = TrueLabelId
        NewInstruction.FalseLabelId = FalseLabelId

        self.ImmCodeData.append(NewInstruction)
        self.ImmediateInstructionCounter += 1