Ejemplo n.º 1
0
        public string GetNextRtLabel()
        {
            var rtLabel = string.Empty;

            while (LabelsFromZ80Code.Contains(rtLabel) || rtLabel == string.Empty)
            {
                var nextRt = ++_nextRt;
                rtLabel = "RT" + new string('0', 3 - (int)Math.Log10(nextRt)) + nextRt.ToString();
            }
            return(rtLabel);
        }
Ejemplo n.º 2
0
        public string GetNextJumpLabel()
        {
            var jmpLabel = string.Empty;

            while (LabelsFromZ80Code.Contains(jmpLabel) || jmpLabel == string.Empty)
            {
                var nextJump = ++_nextJump;
                jmpLabel = "JMP" + new string('0', 2 - (int)Math.Log10(nextJump)) + nextJump.ToString();
            }
            return(jmpLabel);
        }
Ejemplo n.º 3
0
        public string GetNextIncLabel()
        {
            var incLabel = string.Empty;

            while (LabelsFromZ80Code.Contains(incLabel) || incLabel == string.Empty)
            {
                var nextInc = ++_nextInc;
                incLabel = "INC" + new string('0', 2 - (int)Math.Log10(nextInc)) + nextInc.ToString();
            }
            return(incLabel);
        }
Ejemplo n.º 4
0
        public string GetNextDecLabel()
        {
            var decLabel = string.Empty;

            while (LabelsFromZ80Code.Contains(decLabel) || decLabel == string.Empty)
            {
                var nextDec = ++_nextDec;
                decLabel = "DEC" + new string('0', 2 - (int)Math.Log10(nextDec)) + nextDec.ToString();
            }
            return(decLabel);
        }
Ejemplo n.º 5
0
 public string GetLabelUnusedByZ80(string sourceLabel)
 {
     if (!LabelsFromZ80Code.Contains(sourceLabel))
     {
         return(sourceLabel);
     }
     sourceLabel = sourceLabel + new string('0', 6 - sourceLabel.Length);
     while (LabelsFromZ80Code.Contains(sourceLabel))
     {
         StringIncrementer.Increment(sourceLabel);
     }
     return(sourceLabel);
 }