Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

Assembly in VO 10 Dec 2021 06:04 #20742

  • robert.pope
  • robert.pope's Avatar
  • Topic Author


  • Posts: 5
  • 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 (docs.microsoft.com/en-us/windows/win32/a...-minwinbase-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 (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.

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.pope.

    Assembly in VO 10 Dec 2021 07:31 #20743

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3245
  • 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

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Assembly in VO 10 Dec 2021 08:13 #20745

    • robert.pope
    • robert.pope's Avatar
    • Topic Author


  • Posts: 5
  • 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:
    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.

    Please Log in or Create an account to join the conversation.

    Assembly in VO 10 Dec 2021 08:24 #20746

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3245
  • 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

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Assembly in VO 10 Dec 2021 10:12 #20749

    • robert
    • robert's Avatar


  • Posts: 3293
  • 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

    Please Log in or Create an account to join the conversation.

    Assembly in VO 10 Dec 2021 10:40 #20750

    • FFF
    • FFF's Avatar


  • Posts: 1393
  • 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 (X# 2.14.0.4; Xide 1.33; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    Assembly in VO 10 Dec 2021 12:30 #20752

    • Karl-Heinz
    • Karl-Heinz's Avatar


  • Posts: 774
  • 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'.

    vo.wautersit.com/pubcavo

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

    regards
    Karl-Heinz

    Please Log in or Create an account to join the conversation.

    Assembly in VO 11 Dec 2021 22:17 #20753

    • Plummet
    • Plummet's Avatar


  • Posts: 16
  • 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:

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1