Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Script and Inline ASM (https://www.delphipraxis.net/170981-delphi-script-inline-asm.html)

Ryzinski 13. Okt 2012 15:25

Delphi Script and Inline ASM
 
Hello!

I tried

- Pascal Script
- Fast Script
- Script Studio
- IdScript Engine

However none support inline ASM. Is there some library that DOES support it?

glotzer 13. Okt 2012 15:29

AW: Delphi Script and Inline ASM
 
You could try to use Free Pascal to compile your script with a little bit of glue code to pass parameters to it and get the result back. But thats probably not the easiest way.

Ryzinski 13. Okt 2012 15:31

AW: Delphi Script and Inline ASM
 
Maybe with NASM but would have to modify PascalScript?

EDIT: Would this be possible with .NET ?

olee 13. Okt 2012 15:49

AW: Delphi Script and Inline ASM
 
A script-engine with ASM is no script-engine!
What you want is a real leight-weight compiler to support injecting compiled code into your application or the like.

Ryzinski 13. Okt 2012 15:50

AW: Delphi Script and Inline ASM
 
Yes however which compiler?

Medium 14. Okt 2012 01:38

AW: Delphi Script and Inline ASM
 
Since the only well developed and widely known (hence supported) Pascal compiler, with a license that would allow such things, is FreePascal, that would be your choice. However: It is not built for that purpose, and chances are, that you would need to make major adjustments to have it actually inject compiled stuff into a running process (which might even be noticed by AV programs).
An easier way would be, to use FPC to create a DLL with a predefined interface, and use that interface in your host application. But it still goes far further than scripting.

A great scripting tool that DOES on the fly compiling is Lua. The language then isn't pascal anymore, but since you mentioned .NET I gather that would not be an issue. There are at least two nice Lua bindings for Delphi that I have read about, so all to be done is defining the interface. The Lua runtime is free to ship with your program afaik, so it would provide you with all you need.

.NET would not be an easy option from what I know about it. The compiler is not free, so you'd at least need something that creates at least CL and has a fitting license. Having that CL injected into your process is a whole other story. I'd go for Lua. It's well established, well supported, and known as a tool many games even had made large time critical parts of them with it. And on top of that, the Lua language has some pretty neat features :)

Ryzinski 14. Okt 2012 07:29

AW: Delphi Script and Inline ASM
 
There is this for .NET => RemObjects Script 2.0 for .NET

And there is this code.google.com/p/managed-x86/

I guess you can execute asm then via .NET at runtime.

Sir Rufo 14. Okt 2012 08:20

AW: Delphi Script and Inline ASM
 
Crosspost http://stackoverflow.com/q/12873209/1744164


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:09 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz