Пример #1
0
        private void GenerateLabelForJumpee(LabelGenerator Generator, JumpableInstruction Jumper, Instruction Jumpee)
        {
            string Label = (string.IsNullOrEmpty(Jumpee.Label) ? Generator.generateLabel() : Jumpee.Label);

            Jumpee.Label = Label;
            Jumper.TargetAddressLabel = Label;
        }
Пример #2
0
        private void AddLabels(Dictionary <int, Instruction> Instructions)//
        {
            LabelGenerator Generator = new LabelGenerator();

            foreach (var iterator in Instructions.Values)
            {
                if (iterator is JumpableInstruction)
                {
                    JumpableInstruction Jumper = (JumpableInstruction)iterator;
                    GenerateLabelForJumpee(Generator, Jumper, Instructions[(int)Jumper.Target]);
                }
            }
        }