Example #1
0
 protected override void Compile(AsmSection output)
 {
     var target = Target / 2;
     var translation = new OpcodeTranslation { Opcode = _opcodeTemplate, Offset22High = (byte)(target >> 16) };
     output.EmitCode(translation.Opcode);
     output.EmitCode((ushort)(target & 0xffff));
 }
Example #2
0
 protected override void Compile(AsmSection output)
 {
     if (NoArgs) {
         output.EmitCode(0x95c8);
     } else {
         var translation = new OpcodeTranslation { Opcode = 0x9004, Destination32 = Destination, Increment = Increment };
         output.EmitCode(translation.Opcode);
     }
 }
Example #3
0
 public override void Compile(AsmParser parser, AsmSection output)
 {
     var translation = new OpcodeTranslation { Opcode = _opcodeTemplate };
     var dest = parser.ReadDesRound();
     translation.DesRound = dest;
     output.EmitCode(translation.Opcode);
 }
 protected override void Compile(AsmSection output)
 {
     var translation = new OpcodeTranslation {
         Opcode = _opcodeTemplate,
         StatusBitNumber = Bit
     };
     output.EmitCode(translation.Opcode);
 }
Example #5
0
 protected override void Compile(AsmSection output)
 {
     var translation = new OpcodeTranslation {
         Opcode = _opcodeTemplate,
         Destination32 = Register
     };
     output.EmitCode(translation.Opcode);
 }
Example #6
0
 protected override void Compile(AsmSection output)
 {
     var translation = new OpcodeTranslation {
         Opcode = _opcodeTemplate,
         SpmIncrement = PostIncrement
     };
     output.EmitCode(translation.Opcode);
 }
Example #7
0
 public override void Compile(AsmParser parser, AsmSection output)
 {
     var zToken = parser.ReadToken(TokenType.Literal);
     if (zToken.StringValue.ToLower() != "z") throw new TokenException("Z register expected", zToken);
     parser.ReadToken(TokenType.Comma);
     var dest = parser.ReadReg32();
     var translation = new OpcodeTranslation { Opcode = _opcodeTemplate, Destination32 = dest };
     output.EmitCode(translation.Opcode);
 }
Example #8
0
 public override void Compile(AsmParser parser, AsmSection output)
 {
     var translation = new OpcodeTranslation { Opcode = _opcodeTemplate };
     var dest = parser.ReadReg8();
     translation.Destination8 = dest;
     parser.ReadToken(TokenType.Comma);
     var reg = parser.ReadReg8();
     translation.Register8 = reg;
     output.EmitCode(translation.Opcode);
 }
Example #9
0
        protected override void Compile(AsmSection output)
        {
            var translation = new OpcodeTranslation {
                Opcode = GetOpcodeTemplate(Operand),
                Destination32 = Source,
                Increment = Operand.Increment,
                Decrement = Operand.Decrement
            };

            output.EmitCode(translation.Opcode);
        }
 public override void Compile(AsmParser parser, AsmSection output)
 {
     var dest = parser.ReadReg16();
     parser.ReadToken(TokenType.Comma);
     var value = parser.ReadByte();
     var translation = new OpcodeTranslation {
         Opcode = _opcodeTemplate,
         Destination16 = dest,
         Imm8 = (byte)(255 - value)
     };
     output.EmitCode(translation.Opcode);
 }
Example #11
0
        public override void Compile(AsmParser parser, AsmSection output)
        {
            var dest = parser.ReadReg32();
            parser.ReadToken(TokenType.Comma);
            var operand = parser.ReadIndirectWithDisplacement();

            var translation = new OpcodeTranslation {
                Opcode = GetOpcodeTemplate(operand.Register),
                Destination32 = dest,
                Displacement = operand.Displacement
            };

            output.EmitCode(translation.Opcode);
        }
Example #12
0
        public override void Compile(AsmParser parser, AsmSection output)
        {
            if (parser.IsEndOfLine) {
                output.EmitCode(_opcodeTemplate);
                return;
            }

            var dest = parser.ReadReg32();

            parser.ReadToken(TokenType.Comma);

            var zReg = parser.ReadToken(TokenType.Literal);
            if (zReg.StringValue.ToLower() != "z") throw new TokenException("Z register expected", zReg);

            var increment = false;
            if (!parser.IsEndOfLine) {
                parser.ReadToken(TokenType.Plus);
                increment = true;
            }

            var translation = new OpcodeTranslation { Opcode = 0x9006, Destination32 = dest, Increment = increment };
            output.EmitCode(translation.Opcode);
        }
Example #13
0
 protected override void Compile(AsmSection output)
 {
     output.EmitCode(_opcodeTemplate);
 }
Example #14
0
 protected override void Compile(AsmSection output)
 {
     var translation = new OpcodeTranslation { Opcode = _opcodeTemplate, Offset12 = (short) (Delta / 2) };
     output.EmitCode(translation.Opcode);
 }
Example #15
0
 protected override void Compile(AsmSection output)
 {
     var translation = new OpcodeTranslation { Opcode = _opcodeTemplate, RegW24 = Register, Imm6 = Value };
     output.EmitCode(translation.Opcode);
 }