I have this bf code:
> ++++ ++ @1=6
How do I copy current value (6) in address @1 to the specified address for example address @8
I can do it with this:
> ++++ ++ @1=6
[
>>>> >>>+ @8 increments by 1
<<<< <<<- @1 decrements by 1
]
In this line, @1=0 and @8=6
It overwrites @1 value to the zero while I expect hold value inside @1.
That code is wrong and doesn't even move or zero the 6 in cell 1. The loop is skipped.
To copy arbitrary values does require breaking them down to 0 in order to check the value. The usual workaround is, copy value to two places (destination and a temp location), then move value from temp location back to source location using another loop.
However, copying values a lot is bad for concision. It's often better to move values and use or check them in the process, rather than make copies/use copies/wipe copies.