Understanding NOB Number of Bits

dennis

Member
Manual 2 page 24 explains that the NOB operator counts the number of bits set. I have the simulator set to 20X2 and just get 15 for b2 and b3 below instead of the expected 4

Code:
main:
b1=%10000111

b2=NOB b1

b3=NOB %11110000

goto main
Is this a bug or another of my gross errors !

Dennis
 

BeanieBots

Moderator
This would appear to be a recently introduced bug.
I've just tried it (in simulator) and get the same results as you. 15 instead of the expected 4.
This is true for both 20X2 and 28X2.

I have used the NOB command in this project.
http://www.picaxeforum.co.uk/showthread.php?t=12505

It certainly gives the correct values on a real 28X2 and I'm fairly certain it also gave the correct values in 28X2 simulation at that time. (can't remember PE version).
 

sierrasmith71

New Member
I get same result

I have PICAXE PE version 5.2.7 (set to 28X2) and I get 15 as a result for any number of bits other than 0 which does return a 0 ,--- running the same code.


David Garrison
 

dennis

Member
Thanks BeanieBots Good to kow that it works on the real thing. Do I need to make a bug report or will Technical pick this up ?

Dennis
 

Technical

Technical Support
Staff member
Thanks for the report, this is related to the fact that 5.2.7 can't divide correctly!
The new release will be out soon.
 
Top