Assembly in VO

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
robert.pope
Posts: 12
Joined: Tue May 02, 2017 6:14 am

Assembly in VO

Post by robert.pope »

Probably a crazy question, in an area where I have no experience, but I figure I'll ask anyway...

Is there any way to write snippets of assembly in VO?

I need to do a bit of 64 bit arithmetic on some FILETIME structures (https://docs.microsoft.com/en-us/window ... e-filetime). Every forum post I read for C++ says that the C++ runtime has long contained support for 64 bit calculations on a 32 bit process. As far as I'm aware VO uses the C++ runtime (at least we ship it with our app), so I'm wondering if I might be able to directly access some of those instructions.

I know C++ has some support for embedding assembly (https://en.cppreference.com/w/cpp/language/asm), I don't suppose VO has some hidden feature to allow that, without essentially writing a virus?

I'll probably just end up providing the 64 bit arithmetic functions via a C++ DLL taking _WINULARGE_INTEGER structures as parameters. My first thought was to write a 64 bit adder in VO. I figured this might still be an interesting question to have answered, however.

Any other suggestions?
Cheers.
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Assembly in VO

Post by wriedmann »

Hi Robert,
of course you can write a DLL in VO to use in X# or C#.
But be aware that VO is 32 bit only, so this limits your X# application to 32 bit too.
The only possibility to overcome this bitness gap is to build a COM module in VO and use that in X#.
But IMHO the .NET framework has much more possibilities than VO.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
robert.pope
Posts: 12
Joined: Tue May 02, 2017 6:14 am

Assembly in VO

Post by robert.pope »

Hi Wolfgang.

I need it to work the other way around. I'm planning to write a DLL in C++ or some other language to be able to perform arithmetic on 64bit numbers while in a 32 bit world. The C++ runtime apparently supports that. VO will call the DLL to perform any operations on the 64bit numbers.

C++ 64bit subtract for example:

Code: Select all

PCPP_API void sub64(ULARGE_INTEGER &num1, ULARGE_INTEGER &num2, ULARGE_INTEGER &result)
{
	result.QuadPart = num1.QuadPart - num2.QuadPart;
}
VO will interface using the _WINULARGE_INTEGER structure, but can only see it as 2xDWORD values.

Although I'm going with the DLL approach, I was still curious if I could somehow write assembly directly in the VO IDE.

Cheers.
User avatar
wriedmann
Posts: 3748
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Assembly in VO

Post by wriedmann »

Hi Robert,
as long as there is the possibility to call a C/C++ API, you can do that of course also in VO and don't need to write a C++ DLL.
On the VO side you have to deal with the structure as AFAIK there is no datatype for 64 bit numbers - or you can put that in a class and work with that one.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4478
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Assembly in VO

Post by robert »

Robert,
robert.pope wrote:Hi Wolfgang.
Although I'm going with the DLL approach, I was still curious if I could somehow write assembly directly in the VO IDE.
A long time ago there was a project call NASM (Nantucket Assembler) . This was something that Ralf Saborowski did.
This allowed you to store assembly source code in your VO repository and link the assembled code with your VO EXE/DLL.
Maybe you can find information about that in old conference notes or on the web.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
FFF
Posts: 1571
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Assembly in VO

Post by FFF »

IIRC, that should have been at Devcon 98. Was rather cool, it was enough to add a "NASM" in front of you method deklaration...
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

Assembly in VO

Post by Karl-Heinz »

Guys,

in the SDT 04/1999 there´s an article from SABO about NASM.

If anyone is interested, take a look at Frans Wauters VO site and search for filenames like 'NASM'.

https://vo.wautersit.com/pubcavo

btw. There are even patches available for VO 1.0 ;-)

regards
Karl-Heinz
User avatar
Plummet
Posts: 21
Joined: Tue Jan 19, 2016 4:18 pm

Assembly in VO

Post by Plummet »

Hi Robert and anyone else that is interested,
Attached is a version of NASM for VO 2.8 from Frans de Witt (found in my extensive archives).
And no, I have never tried to use it myself.
Good luck :)
Don
Attachments
TS_NASM28.zip
(7.31 MiB) Downloaded 65 times
Post Reply