Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

obtain pointer to variable in assembler

DSP related issues, mathematics, processing and techniques

obtain pointer to variable in assembler

Postby KG_is_back » Sun Mar 04, 2018 1:07 am

I have found a way to obtain pointer to a variable in assembler code. Under normal circumstances, access to a local variable is restricted to the same ASM/code component and you can't pass it around. I have discovered a workaround that extracts the memory address (or a pointer) to any variable or array you choose.

This may come handy, expecially when you need to pass arrays between ASM components. It may also allow you to pass pointers to an array to a function from the ASM component - coupled with the machine code injection discovered by MyCo this could allow some pretty useful things. For example, one may execute FFT on various arrays, simply by having the FFT machine code in a string in ruby and calling it from ASM component.
Attachments
pointerToVariable.fsm
(1.2 KiB) Downloaded 1286 times
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: obtain pointer to variable in assembler

Postby martinvicanek » Sun Mar 04, 2018 11:49 am

Hey that's interesting. I wonder: is there an advantage over the MemAddress prim? If your new method proves more stable, then I can see some applications like a fast wave reader, fast lookup tables etc. Wonder if this would also work in poly?
User avatar
martinvicanek
 
Posts: 1328
Joined: Sat Jun 22, 2013 8:28 pm

Re: obtain pointer to variable in assembler

Postby adamszabo » Sun Mar 04, 2018 12:49 pm

In the new version this will be very easy to do and it works in poly so you can make fast wave readers. ;)
Attachments
mem.jpg
mem.jpg (62.35 KiB) Viewed 16470 times
adamszabo
 
Posts: 667
Joined: Sun Jul 11, 2010 7:21 am

Re: obtain pointer to variable in assembler

Postby KG_is_back » Sun Mar 04, 2018 1:24 pm

x64 assembler!!!!! :drolling:
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: obtain pointer to variable in assembler

Postby francoisreme » Mon Mar 05, 2018 9:52 pm

I'll buy it ten times.
francoisreme
 
Posts: 29
Joined: Wed Feb 15, 2017 4:01 pm


Return to DSP

Who is online

Users browsing this forum: No registered users and 61 guests