public override bool IsComplete(NCAsm.AsmContext aAssembler)
 {
     if (ArgumentRef != null)
     {
         ulong xAddress;
         return(base.IsComplete(aAssembler) && ArgumentRef.Resolve(aAssembler, out xAddress));
     }
     return(base.IsComplete(aAssembler));
 }
        protected string GetArgumentAsString()
        {
            string xDest = "";

            if ((ArgumentValue.HasValue || ArgumentRef != null) &&
                ArgumentIsIndirect &&
                ArgumentReg != null)
            {
                throw new Exception("[Scale*index+base] style addressing not supported at the moment");
            }
            if (ArgumentRef != null)
            {
                xDest = ArgumentRef.ToString();
            }
            else
            {
                if (ArgumentReg != null)
                {
                    xDest = Registers.GetRegisterName(ArgumentReg.Value);
                }
                else
                {
                    if (ArgumentValue.HasValue)
                    {
                        xDest = "0x" + ArgumentValue.GetValueOrDefault().ToString("X").ToUpperInvariant();
                    }
                }
            }
            if (ArgumentDisplacement != 0)
            {
                xDest += " + " + ArgumentDisplacement;
            }
            if (ArgumentIsIndirect)
            {
                return("[" + xDest + "]");
            }
            else
            {
                return(xDest);
            }
        }
Beispiel #3
0
 public void SetArgumentName(short num, string name)
 {
     args[num] = new ArgumentRef(name, num);
     locals.AddSymbol(args[num]);
 }