Пример #1
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);
 }
Пример #2
0
 protected override void Parse(AsmParser parser)
 {
     if (parser.IsEndOfLine) {
         PostIncrement = false;
     } else {
         var zReg = parser.ReadToken(TokenType.Literal);
         if (zReg.StringValue.ToLower() != "z") throw new TokenException("Z+ expected", zReg);
         parser.ReadToken(TokenType.Plus);
         PostIncrement = true;
     }
 }
Пример #3
0
        protected override void Parse(AsmParser parser)
        {
            var dest = parser.ReadPort32();
            parser.ReadToken(TokenType.Comma);
            var value = parser.ReadBit();

            Port = dest;
            Bit = value;
        }
Пример #4
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);
 }
Пример #5
0
 protected override void Parse(AsmParser parser)
 {
     Register = parser.ReadRegW24();
     parser.ReadToken(TokenType.Comma);
     Token exprToken;
     var imm = parser.CalculateExpression(out exprToken);
     if (imm > 63) {
         throw new TokenException("value must be less than 64", exprToken);
     }
     Value = (byte)imm;
 }
Пример #6
0
        protected override void Parse(AsmParser parser)
        {
            if (parser.IsEndOfLine) {
                Destination = 0;
                Increment = false;
                NoArgs = true;
                return;
            }
            NoArgs = false;
            Destination = parser.ReadReg32();

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

            Increment = false;
            if (!parser.IsEndOfLine) {
                parser.ReadToken(TokenType.Plus);
                Increment = true;
            }
        }
 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);
 }
Пример #8
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);
        }
Пример #9
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);
        }
Пример #10
0
 protected override void Parse(AsmParser parser)
 {
     Bit = parser.ReadBit();
     parser.ReadToken(TokenType.Comma);
     ParseOffset(parser);
 }
Пример #11
0
 protected override void Parse(AsmParser parser)
 {
     Destination = parser.ReadReg32();
     parser.ReadToken(TokenType.Comma);
     Address = parser.ReadUshort();
 }
Пример #12
0
 protected override void Parse(AsmParser parser)
 {
     Port = parser.ReadPort64();
     parser.ReadToken(TokenType.Comma);
     Register = parser.ReadReg32();
 }
Пример #13
0
 protected override void Parse(AsmParser parser)
 {
     Operand = parser.ReadIndirectOperand();
     parser.ReadToken(TokenType.Comma);
     Source = parser.ReadReg32();
 }
Пример #14
0
 protected override void Parse(AsmParser parser)
 {
     Register = parser.ReadReg32();
     parser.ReadToken(TokenType.Comma);
     Bit = parser.ReadBit();
 }
Пример #15
0
 protected override void Parse(AsmParser parser)
 {
     Destination = parser.ReadReg32();
     parser.ReadToken(TokenType.Comma);
     Operand = parser.ReadIndirectOperand();
 }
Пример #16
0
 protected override void Parse(AsmParser parser)
 {
     Register = parser.ReadReg16();
     parser.ReadToken(TokenType.Comma);
     Value = parser.ReadByte();
 }
Пример #17
0
 protected override void Parse(AsmParser parser)
 {
     Destination = parser.ReadReg16();
     parser.ReadToken(TokenType.Comma);
     Register = parser.ReadReg16();
 }
Пример #18
0
 protected override void Parse(AsmParser parser)
 {
     Address = parser.ReadUshort();
     parser.ReadToken(TokenType.Comma);
     Source = parser.ReadReg32();
 }