Shop OBEX P1 Docs P2 Docs Learn Events
Help with assembler (Resolved, thanks) — Parallax Forums

Help with assembler (Resolved, thanks)

OnniOnni Posts: 7
edited 2008-04-28 21:05 in Propeller 1
I simply don't get it.

I am trying to write a servo pulse width reader in assembler. So I can send steering·commands to the propeller from my RC-controller.

This little piece of code works:
waitpeq Mask,    Mask
mov     Data0,   cnt
waitpne Mask,    Mask
mov     Data1,   cnt

And then I output (Data1 - Data0) in Spin in another COG to a terminal and se the values change from 1.2 - 1.7mS·when I move the stick.
Great!

But I really want a time out in the waitpeq. If the·transmitter is turned off the signal goes flatline and I want to do other things in this COG.
So I try to break the waitpeq in to pieces so I can insert time out code:

ch0                     test    Mask,           ina         wz               
             if_z       jmp     ch0                                 
                        mov     Data0,          cnt                                                               
ch1                     test    Mask,           ina         wz            
             if_nz      jmp     ch1              
                        mov     Data1,          cnt

But this code doesn't work! Why?

/Onni


Post Edited (Onni) : 4/28/2008 9:15:23 PM GMT

Comments

  • Lord SteveLord Steve Posts: 206
    edited 2008-04-28 20:52
    Because you need a '#' in front of your labels in the JMP instructions?

    ch0                     test    Mask,           ina         wz               
                 if_z       jmp     #ch0                                 
                            mov     Data0,          cnt                                                               
    ch1                     test    Mask,           ina         wz            
                 if_nz      jmp     #ch1              
                            mov     Data1,          cnt         
    
  • OnniOnni Posts: 7
    edited 2008-04-28 21:05
    Yes, you are right!

    And the sad part is that I knew that [noparse]:)[/noparse]

    Thanks!
Sign In or Register to comment.