Shop OBEX P1 Docs P2 Docs Learn Events
rol ina, #1 wc — Parallax Forums

rol ina, #1 wc

Lord SteveLord Steve Posts: 206
edited 2008-10-09 22:59 in Propeller 1
Given that pin 31·has already been·configured as an input, what happens when you rotate ina left by one, writing the result to carry?· (Note that ina will be in the d-field of the instruction, not the s-field.)· I guess I want to know if the carry flag will hold the value from pin 31·or not.

Thanks.
·

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-10-09 22:15
    Why not
    test    rxmask,ina      wc 
    
    
    rxmask long %10000000_00000000_00000000_00000000
    
  • Lord SteveLord Steve Posts: 206
    edited 2008-10-09 22:25
    Well I'll be...· If that sets carry then that's great.· (In my brain, the "test" instruction·is associated with the zero flag since that's what most processors are hard-wired to set.)

    Post Edited (Lord Steve) : 10/10/2008 8:02:05 PM GMT
  • TimmooreTimmoore Posts: 1,031
    edited 2008-10-09 22:57
    The carry is set to the odd parity of rxmask & ina. Which is what you want if rxmask only contains 1 bit.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-10-09 22:59
    Since ina is read-only, you cannot use it in the instruction's D field and get the results you expect. What actually gets rotated is its shadow register.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
Sign In or Register to comment.