Page 2 of 2

Re: Packed data in Ruby?

PostPosted: Sat Nov 28, 2015 5:25 pm
by tulamide
martinvicanek wrote:And then you still need to check for a valid mem address in the ASM, which is about what a hop instruction would cost CPU wise.

I don't understand what you mean by "vast overkill"? What the Ruby module does is the same as what Flowstone does in the background.
That valid mem check was introduced for the case that new data of different size is incoming (which makes a new memory block neccessary). Since for this project you will always have 16 bytes no matter what, I can refine the module to always use the same mem-block and just replace the data. So you would only need to check once, when the whole mechanism starts.

Re: Packed data in Ruby?

PostPosted: Thu Dec 03, 2015 5:17 am
by tulamide
I wasn't quite sure wether you wanted me to do it or not, since you didn't react. Also, you didn't sound very optimistic regarding the use of it.

I'm currently at this result: Basically, it works. So, if it runs, it runs. But for some reason I sometimes have to switch the RubyEdit off and back on (even multiple times here and there), before it works. I tried to find the cause for the last two days, but didn't succeed. Whatever I change in code, this behavior stays.

I publish it in this version because you can already try it. Just look inside the module in the RubyEdit info pane after you loaded the schematic and triggered "create mem block". If you read "QuickWatch = 6.0", everythings working. If you read 0.0 instead of 6.0, you have to switch the RubyEdit off and on, trigger "create mem block", and repeat this until you read 6.0. From then on it works and you can start changing the floats (use "update mem block" after the changes).

If your tests reveal that you would like to use it, tell me and I will continue to solve the issue. If not, I'll keep it in this stage.

Oh, and if anyone finds the issue - don't hesitate to point me to the stupid mistake I made!

Re: Packed data in Ruby?

PostPosted: Thu Dec 03, 2015 10:13 am
by martinvicanek
Thanks tulamide, I really appreciate your help. It is a pity that we have no easier and more reliable way to manage memory. Even if your solution does work with a little help by the user, I still consider it too much overhed in comparison with a straight assignment in stage0. So for me you can leave it at that.
Once again, thank you for your help. Believe it or not, by studiyng your examples I am finally beginning to write my own stuff in Ruby. :)

Re: Packed data in Ruby?

PostPosted: Thu Dec 03, 2015 10:56 am
by tulamide
I agree when it comes to SSE-compatible memory blocks. It should be easier (in C/C++ there's a simple function call that you just give the size as parameter). The difference, as far as I understood is, that with stage0 you can't change the floats at runtime, right? Because with this Ruby solution (when it's working reliable) you can.

But I would prefer a solution all in assembler as well, if it is doable.

And nice to see that I could push you to the bright side of programming languages ;)