A anos tento fazer um teste com o Harbour para gerar um sample que seja compilado nesta plataforma.
Nunca obtive exito e mesmo porque as versões posteriores do Harbour não possuiam mais o parâmetro para geração do resultado para compilação nesta plataforma.
Recentemente procurando e deletando alguns diretórios e Harbour´s encontrei a pasta MiniGUI com a sua versão 2.
Sou xereta e gosta de testar os Harbour para ver se estão bem configurados e ao notar que o parâmetro /GI estava lá e resolvi testar num pequeno .PRG.
Desta vez obtive um código completo sem erros, então partir para o ambiente( já o tenho configurado ) e fui a caça de informação para obtenção do EXEcutável.
Depois de uma googlada encontrei informação sobre um utilitário que permitia gerar o EXEcutável a partir do .IL gerado pelo Harbour em questão.
Arquivo HELLO.PRG:
Código: Selecionar todos
? "Hello Word"
A configuração de caminhos foi:
Código: Selecionar todos
@SET FWDIR=
@SET VSNET=
@SET dotNETSDK=
@IF "%1"=="/M" GOTO MODIFICADO
:ORIGINAL
@SET VSNET=C:\Arquivos de programas\Microsoft Visual Studio .NET 2003
@SET dotNETSDK=C:\Arquivos de programas\Microsoft.NET
GOTO CONFIGURA
:MODIFICADO
@SET FWDIR=C:\develop\Fivewin\dotNETSDK\HARBOUR
@SET VSNET=C:\develop\Fivewin\dotNETSDK
@SET dotNETSDK=C:\develop\Fivewin\dotNETSDK\dotNETv1.1\Framework\v1.1.4322
:CONFIGURA
@SET PATH=%dotNETSDK%\;%VSNET%\v1.1\bin\;%VSNET%\Vc7\bin\;%VSNET%\Common7\IDE\;%FWDIR%\bin;%PATH%
@SET LIB=%VSNET%\Vc7\lib\;"%dotNETSDK%\";%FWDIR%\lib;%LIB%
@SET INCLUDE=%VSNET%\Vc7\include\;"%dotNETSDK%\";%FWDIR%\include;%INCLUDE%
@SET NetSamplePath="%dotNETSDK%\v1.1\"
Código: Selecionar todos
// Harbour Compiler, Alpha build 43.0 (Flex)
// Generated .NET IL source code
.assembly extern mscorlib{}
.assembly HELLO_PRG{}
.method public static void HELLO()
{
.entrypoint
IL_0000: nop // HB_P_LINE
IL_0003: nop
IL_0006: ldstr "Hello Word"
IL_0013: call object QOUT( object )
pop
ret
}
.method public static object ObjAdd(object a, object b)
{
.maxstack 2
.locals init (object V_0)
IL_0000: ldarg.0
IL_0001: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0006: ldtoken [mscorlib]System.Int32
IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0010: bne.un.s IL_003b
IL_0012: ldarg.1
IL_0013: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0018: ldtoken [mscorlib]System.Int32
IL_001d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0022: bne.un.s IL_003b
IL_0024: ldarg.0
IL_0025: unbox [mscorlib]System.Int32
IL_002a: ldind.i4
IL_002b: ldarg.1
IL_002c: unbox [mscorlib]System.Int32
IL_0031: ldind.i4
IL_0032: add
IL_0033: box [mscorlib]System.Int32
IL_0038: stloc.0
IL_0039: br.s IL_0077
IL_003b: ldarg.0
IL_003c: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0041: ldtoken [mscorlib]System.String
IL_0046: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_004b: bne.un.s IL_0073
IL_004d: ldarg.1
IL_004e: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0053: ldtoken [mscorlib]System.String
IL_0058: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_005d: bne.un.s IL_0073
IL_005f: ldarg.0
IL_0060: callvirt instance string [mscorlib]System.Object::ToString()
IL_0065: ldarg.1
IL_0066: callvirt instance string [mscorlib]System.Object::ToString()
IL_006b: call string [mscorlib]System.String::Concat(string,string)
IL_0070: stloc.0
IL_0071: br.s IL_0077
IL_0073: ldnull
IL_0074: stloc.0
IL_0075: br.s IL_0077
IL_0077: ldloc.0
IL_0078: ret
}
.method public static vararg object ObjArrayGen()
{
.maxstack 2
.locals init (class [mscorlib]System.Collections.ArrayList V_0,
valuetype [mscorlib]System.ArgIterator V_1,
object V_2)
IL_0000: newobj instance void [mscorlib]System.Collections.ArrayList::.ctor()
IL_0005: stloc.0
IL_0006: ldloca.s V_1
IL_0008: arglist
IL_000a: call instance void [mscorlib]System.ArgIterator::.ctor(valuetype [mscorlib]System.RuntimeArgumentHandle)
IL_000f: br.s IL_0025
IL_0011: ldloc.0
IL_0012: ldloca.s V_1
IL_0014: call instance typedref [mscorlib]System.ArgIterator::GetNextArg()
IL_0019: refanyval [mscorlib]System.Object
IL_001e: ldind.ref
IL_001f: callvirt instance int32 [mscorlib]System.Collections.ArrayList::Add(object)
IL_0024: pop
IL_0025: ldloca.s V_1
IL_0027: call instance int32 [mscorlib]System.ArgIterator::GetRemainingCount()
IL_002c: ldc.i4.0
IL_002d: bgt.s IL_0011
IL_002f: ldloc.0
IL_0030: stloc.2
IL_0031: br.s IL_0033
IL_0033: ldloc.2
IL_0034: ret
}
.method public static object ObjArrayPush(object 'array', object index)
{
.maxstack 3
.locals init (object V_0)
IL_0000: ldarg.0
IL_0001: castclass [mscorlib]System.Collections.ArrayList
IL_0006: ldarg.1
IL_0007: unbox [mscorlib]System.Int32
IL_000c: ldind.i4
IL_000d: ldc.i4.1
IL_000e: sub
IL_000f: callvirt instance object [mscorlib]System.Collections.ArrayList::get_Item(int32)
IL_0014: stloc.0
IL_0015: br.s IL_0017
IL_0017: ldloc.0
IL_0018: ret
}
.method public static bool ObjLessEqual( object a, object b )
{
.maxstack 2
.locals init (bool V_0)
IL_0000: ldarg.0
IL_0001: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0006: ldtoken [mscorlib]System.Int32
IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0010: bne.un.s IL_003a
IL_0012: ldarg.1
IL_0013: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0018: ldtoken [mscorlib]System.Int32
IL_001d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0022: bne.un.s IL_003a
IL_0024: ldarg.0
IL_0025: unbox [mscorlib]System.Int32
IL_002a: ldind.i4
IL_002b: ldarg.1
IL_002c: unbox [mscorlib]System.Int32
IL_0031: ldind.i4
IL_0032: cgt
IL_0034: ldc.i4.0
IL_0035: ceq
IL_0037: stloc.0
IL_0038: br.s IL_003e
IL_003a: ldc.i4.0
IL_003b: stloc.0
IL_003c: br.s IL_003e
IL_003e: ldloc.0
IL_003f: ret
}
.method public static bool ObjForTest(object current,object end,object step)
{
.maxstack 2
.locals init (bool V_0)
IL_0000: ldarg.2
IL_0001: unbox [mscorlib]System.Int32
IL_0006: ldind.i4
IL_0007: ldc.i4.0
IL_0008: blt.s IL_0020
IL_000a: ldarg.0
IL_000b: unbox [mscorlib]System.Int32
IL_0010: ldind.i4
IL_0011: ldarg.1
IL_0012: unbox [mscorlib]System.Int32
IL_0017: ldind.i4
IL_0018: cgt
IL_001a: ldc.i4.0
IL_001b: ceq
IL_001d: stloc.0
IL_001e: br.s IL_0036
IL_0020: ldarg.0
IL_0021: unbox [mscorlib]System.Int32
IL_0026: ldind.i4
IL_0027: ldarg.1
IL_0028: unbox [mscorlib]System.Int32
IL_002d: ldind.i4
IL_002e: clt
IL_0030: ldc.i4.0
IL_0031: ceq
IL_0033: stloc.0
IL_0034: br.s IL_0036
IL_0036: ldloc.0
IL_0037: ret
}
.method public static bool ObjExactlyEqual(object a, object b)
{
.maxstack 2
.locals init (bool V_0)
IL_0000: ldarg.0
IL_0001: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0006: ldtoken [mscorlib]System.Int32
IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0010: bne.un.s IL_0037
IL_0012: ldarg.1
IL_0013: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0018: ldtoken [mscorlib]System.Int32
IL_001d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0022: bne.un.s IL_0037
IL_0024: ldarg.0
IL_0025: unbox [mscorlib]System.Int32
IL_002a: ldind.i4
IL_002b: ldarg.1
IL_002c: unbox [mscorlib]System.Int32
IL_0031: ldind.i4
IL_0032: ceq
IL_0034: stloc.0
IL_0035: br.s IL_0073
IL_0037: ldarg.0
IL_0038: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_003d: ldtoken [mscorlib]System.String
IL_0042: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0047: bne.un.s IL_006f
IL_0049: ldarg.1
IL_004a: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_004f: ldtoken [mscorlib]System.String
IL_0054: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0059: bne.un.s IL_006f
IL_005b: ldarg.0
IL_005c: callvirt instance string [mscorlib]System.Object::ToString()
IL_0061: ldarg.1
IL_0062: callvirt instance string [mscorlib]System.Object::ToString()
IL_0067: call bool [mscorlib]System.String::op_Equality(string,string)
IL_006c: stloc.0
IL_006d: br.s IL_0073
IL_006f: ldc.i4.0
IL_0070: stloc.0
IL_0071: br.s IL_0073
IL_0073: ldloc.0
IL_0074: ret
}
.method public static object ObjNot(object o)
{
.maxstack 2
.locals init (object V_0)
IL_0000: ldarg.0
IL_0001: unbox [mscorlib]System.Boolean
IL_0006: ldind.i1
IL_0007: ldc.i4.0
IL_0008: ceq
IL_000a: box [mscorlib]System.Boolean
IL_000f: stloc.0
IL_0010: br.s IL_0012
IL_0012: ldloc.0
IL_0013: ret
}
.method public static object LEN(object o)
{
.maxstack 2
.locals init (object V_0)
IL_0000: ldarg.0
IL_0001: castclass [mscorlib]System.Collections.ArrayList
IL_0006: callvirt instance int32 [mscorlib]System.Collections.ArrayList::get_Count()
IL_000b: box [mscorlib]System.Int32
IL_0010: stloc.0
IL_0011: br.s IL_0013
IL_0013: ldloc.0
IL_0014: ret
}
.method public static object QOUT(object o)
{
.maxstack 2
.locals init (object V_0)
IL_0000: ldarg.0
IL_0001: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0006: ldtoken [mscorlib]System.Boolean
IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0010: bne.un.s IL_002e
IL_0012: ldarg.0
IL_0013: unbox [mscorlib]System.Boolean
IL_0018: ldind.i1
IL_0019: brtrue.s IL_0022
IL_001b: ldstr ".F."
IL_0020: br.s IL_0027
IL_0022: ldstr ".T."
IL_0027: call void [mscorlib]System.Console::WriteLine(string)
IL_002c: br.s IL_0048
IL_002e: ldarg.0
IL_002f: callvirt instance class [mscorlib]System.Type [mscorlib]System.Object::GetType()
IL_0034: brtrue.s IL_0042
IL_0036: ldstr "nil"
IL_003b: call void [mscorlib]System.Console::WriteLine(string)
IL_0040: br.s IL_0048
IL_0042: ldarg.0
IL_0043: call void [mscorlib]System.Console::WriteLine(object)
IL_0048: ldnull
IL_0049: stloc.0
IL_004a: br.s IL_004c
IL_004c: ldloc.0
IL_004d: ret
}
E o resultado esta neste arquivo
Vejam que foi somente um teste, mas eu consegui!, além disto não sei o que seria possivel.
Mas serve para demonstrar que Harbour, como diria meu amigo Máscara...
"...É demaisssssss!"



