Help for Using value of variable

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
M.ali
Posts: 10
Joined: Fri Oct 05, 2018 10:30 am
Has thanked: 3 times

Help for Using value of variable

Post by M.ali »

Hi.
How can use the value stored in variable for addressing or copy in two other variable like the attached file
Example
Example
IMG_20181123_123257.jpg (65.45 KiB) Viewed 2322 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help for Using value of variable

Post by Benj »

Hello,

I would do something like this.

Code: Select all

Counter = 0b01101101
A is equal to counter bit shifted right by four places and then masked with 0b00001111

Code: Select all

A = (Counter >> 4) & 0x0F
B is equal to counter masked with 0b00001111

Code: Select all

B = Counter & 0x0F

M.ali
Posts: 10
Joined: Fri Oct 05, 2018 10:30 am
Has thanked: 3 times

Re: Help for Using value of variable

Post by M.ali »

Thanks, but this is the only way?
Counter value is not already known، What about addressing?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help for Using value of variable

Post by Benj »

Thanks, but this is the only way?
There are many ways to crack a nut, I think I'm missing the bigger picture of what you're actually trying to do.

If it's split a byte up into two nibbles then my code is probably as efficient as you can get.
Counter value is not already known
I simply provided the counter = line of code as example of how to initialise the counter variable in binary if you need to.
What about addressing?
Again I'm not really sure what you mean by this.

Post Reply