Hi.
How can use the value stored in variable for addressing or copy in two other variable like the attached file
Help for Using value of variable
Moderator: Benj
- 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
Hello,
I would do something like this.
A is equal to counter bit shifted right by four places and then masked with 0b00001111
B is equal to counter masked with 0b00001111
I would do something like this.
Code: Select all
Counter = 0b01101101
Code: Select all
A = (Counter >> 4) & 0x0F
Code: Select all
B = Counter & 0x0F
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Help for Using value of variable
Thanks, but this is the only way?
Counter value is not already known، What about addressing?
Counter value is not already known، What about addressing?
- 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
There are many ways to crack a nut, I think I'm missing the bigger picture of what you're actually trying to do.Thanks, but this is the only way?
If it's split a byte up into two nibbles then my code is probably as efficient as you can get.
I simply provided the counter = line of code as example of how to initialise the counter variable in binary if you need to.Counter value is not already known
Again I'm not really sure what you mean by this.What about addressing?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel