Hab mal wieder etwas mit MCode rumgespielt und hab jetzt einen Weg gefunden per GCC-Compiler MCode zu kompilieren...
Code: Select all
#NoEnv
SetWorkingDir, % A_ScriptDir
FileDelete, x86.txt
FileDelete, x64.txt
RunWait, %comspec% /c ""C:\mingw64\mingw64\bin\gcc.exe" -g -c -m32 -o "%A_ScriptDir%\test.o" test.c"
RunWait, %comspec% /c ""C:\mingw64\mingw64\bin\objdump.exe" -d -M intel "%A_ScriptDir%\test.o">x86.txt"
FileDelete, test.s
FileDelete, test.o
RunWait, %comspec% /c ""C:\mingw64\mingw64\bin\gcc.exe" -g -c -m64 -o "%A_ScriptDir%\test.o" test.c"
RunWait, %comspec% /c ""C:\mingw64\mingw64\bin\objdump.exe" -d -M intel "%A_ScriptDir%\test.o">x64.txt"
FileDelete, test.s
FileDelete, test.o
FileRead, x86, x86.txt
FileRead, x64, x64.txt
MsgBox, % x86 "`n`n`n" x64
Code: Select all
int add(int a, int b)
{
return a+b;
}
Code: Select all
C:\Users\__________\Desktop\GCC-MCode\test.o: file format pe-i386
Disassembly of section .text:
00000000 <_add>:
0: 55 push ebp
1: 89 e5 mov ebp,esp
3: 8b 55 08 mov edx,DWORD PTR [ebp+0x8]
6: 8b 45 0c mov eax,DWORD PTR [ebp+0xc]
9: 01 d0 add eax,edx
b: 5d pop ebp
c: c3 ret
d: 90 nop
e: 90 nop
f: 90 nop
C:\Users\__________\Desktop\GCC-MCode\test.o: file format pe-x86-64
Disassembly of section .text:
0000000000000000 <add>:
0: 55 push rbp
1: 48 89 e5 mov rbp,rsp
4: 89 4d 10 mov DWORD PTR [rbp+0x10],ecx
7: 89 55 18 mov DWORD PTR [rbp+0x18],edx
a: 8b 55 10 mov edx,DWORD PTR [rbp+0x10]
d: 8b 45 18 mov eax,DWORD PTR [rbp+0x18]
10: 01 d0 add eax,edx
12: 5d pop rbp
13: c3 ret
14: 90 nop
15: 90 nop
16: 90 nop
17: 90 nop
18: 90 nop
19: 90 nop
1a: 90 nop
1b: 90 nop
1c: 90 nop
1d: 90 nop
1e: 90 nop
1f: 90 nop
Warum das ganze jetzt?...
Punkt 1: GCC/MinGW ist komplett kostenlos, frei, open source, gratis und kostet nichts
Punkt 2: GCC läuft auch auf Linux
Wobei Punkt 2 sehr stark für einen neuen Onlinegenerator spricht, bei dem ich nicht auf eine DynDns oder einen Windows-Root-Server angewiesen bin...
... noch eine Idee ist es den Compiler auch direkt in meiner neuen Web-API anzubieten.
Und jetzt bitte