Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / ASM/DLL related random nonsense.

Author
Message
Neco
16
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 19th Nov 2010 19:35
Originally I did a search on inline ASM and came across some quite old topics, with pretty much an icey response to the idea of inline ASM in DBpro.

Although, I think it was IanM who mentioned at some point having a DLL that gave you the ability to use ASM, "sort of". Was wondering if that DLL is still around and what it did / how it worked?

I'd rather not get into a discussion about how great compilers and their optimizing routines today are.. I've just always been curious about ASM, and wanted to experiment with it within a DB program.. I'm more interested in using bits and pieces of it as opposed to writing whole programs in it.

For anything practical? probably not.. But just because I like exploring new things, I guess. And I'd prefer to do it in tandem with something like DBP, versus C++ or some other language that looks like greek to me anyway (DBP at least, I am beginning to understand).

I also saw there was a thread from a while back, where someone showed how to make a DLL in ASM that could be used in DBPro, so was just curious if anyone ever actually used that for anything useful?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Nov 2010 23:54
Quote: "Was wondering if that DLL is still around and what it did / how it worked?"

It's not around any more, although I believe I still have the source code for it saved away somewhere. It used a library called SoftWire that has since been withdrawn from circulation.

You fed it strings containing Intel-format assembly. You had IIRC 1024 4-byte 'variables' that allowed you to pass information between DBPro and the assembly code. You could register functions from DLLs with the plug-in, making those function accessible from your assembly. Finally, you could create as many fragments of assembly as you wished.

So with what I knew then, it was reasonably powerful, but was a little too unwieldy for general use.

Right now, if you want to experiment with assembly, I'd suggest using the Visual C++ compiler to do it using inline assembler - that gives you all of the higher level functionality of C++, but allows you to drop into assembly when needed:


I use inline assembly in my function pointer plug-in when you call the functions (for doing the fiddly stuff - stack cleanup, parameter passing etc), but the majority of the code in that plug-in is in C++.

As an extra bonus, you can set the C++ compiler to output combined C++ & assembly listings so you can see how the compiler itself compiles your code to machine code (best to see this when compiled in debug mode).

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
Neco
16
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 20th Nov 2010 20:23
I guess I'll have to fiddle with it in VC++ some time in the future, then.

Although I've been thinking about giving MASM a try as well. I suppose the best method would be to install DarkGDK since I believe I got it with the Bonanza pack, if I ever decide to try and make something with DB/C++

Thanks for your reply.

Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 20th Nov 2010 21:10
You could always write machine code into a memblock and then register the memblock pointer with IanM's function pointer commands, and call it like a normal function

[b]
Neco
16
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 21st Nov 2010 04:05
I think that's probably beyond my ability to comprehend at the moment..lol

But if you want to do an example for the hell of it, that would be cool :p

bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 29th Nov 2010 12:14 Edited at: 29th Nov 2010 12:14
Purebasic allows inline assembly, also I think there's a few open source variants of BASIC that allow it. (Purebasic allows you to create DLLs that could be used with DBP, so it may be useful to you)

[center]
Join the TGC Group!
http://tehcodez.groups.live.com
Neco
16
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 3rd Dec 2010 02:41 Edited at: 3rd Dec 2010 02:44
Yeah I was actually looking at that the other day. I've always been interested in PureBasic, although the price is a little off putting at this time, considering my current investment in DBPro.

I do like the fact its Cross Platform

Login to post a reply

Server time is: 2024-11-23 21:16:22
Your offset time is: 2024-11-23 21:16:22