Shop OBEX P1 Docs P2 Docs Learn Events
Arghh. INA woes. — Parallax Forums

Arghh. INA woes.

rokickirokicki Posts: 1,000
edited 2006-11-20 07:39 in Propeller 1
I spent about an hour yesterday trackdown a newbie mistake: using

andn ina,pinmask

and couldn't figure out why it wasn't working.

Of course I wanted

andn pinmask,ina

Ina used in the destination field of an instruction does not
actually refer to ina, but rather a "shadow" register "under" ina.

Can we change the assembler so if you use ina in a destination
position, you get an error? And to access the shadow register,
you use a different name, like inashadow or something?

I hate it when we lose orthogonality like this.

Anyway, just my two cents.

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-11-19 21:03
    The compiler will always support using the shadow registers because Chip uses them when space is tight for loop variables (djnz addresses the loop variable in it's destination field). I will communicate your request, but I wouldn't expect there to be a name change since it would require rewritting already released objects. Just remember any Special Purpose Register marked as read-only is just that, and any attempts to write to it will access the shadow RAM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Cliff L. BiffleCliff L. Biffle Posts: 206
    edited 2006-11-20 07:39
    Tom,

    It's not ideally suited for your purposes, but my propasm assembler prevents this. (It bit me too.)
Sign In or Register to comment.