API Update+Base FASM Support

This commit is contained in:
2018-04-12 16:35:32 +03:00
parent 08d7761837
commit 0e25c2e70f
5 changed files with 138 additions and 80 deletions

View File

@@ -23,24 +23,24 @@ var
Src:TRTBSource;
Func1:TRTBFunc;
begin
{Fasm:=TRTBFasmCompiler.Create('..\..\..\FasmOnDelphi\fasmw172\fasm');
Fasm:=TRTBFasmCompiler.Create('..\..\..\lib\FasmOnDelphi\fasmw172\fasm');
Src:=Fasm.GenNewSrc;
Src.Text:='use32'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx';
Func1:=src.CompilateAsFunc;
Src.Text:='use32'+sLineBreak+'main:'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx';
Src.RegisterFunction('','main');
Func1:=src.Compilate.Funtion['main'];
if 454<>Func1.Call(TypeInfo(integer),[454],CRTBCallTypeStdCall).AsInteger then
begin
raise Exception.Create('Error in test1');
end;
FreeAndNil(Func1);
FreeAndNil(Src);
FreeAndNil(Fasm);}
FreeAndNil(Fasm);
end;
procedure TRuntimeBuilderTestObject.Test2();
var
Fasm:TRTBFasmCompiler;
Src:TRTBSource;
lib:TRTBLib;
Func1:TRTBFunc;
begin
{Fasm:=TRTBFasmCompiler.Create('..\..\..\FasmOnDelphi\fasmw172\fasm');