Shop OBEX P1 Docs P2 Docs Learn Events
Only works few seconds — Parallax Forums

Only works few seconds

sergioarasasergioarasa Posts: 3
edited 2008-09-14 05:52 in Propeller 1
Hello!

This program only works ok a few minutes.

Some body can tell me why?

Thank you very much.

Sergio.
CON
· _CLKMODE = XTAL1 + PLL8X
· _XINFREQ = 6_000_000
VAR
· long stack[noparse][[/noparse]40]
·
PUB Principal
· cognew(@terminal, @stack)
DAT
terminal
······· org 0
bucle··mov dira, pin24
······· mov outa, pin24
······· mov time,delay
······· add time,cnt
······· waitcnt time,delay
······· mov outa, #0
······· waitcnt time,delay
······· jmp bucle
'
pin24 long |< 24
time long 0
delay long 6_000_000
······· fit 496

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-12 13:48
    The last instruction must be "jmp #bucle"
  • AleAle Posts: 2,363
    edited 2008-09-12 14:01
    Sergio,

    for testing purposes of assembler there are several options... you can simulate the code or you can step through it using one of the multiple options. See here : propeller.wikispaces.com/Debuggers+and+Emulators


    All instructions have a source and destination part. The destination is always a position in cog's memory, the source can either be a position in cog's memory (where the value is stored) or the value itself (call literal) when it is between 0 and 511. In the case of the jump, the destination address is known at compile time, so a literal is used, denoted by the use of the '#' symbol. But an indirect addressing mode can be used, denoted by the lack of a '#' symbol, like in your example. Then, it is not working because it is using the value stored at bucle instead of the address itself.

    Bienvenido a los foros. De d
  • sergioarasasergioarasa Posts: 3
    edited 2008-09-13 23:20
    Thank you very much Mike and Ale for your fast reply.

    Now my error·seems to me·obvious but i spend time enough to turn me crazy lol.gif

    I am from Barcelona, (Spain). Please excuse my poor english.

    Thank you again.



    Sergio.
  • AleAle Posts: 2,363
    edited 2008-09-14 05:52
    Have a look at this:

    propeller.wikispaces.com/Common+Assembler+Bugs

    From time to time, that happens,
Sign In or Register to comment.