reserved variable names
Peter Verkaik
Posts: 3,956
I thought some names were reserved, such as rb ( == RB ??)
Try this (type exactly as here)
p var byte
main:
· RB = p & rb
· rb = p & rb
· goto main
The first line assembles to
MOV W,RB
AND W,p
MOV RB,w
The 2nd line assembles to
AND RB,p
Any comments?
I use IDE 3.0
regards peter
·
Try this (type exactly as here)
p var byte
main:
· RB = p & rb
· rb = p & rb
· goto main
The first line assembles to
MOV W,RB
AND W,p
MOV RB,w
The 2nd line assembles to
AND RB,p
Any comments?
I use IDE 3.0
regards peter
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
The first line assembled may disturb any VP that alters a RB pin state, if the ISR
starts running after MOV W,RB
Usually 1's are used to not affect bits when ANDing, 0's are used when ORing
(to not interfere with VP's)
which is correctly done by the assembled 2nd line.
(AND RB,p actually is MOV W,p followed by AND RB,w)
The first line assembled must therefore be rejected.
The same applies to OR and XOR.
regards peter