Exemplo n.º 1
0
        public static void Assemble(char[] fil, char[] opt, bool hasMain)
        {
            int retCode;

            System.String optNm;
            System.String suffx;
            System.String fName = CP_rts.mkStr(fil);
            if (hasMain)
            {
                optNm = "/exe ";
                suffx = ".exe";
            }
            else
            {
                optNm = "/dll ";
                suffx = ".dll";
            }
            optNm = optNm + CP_rts.mkStr(opt) + ' ';
            asm.StartInfo.Arguments = optNm + "/nologo /quiet " + fName + ".il";
            asm.Start();
            asm.WaitForExit();
            retCode = asm.ExitCode;
            if (retCode != 0)
            {
                System.Console.WriteLine("#gpcp: ilasm FAILED " + retCode);
            }
            else
            {
                System.Console.WriteLine("#gpcp: created " + fName + suffx);
            }
        }
Exemplo n.º 2
0
/* -------------------------------------------------------------------- */
//
// PROCEDURE mkStr*(IN s : ARRAY OF CHAR) : String; BEGIN RETURN NIL END mkStr;
//
/* -------------------------------------------------------------------- */
    // Known in ILASM as [RTS]NativeStrings::mkStr
    public static System.String mkStr(char[] arr)
    {
        if (arr == null)
        {
            return(null);
        }
        int len = CP_rts.chrArrLength(arr);

        return(new System.String(arr, 0, len));
    }
Exemplo n.º 3
0
        public static void DoAsm(char[] fil, char[] opt,
                                 bool hasMain,
                                 bool verbose,
                                 ref int rslt)
        {
            System.String optNm;
            System.String suffx;
            System.String fName = CP_rts.mkStr(fil);
            if (hasMain)
            {
                optNm = "/exe ";
                suffx = ".exe";
            }
            else
            {
                optNm = "/dll ";
                suffx = ".dll";
            }
            optNm = optNm + CP_rts.mkStr(opt) + ' ';
            if (verbose)
            {
                System.Console.WriteLine("#gpcp: Calling " + asm.StartInfo.FileName);
#if BETA2
                asm.StartInfo.CreateNoWindow = false;
#endif
                asm.StartInfo.Arguments = optNm + "/nologo " + fName + ".il";
            }
            else
            {
#if BETA2
                asm.StartInfo.CreateNoWindow = true;
#endif
                asm.StartInfo.Arguments = optNm + "/nologo /quiet " + fName + ".il";
            }
            asm.Start();
            asm.WaitForExit();
            rslt = asm.ExitCode;
            if (rslt == 0)
            {
                System.Console.WriteLine("#gpcp: Created " + fName + suffx);
            }
        }
Exemplo n.º 4
0
 public static void GetEnvVar(char[] name, char[] valu)
 {
     System.String nam = CP_rts.mkStr(name);
     System.String val = System.Environment.GetEnvironmentVariable(nam);
     CP_rts.StrToChF(valu, val);
 }
Exemplo n.º 5
0
/* -------------------------------------------------------------------- */
//  PROCEDURE getStr*(x : NativeException) : RTS.CharOpen; END getStr;
//
    // Known in ILASM as [RTS]RTS::getStr
    public static char[] getStr(System.Exception inp)
    {
        return(CP_rts.strToChO(inp.ToString()));
    }