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); }
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; } }
protected override void Parse(AsmParser parser) { var dest = parser.ReadPort32(); parser.ReadToken(TokenType.Comma); var value = parser.ReadBit(); Port = dest; Bit = value; }
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); }
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; }
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); }
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); }
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); }
protected override void Parse(AsmParser parser) { Bit = parser.ReadBit(); parser.ReadToken(TokenType.Comma); ParseOffset(parser); }
protected override void Parse(AsmParser parser) { Destination = parser.ReadReg32(); parser.ReadToken(TokenType.Comma); Address = parser.ReadUshort(); }
protected override void Parse(AsmParser parser) { Port = parser.ReadPort64(); parser.ReadToken(TokenType.Comma); Register = parser.ReadReg32(); }
protected override void Parse(AsmParser parser) { Operand = parser.ReadIndirectOperand(); parser.ReadToken(TokenType.Comma); Source = parser.ReadReg32(); }
protected override void Parse(AsmParser parser) { Register = parser.ReadReg32(); parser.ReadToken(TokenType.Comma); Bit = parser.ReadBit(); }
protected override void Parse(AsmParser parser) { Destination = parser.ReadReg32(); parser.ReadToken(TokenType.Comma); Operand = parser.ReadIndirectOperand(); }
protected override void Parse(AsmParser parser) { Register = parser.ReadReg16(); parser.ReadToken(TokenType.Comma); Value = parser.ReadByte(); }
protected override void Parse(AsmParser parser) { Destination = parser.ReadReg16(); parser.ReadToken(TokenType.Comma); Register = parser.ReadReg16(); }
protected override void Parse(AsmParser parser) { Address = parser.ReadUshort(); parser.ReadToken(TokenType.Comma); Source = parser.ReadReg32(); }