The steps are outlined in Instructions.Pdf. The Dll is generated as a Vb Windows Class Library. The DLL is then disassembled via Ildam to get the IL. This IL is then edited to conform to the Micro Framework. It is reassembled to a DLL and then processed for Netduino using MetaDataProcessor.exe. Theoretically, you could code in your favorite CLI language (e.g. F#)and do the same thing.
To see the requirements for a Micro Framework DLL, Write one in the C# Micro Framework Template and dissamble it with Ildasm. Here is Luke Commings' Bitconverter that I converted to a DLL in C# and disassembled,
// Microsoft (R) .NET Framework IL Disassembler. Version 3.5.30729.1 // Copyright (c) Microsoft Corporation. All rights reserved. // N.B. ******************** Ignore this ***************** // warning : THIS IS A PARTIAL DISASSEMBLY, NOT SUITABLE FOR RE-ASSEMBLING // Only shown items having accessibility: Public // Classes defined in this module: //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class BitConverter (public) (abstract) (auto) (ansi) (sealed) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Metadata version: v4.0.30319 .assembly extern mscorlib { .ver 4:2:0:0 } .assembly extern Microsoft.SPOT.Native { .ver 4:2:0:0 } .assembly Bitconverter1 { .hash algorithm 0x00008004 .ver 1:0:0:0 } .module Bitconverter1.dll // MVID: {591A8669-F2EC-422F-A8D5-C0BFA8B82A9D} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x00A40000 // =============== CLASS MEMBERS DECLARATION =================== .class public abstract auto ansi sealed beforefieldinit Bitconverter1.BitConverter extends [mscorlib]System.Object { .method public hidebysig static void ToBytes(uint8[] buffer, int32 offset, int64 'value') cil managed { // Code size 26 (0x1a) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldc.i4.4 IL_0003: ldarg.2 IL_0004: ldc.i4.s 32 IL_0006: shr IL_0007: conv.u4 IL_0008: call void [Microsoft.SPOT.Native]Microsoft.SPOT.Hardware.Utility::InsertValueIntoArray(uint8[], int32, int32, uint32) IL_000d: ldarg.0 IL_000e: ldarg.1 IL_000f: ldc.i4.4 IL_0010: add IL_0011: ldc.i4.4 IL_0012: ldarg.2 IL_0013: conv.u4 IL_0014: call void [Microsoft.SPOT.Native]Microsoft.SPOT.Hardware.Utility::InsertValueIntoArray(uint8[], int32, int32, uint32) IL_0019: ret } // end of method BitConverter::ToBytes .method public hidebysig static void ToBytes(uint8[] buffer, int32 offset, float32 'value') cil managed { // Code size 13 (0xd) .maxstack 8 IL_0000: ldarg.0 IL_0001: ldarg.1 IL_0002: ldc.i4.4 IL_0003: ldarga.s 'value' IL_0005: conv.u IL_0006: ldind.u4 IL_0007: call void [Microsoft.SPOT.Native]Microsoft.SPOT.Hardware.Utility::InsertValueIntoArray(uint8[], int32, int32, uint32) IL_000c: ret } // end of method BitConverter::ToBytes ----- Cut for brevity -------Here are the important entries,
// Metadata version: v4.0.30319
.assembly extern mscorlib
{
.ver 4:2:0:0
}
.assembly extern Microsoft.SPOT.Native
{
.ver 4:2:0:0
}
Note that they target the Micro Framework. I don't know how Ilasm resolves the correct target framework.
The first question will be; Why bother with this since C# has this capability for the Micro Framework? Well, some prefer VB coding, but mostly it is an exploration into the wonderful world of Ilasm, Ildasm and CIL. No one writes IL from scratch except textbook authors trying to explain it.
Baxter