Fasm 1/2 writed
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
unit Unit1;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
DUnitX.TestFramework,RuntimeBuilder;
|
||||
System.SysUtils,DUnitX.TestFramework,RuntimeBuilder,RuntimeBuilder.Fasm,RuntimeBuilder.Types;
|
||||
|
||||
type
|
||||
[TestFixture]
|
||||
@@ -15,8 +16,22 @@ type
|
||||
implementation
|
||||
|
||||
procedure TRuntimeBuilderTestObject.Test1();
|
||||
var
|
||||
Fasm:TRTBFasmCompiler;
|
||||
Src:TRTBSource;
|
||||
Func1:TRTBFunc;
|
||||
begin
|
||||
|
||||
Fasm:=TRTBFasmCompiler.Create('..\..\..\FasmOnDelphi\fasmw172\fasm');
|
||||
Src:=Fasm.GenNewSrc;
|
||||
Src.Text:='use32'+sLineBreak+'pop ecx'+sLineBreak+'pop eax'+sLineBreak+'jmp ecx';
|
||||
Func1:=src.CompilateAsFunc;
|
||||
if 454<>Func1.Call(TypeInfo(integer),[454],CRTBCallTypeStdCall).AsInteger then
|
||||
begin
|
||||
raise Exception.Create('Error in test1');
|
||||
end;
|
||||
FreeAndNil(Func1);
|
||||
FreeAndNil(Src);
|
||||
FreeAndNil(Fasm);
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
Reference in New Issue
Block a user