Shop OBEX P1 Docs P2 Docs Learn Events
reserved variable names — Parallax Forums

reserved variable names

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2005-04-12 15:53 in General Discussion
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
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-12 15:33
    I just verified it with the 1.2 (candidate) SX/B compiler. It's an SX/B thing, not and IDE thing.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-04-12 15:53
    (SX/B of course)

    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
Sign In or Register to comment.