Page 1 of 1

Is it possible to use the mem adress ?

PostPosted: Sat Sep 17, 2022 2:19 pm
by Tepeix
After hours of trying, i ask the question, is the mem address usable in some way ?

I could easily make a code that read or write the mem.
The true problem is when you save the schematic with this code connected.
(you better have to save it unconnected in another file !)

It almost always crash on load.
The only exception was to use a timer to wait a little before to read. It worked few time.
Then i try to wait less sample and now it crash every time on load whatever the timing...

What happen here ?

Re: Is it possible to use the mem adress ?

PostPosted: Sat Sep 17, 2022 5:01 pm
by adamszabo
When you use a mem input in the assembly you have a few options. So lets say you have "memrefin mem; " this will create the "mem" memory input.

Here are your options:
0 = Address
1 = Size
2 = Floats
3 = Channels
4 = [fLimit,fLimit]
5 = [fLimit,fLimit]

when the memory is not loaded its size is 0, so you can use that to skip a code thats not loaded to prevent a crash. So you can write:

cmp mem[1],0; // we check if the memory size is 0, and if it is, skip the mem code
je end;

//your code here

end:

Once the memory is assigned it will now have a size and address and then it can safely load

Re: Is it possible to use the mem adress ?

PostPosted: Sat Sep 17, 2022 7:40 pm
by Tepeix
Thanks for the response !)
But i'm on 3.6.. So i don't have memrefin..

Will try to load the alpha someday.. But the slack have disappear.. Is there another place now ?

Hum doing some more research, now i suspect the array to mem and mem address prim to have some problem with loading in my version.. I use a bunch of code to detect if the address is not 0.
But i think, it's like the mem address keep the last address, when the array to mem create a new one...

Re: Is it possible to use the mem adress ?

PostPosted: Sun Sep 18, 2022 12:53 am
by Tepeix
No more crash for now, but i'm a little paranoid after getting so much..

My big error i suppose was to use the text prim to the array to mem.
In my version 3.6 it almost always crash on load, even if i disconnect the text.

With an array prim it's ok.

Re: Is it possible to use the mem adress ?

PostPosted: Mon Sep 19, 2022 2:28 pm
by Tepeix
Hum.. It work better without the text and i also try the mem create.

But whatever i do to transform the address, a crash finish to occur when i load a new address..
It's like some address are not well decoded.
Will investigate more..
Maybe a timer to not load directly the new address, maybe something wrong in the float/int translation..

Re: Is it possible to use the mem adress ?

PostPosted: Tue Sep 20, 2022 10:29 pm
by Tepeix
hum, thinking more about it, my new instability maybe come from the way i try to change the mem.
Creating a new one, as green are involved, the code could try to read a mem that no longer exist while it doesn't had receive the new address change...

Maybe a system where first the code know that it must stop to read or write then a new mem creation would solve this...