Ejemplo n.º 1
0
        public override object VisitOp_bgt([NotNull] MipsAsmParser.Op_bgtContext context)
        {
            // bgt rs, rt, label
            // => slt at, rt, rs
            Instruction slt = new Instruction();

            slt.Type   = FormatType.Register;
            slt.Opcode = Opcode.RType;
            slt.Rs     = (RegisterType)Visit(context.rt);
            slt.Rt     = (RegisterType)Visit(context.rs);
            slt.Rd     = RegisterType.at;
            slt.Funct  = Funct.slt;
            // + bne at, zero, label
            Instruction bne = new Instruction();

            bne.Type   = FormatType.Immediate;
            bne.Opcode = Opcode.bne;
            bne.Rs     = RegisterType.at;
            bne.Rt     = RegisterType.zero;
            bne.TargetLabelIdentity = context.target.GetText();

            slt.NextInstruction = bne;
            return(slt);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="MipsAsmParser.op_bgt"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitOp_bgt([NotNull] MipsAsmParser.Op_bgtContext context)
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="MipsAsmParser.op_bgt"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitOp_bgt([NotNull] MipsAsmParser.Op_bgtContext context)
 {
     return(VisitChildren(context));
 }