flat assembler
Message board for the users of flat assembler.

Index > Windows > compile and run asm within lua, with Fasm.dll

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
pber



Joined: 23 Jul 2017
Posts: 24
pber 09 Mar 2021, 16:13
Hi all,
I'm developing ike
Ike is an OO lang which transpiles to Lua 5.4,
a graphic toolkit based on Ultimate++ framework and an Ide.
Ike works only for Win32/64, at now.
The translation is transparent to the user, who sees only Ike code.

Ide implements also a still rudimental debugger.
One nice feature is the possibility of recompile classes at runtime
and see living objects changing their behavior immediately, without
the needing to restart the system.

Maybe someone of you may find my sw interesting
because there is also some support for Fasm, via fasm.dll.

In the ide you can write asm code, compile it at runtime
and call. There is also some example on how to build Lua
modules in assembler and link them in the vm on the flight,
so that asm functions can be called natively by Ike
(that is... by Lua).

This version is 32 bits (so you can code only in "use32" mode),
but the 64 bits is available if someone needs it.
Binaries and sources:
https://drive.google.com/file/d/1qmW_XsiiubCvBcAgLkYghjWzCzDfsdcB/view?usp=sharing


(sadly, recentely I hosted some virus, in my PC.
Now I should be clean, but please check my binaries
with an av before loading).

