コード例 #1
0
        public void generate()
        {
            allocateStatic();

            //assembly.putLine();
            assembly.putComment("Init static data");
            generateStaticInitializer();

            assembly.putComment("Code block");
            generateCodeRoutine();

            assembly.putLine();
            generateModulesRoutines();

            assembly.putLine();
            assembly.putComment("End of program");
            assembly.put(AsmBuilder.label(":end"));
        }
コード例 #2
0
 private void _generateRoutine(Module module, RoutineTableEntry routine)
 {
     // todo: генерация кода одной функции
     assembly.put(AsmBuilder.condJump(RegistersManager.JL_REG, RegistersManager.RL_REG));
 }
コード例 #3
0
 public void setCurrentModule(Module module)
 {
     buffer.put(AsmBuilder.setRegister(RegistersManager.SB_REG, module.staticBase));
 }
コード例 #4
0
 public void moveFpToSp()
 {
     buffer.put(AsmBuilder.setRegister(RegistersManager.FP_REG, RegistersManager.SP_REG));
 }
コード例 #5
0
 public void setRegister(string reg, int index)
 {
     buffer.put(AsmBuilder.setRegister(reg, index));
 }