REV command

aeg

New Member
According to the Picaxe Manual 2...

...to reverse the 8 bits of %10110000 (to %00001101) the command would be
let b1 = %00001101 REV 8


In an attempt to form a better understanding of this I tried the following test program but a syntax error is reported on line 3 when I try to simulate it...

start:
for b0 = 1 to 8
let b1 = %00001101 REV b0
let pins = b1
pause 1000
next b0
goto start

Can anyone explain?

aeg
 

westaust55

Moderator
REV command - for X1 and X2 parts only

Which PICAE are you using?

I could not see a problem so cut and paste into my PE and i does not give any errors when I have the 28X1/40X1 selected.


From the manual 2, note:
The X1 and X2 parts also support
<< ; shift left
>> ; shift right
*/ ; multiply (returns middle word of result)
DIG ; return the digit value
REV ; reverse a number of bits
 
Last edited:

aeg

New Member
Thanks for pointing out that this is only for X1 and X2; I hadn't noticed that but I did try all flavours of PICAXE and found a different error message on 28X1...
"Beta - abs not currently simulated"

I am running version 5.2.0 of Programming Editor which is not shown as being a beta version and is the latest full download according to the website.

However, I had hoped that the command might have been available for the 18 pin chips!


aeg
 

hippy

Ex-Staff (retired)
In an attempt to form a better understanding of this I tried the following test program but a syntax error is reported on line 3 when I try to simulate it...
REV is only available for the 28X1/40X1 and a syntax error is generated if 28X1/40X1 has not been selected.

Using Programming Editor 5.2.1 simulation with 28X1 selected I get a "Beta - abs not currently simulated" report. This appears to be a typo and a limitation of the simulator package included with 5.2.1; I will pass the information along.

This should not affect operation of the REV operator on a physical PICAXE chip.
 

westaust55

Moderator
REV command and PE version

Try installing the PE V5.2.1 patch available for download from the Rev Ed website.

While obviously will not work on the non X1/X2 parts, I do not get an error when selected to the 28X1 PICAXE
 

hippy

Ex-Staff (retired)
Syntax check should pass with 28X1/40X1 selected, code using REV should work with a physical chip; the current issue is only when simulating.
 
Top