Mittwoch, 5. Dezember 2007

Use of AsciiMASH Dynamic Link Library (DLL) with Mono/Linux

Because of the binary compatibility from Mono to Microsofts .NET Framework is it also very simple to be used the AsciiMASH Dynamic Link Library by Mono with Linux. At first you have to copy the DLL to the local user folder on your Linux system (using of a USB stick is recommend). Next you create a simple text document (for example with gedit) like the following example and stores it into the same folder as the AsciiMASH DLL with the name Sample.cs.

using System;
using AsciiMASH;

class Sample
{
   static void Main(string[] args)
   {
      string Code = "65[:+]91";

      AsciiMASH_Interpreter AI = new AsciiMASH_Interpreter();
      AI.Run(Code);
   }
}


Open a terminal program (change into the local user folder if not happened) and execute the following command line.

mcs Sample.cs -out:Sample.exe -r:AsciiMASH.dll

Now the upper example source code will be compiled and it creates an executable file with the name Sample.exe. To start the AsciiMASH interpreter, Mono with the parameter of the executable file name must start - the whole alphabet is print on the screen.

mono Sample.exe