nested do inside gosub fails simulation

Dr_John

Member
Is there a bug in the simulator?
Are nested Do loops supported?

Prog1 at the end of this post fails. The "loop" command in the man program goes to the "do" in the subroutine.
Prog2 behaves as expected.
Any ideas?
Thanks
John F

'-------Prog1 fails---------------------
prog1:

do
gosub sub1
loop ' this loop goes to the wrong do

stop

'--------
sub1:
b0=0
do
inc b0
loop until b0 =2
return

'--------

'-------works as expected---------
prog2:

do
b0=0
do
inc b0
loop until b0 =2
loop

stop
'--------
 

Dr_John

Member
Good News!
on a real picaxe18x it works as expected
This posting would seem to be therefore a notification of a simulator bug
 

Technical

Technical Support
Staff member
Fixed in the latest patch. Try manually deleting all the files in the /compiler sub-folder and then re-running the patch (if it is already applied - we are aware on some systems the patch has not always been installing correctly).
 
Top