Shop OBEX P1 Docs P2 Docs Learn Events
assembly help — Parallax Forums

assembly help

fkyfky Posts: 15
edited 2009-10-25 11:43 in Propeller 1
Hi,

Help, can anyone explain the two line of assembly code in the mouse.spin.


receive test _cpin,#$20 wc 'wait indefinitely for initial clock low
waitpne cmask,cmask

_cpin is 24 or 25 , as I see it test _cpin,#$20 is alway not zero nor no c, so what the purpose?

I can see the purpose of the waitpne.


Thanks

Comments

  • BradCBradC Posts: 2,601
    edited 2009-10-23 12:25
    fky said...
    Hi,

    Help, can anyone explain the two line of assembly code in the mouse.spin.


    receive test _cpin,#$20 wc 'wait indefinitely for initial clock low
    waitpne cmask,cmask

    _cpin is 24 or 25 , as I see it test _cpin,#$20 is alway not zero nor no c, so what the purpose?

    I can see the purpose of the waitpne.


    Thanks

    The waitpxx instructions wait on portA or portB based on the state of the carry flag on entry. My guess is the test is to determine if the pin number is 0-31 or 32-. As the propeller I is never likely to have more than 32 io pins then it's probably redundant these days.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    lt's not particularly silly, is it?
  • fkyfky Posts: 15
    edited 2009-10-25 11:43
    Thanks Bradc for your help again. It sure save me a lot of waste time, as I only started about a week ago to test propeller .
Sign In or Register to comment.