ASM with PropBasic
Hi,
I can't get ASM Task to work with PropBasic.
In spin I have
I can't get ASM Task to work with PropBasic.
In spin I have
' ASM Test File, runs in own Cog ' ASM_TEST, fgv 21.09.2011 CON _clkmode = xtal1 + pll16x _xinfreq = 6_250_000 PUB Main cognew(@toggle,0) DAT org 0 Toggle mov dira, IOP mov time, cnt add time, #9 :loop waitcnt time, delay xor outa, IOP jmp #:loop '--------------------------- IOP long %1 delay long 5_000_000 time res 1That code runs as expected, but in PropBasic this code won't work:
PROGRAM Main Main: Cogstart Tog do loop END ' ----- TASK Code ------------------------------------------------------ TASK Tog ASM org 0 Entry mov dira, IOP mov time, cnt add time, #9 :loop waitcnt time, delay xor outa, IOP jmp #:loop '--------------------------- IOP long %1 delay long 5_000_000 time res 1 ENDASM ENDTASKAnybody sees why? I'm out of ideas....
Comments
Don't use ORG or define variables in ASM. Declare variables as PropBasic variables.
You can't use RES in ASM...ENDASM. When spin sees the RES it doesn't set the value of any variables after it.
Bean
that helped a lot!
Fried