FasmOnDelphi Update + Fasm Implementation Update

This commit is contained in:
2018-04-12 22:14:08 +03:00
parent 0e25c2e70f
commit 46952fd74d
5 changed files with 64 additions and 24 deletions

View File

@@ -21,13 +21,16 @@ procedure TRuntimeBuilderTestObject.Test1();
var
Fasm:TRTBFasmCompiler;
Src:TRTBSource;
Module:TRTBModule;
Func1:TRTBFunc;
begin
Fasm:=TRTBFasmCompiler.Create('..\..\..\lib\FasmOnDelphi\fasmw172\fasm');
Src:=Fasm.GenNewSrc;
Src.Text:='use32'+sLineBreak+'main:'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx';
Src.Text:='use32'+sLineBreak+'main:'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx'+sLineBreak+'Pmain dd 0';
Src.RegisterFunction('','main');
Func1:=src.Compilate.Funtion['main'];
Src.Register('','Pmain',TypeInfo(pointer));
Module:=Src.Compilate;
Func1:=Module.Funtion['main'];
if 454<>Func1.Call(TypeInfo(integer),[454],CRTBCallTypeStdCall).AsInteger then
begin
raise Exception.Create('Error in test1');