Sentence res mistery
sergioarasa
Posts: 3
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 .
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
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 .
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
pin24 long |< 24
value1 res 1
value2 res 1
and so on.
At least it works this way with my programs.
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!