PDA

View Full Version : Manipulating Digits



ruijc
- 27th February 2011, 14:48
Greetings all,

I'm trying to manipulate some data but i'm stuck because i ran out of ideas on how to do it.

Basically, i have 3 variables ( V1,V2 and V3 - byte sized ) and their values are only from decimal 0 to decimal 9.

I have another variable ( R - word sized ) and it's value will be from decimal 0 to 999.

What i'm trying to do is to make R's value to be a combination of all V's.

I was trying something like ( but i get a sintax error ):

R dig 0 = V1
R dig 1 = V2
R dig 2 = V3

How can i do this ?

Thanks

Charles Linquis
- 27th February 2011, 15:02
R = Byte3*100 + Byte2*10 + Byte1

ruijc
- 27th February 2011, 15:18
Thank you for the help Charles,

Cant believe how obvious and simple the solution is.

My best regards