Regards
Paolo
Post 09 Mar 2021, 16:13
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4020
Location: vpcmpistri
bitRAKE 09 Mar 2021, 21:13
Interesting project. I think Lua and fasm complement each other well.
(Funny, "Ike" is my brother's name. Very Happy)

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 09 Mar 2021, 21:13
View user's profile Send private message Visit poster's website Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 09 Mar 2021, 22:14
Hi bitRAKE,
ike derives from IDE, with hacKing in place of Development.

If you want to integrate with Lua from C/C++ or asm, you must pass through Lua APIs, that are a set of functions with which you can read/write data in/from Lua's vm.

I always thought that passing through Lua's API was an inefficient way of dealing with vm.
Playing with asm I realized how I was wrong: LAPI are very optimized. Rarely asm code run faster. The maximum gain I realized is asm code that runs about 50% faster than Lua-interpreted. In many cases the speed is the same.

With asm you can not make miracles, in terms of speed.
But in some situations you can do even better than C in an easyer way. For eaxmple with continuations, that are very simple if implemented in asm.
Post 09 Mar 2021, 22:14
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 10 Mar 2021, 23:24
Hi
Tried it under w10x64
All paths in latin (d:/dev/)

No gui?
Post 10 Mar 2021, 23:24
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4020
Location: vpcmpistri
bitRAKE 11 Mar 2021, 04:12
pber wrote:
With asm you can not make miracles, in terms of speed.
I don't think projects like AsmJit are looking for miracles, but to reduce the cost of dynamics. Code generation at runtime can also grant flexibility - adapting algorithms to different calling conventions and configurations. Embedding both Lua and fasm would be half the size of AsmJit.

C knows nothing of the machine and furthermore has a very specific execution model. [If performance is the goal:] If one is not able to think outside of that model then there is no point in dropping to asm in most cases, imho.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 11 Mar 2021, 04:12
View user's profile Send private message Visit poster's website Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 16:42
idle wrote:
Hi
Tried it under w10x64
All paths in latin (d:/dev/)

No gui?


I'm trying to find the right manifest for win10...
another attempt is here

https://drive.google.com/file/d/1A8YFAIeWwIs3X9f7Qk4YtlRliUMqHnLK/view?usp=sharing

Can you check it for me?
This version does not link fasm, nor tcc. When I find the way to open my gui in win10 then I'll pack all the rest.

Now I have added TCC and Capstone support.
Post 11 Mar 2021, 16:42
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 16:52
bitRAKE wrote:
Code generation at runtime can also grant flexibility - adapting algorithms to different calling conventions and configurations. Embedding both Lua and fasm would be half the size of AsmJit.


One thing I would try is allowing the extension of ike's parser with new syntaxes, at runtime. I designed it from the beginning with the idea of an extensible parser (ie: keywords can be added/removed at runtime, they are nod hardcoded, and the algo for parsing expression is based on Pratt algo, which allow to modify the logic at runtime.
Post 11 Mar 2021, 16:52
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 17:09
failed
ike.log:
Code:
* D:\dev\ike\ike.exe 11.03.2021 19:08:00, user: kisel

debug LOG
    
Post 11 Mar 2021, 17:09
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 17:54
idle wrote:
failed


did you tested the 004 rel?
https://drive.google.com/file/d/1A8YFAIeWwIs3X9f7Qk4YtlRliUMqHnLK/view?usp=sharing


I hate windows 10 Very Happy

the last manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="Microsoft.Windows.ike.exe"
processorArchitecture="x86"
version="5.1.0.0"
type="win32"/>
<description>ike - development tools</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<!-- Identify the application security requirements. -->
<!-- level can be "asInvoker", "highestAvailable", or "requireAdministrator" -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

with this rc:

101 ICON "ike2.ico"
1 24 "ike.manifest"

any suggestion will be highly appreciated
Post 11 Mar 2021, 17:54
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 20:09
I did
I dislike official too, lite patched,debloated used (i would stay with xp still)
I must say ssd is the reason i had to migrate
Post 11 Mar 2021, 20:09
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 20:13
I was an happy xp user until one year ago...
Post 11 Mar 2021, 20:13
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 20:15
the 004 does not works, because its statically linked with fasm/tcc, but the dlls are missing

the 005 should fix this

https://drive.google.com/file/d/1-xIrWr0l34rv-tc1NOZ-k4El-QbtZId3/view?usp=sharing

...does gui will open?
Post 11 Mar 2021, 20:15
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 20:16
Why do you stick to manifesting
Controls used?

Could you post compiler options?
I'm not familiar with sigwin(?)
Forum member should help
Post 11 Mar 2021, 20:16
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 20:31
v5 - failed under xp.sp3 comp mode
i face same problems running my faforite apps which worked good under xp os (i'm ro reinstall now!!!!)


Last edited by idle on 11 Mar 2021, 20:35; edited 1 time in total
Post 11 Mar 2021, 20:31
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 20:34
pber wrote:
idle wrote:
failed

...
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
...

post you compiler [linking] params
Post 11 Mar 2021, 20:34
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 20:45
failed under XP?
...that's a very bad news.

I don't know the exact linking options, because I'm using the ide of ultimate++, which hides the details of its compiling machinery. And I don't know how to see them.
Post 11 Mar 2021, 20:45
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 20:49
idle wrote:
Why do you stick to manifesting
Controls used?


because in order make an exe working in windows10 it's mandatory to include a manifest file in the exe's resources or as an external file.

(and being me totally ignorant I tryed to copy some manifest and adapt it to my program)
Post 11 Mar 2021, 20:49
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 20:53
there are apps, written in fasm, by me with no manifest and they work
Post 11 Mar 2021, 20:53
View user's profile Send private message Reply with quote
idle



Joined: 06 Jan 2011
Posts: 440
Location: Ukraine
idle 11 Mar 2021, 20:57
in general it is wrong, as we do not concentrate on your app, win10shit instead
Post 11 Mar 2021, 20:57
View user's profile Send private message Reply with quote
pber



Joined: 23 Jul 2017
Posts: 24
pber 11 Mar 2021, 21:28
idle wrote:
there are apps, written in fasm, by me with no manifest and they work


in effect its my hypothesis that all depends from the wrong manifest.
I just verified that in the Win10 of one of my friends Ike started, compiled its initial files and then exited, when instead it should open the gui.

It could be something else...
I'm very frustrated.
Post 11 Mar 2021, 21:28
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.