Bits manipulation
Posted: 23 Mar 2017 13:06
Hi All,
Is there a way to set multiple bit in a single instruction line?
Example:
dim TEMP as Byte
dim X as sbit at temp.b0
dim Y as sbit at temp.b1
dim Z as sbit at temp.b2
dim A as sbit at temp.b3
now, if i want to set four bits, i have to do that:
X = 1
Y = 1
Z = 1
A = 1
Then the assember output will address the RAM four times wasting a lot of time and space.
I wonder if there is a possibility to do something like that:
X+Y+Z+A = 1
or
X.Y.Z.A = 1
that would even mean that the assembler will put a single calculated value during the compiling phase.
Thank You
Alessandro
Is there a way to set multiple bit in a single instruction line?
Example:
dim TEMP as Byte
dim X as sbit at temp.b0
dim Y as sbit at temp.b1
dim Z as sbit at temp.b2
dim A as sbit at temp.b3
now, if i want to set four bits, i have to do that:
X = 1
Y = 1
Z = 1
A = 1
Then the assember output will address the RAM four times wasting a lot of time and space.
I wonder if there is a possibility to do something like that:
X+Y+Z+A = 1
or
X.Y.Z.A = 1
that would even mean that the assembler will put a single calculated value during the compiling phase.
Thank You
Alessandro