problems with converting a byte variable to high and low nib
Mikael S
Posts: 60
Hello
This is my problem:
For example: I have a variable that have a value of 24
variable1 = 24
and when i try to convert this into two other variables with highnib and lownib:
variablehigh = variable1.highnib
variablelow = variable1.lownib
the output of those will be
variablehigh = 1
variablelow = 8
instead of 2 and 4.
What am i doing wrong here? They are declared as byte's but i have also tried to declare them as words.
Thanks for any help!
·
This is my problem:
For example: I have a variable that have a value of 24
variable1 = 24
and when i try to convert this into two other variables with highnib and lownib:
variablehigh = variable1.highnib
variablelow = variable1.lownib
the output of those will be
variablehigh = 1
variablelow = 8
instead of 2 and 4.
What am i doing wrong here? They are declared as byte's but i have also tried to declare them as words.
Thanks for any help!
·
Comments