예제 #1
0
파일: LOAD.cs 프로젝트: KPU-RISC/KPU
        /// <summary>
        /// HLT
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override Result VisitLOAD(LowLevelAssemblyParser.LOADContext context)
        {
            string sourceRegister = context.register_8bit().GetText();

            string opcode = "10010";

            opcode += GetRegisterOpCode_GeneralPurpose(sourceRegister);
            opcode += " ; LOAD " + sourceRegister;
            assembly.Add(opcode);

            return(base.VisitLOAD(context));
        }
예제 #2
0
 /// <summary>
 /// Visit a parse tree produced by <see cref="LowLevelAssemblyParser.LOAD"/>.
 /// <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 VisitLOAD([NotNull] LowLevelAssemblyParser.LOADContext context)
 {
     return(VisitChildren(context));
 }