Shop OBEX P1 Docs P2 Docs Learn Events
Sentence res mistery — Parallax Forums

Sentence res mistery

sergioarasasergioarasa Posts: 3
edited 2008-09-19 14:34 in Propeller 1
Hello friends,

The first program works properly, (turn on a led in port 24). The second program don't works.·The ·only diference is one "res sentence".

Can some body tell me why?. I don't understand nothing shakehead.gif .

Thank you very much
Program 1 (works OK)

CON
· _CLKMODE = XTAL1 + PLL8X
· _XINFREQ = 6_000_000
PUB start
· cognew(@program, 0)
DAT
program
······· org 0
······· mov dira,pin24
······· mov outa,pin24
:loop·· jmp #:loop
······· value1 res 1
······· value2 res 1
······· value3 res 1
······· value4 res 1
······· value5 res 1
······· value6 res 1
······· pin24 long |< 24
······· fit 496
Program 2 (don't works---value7 added)

CON
· _CLKMODE = XTAL1 + PLL8X
· _XINFREQ = 6_000_000
PUB start
· cognew(@program, 0)
DAT
program
······· org 0
······· mov dira,pin24
······· mov outa,pin24
:loop·· jmp #:loop
······· value1 res 1
······· value2 res 1
······· value3 res 1
······· value4 res 1
······· value5 res 1
······· value6 res 1
······· value7 res 1
······· pin24 long |< 24
······· fit 496

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-09-19 11:48
    I am not sure but why but perhaps it is because you have your initialized variables after the res variables. Try swapping the two around like

    pin24 long |< 24
    value1 res 1
    value2 res 1
    and so on.

    At least it works this way with my programs.
  • BradCBradC Posts: 2,601
    edited 2008-09-19 14:34
    sergioarasa said...
    Hello friends,


    The first program works properly, (turn on a led in port 24). The second program don't works. The only diference is one "res sentence".



    Can some body tell me why?. I don't understand nothing shakehead.gif .


    Erik is dead on the money. It's luck that one of them works at all.
    Place your res after your code/data and she'll be apples.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pull my finger!
Sign In or Register to comment.