gosubs directive error

retepsnikrep

Senior Member
This seems to be giving a strange error

It played up in my Master software today so I deleted everything except a simple loop and the two directives. It worked fine last time I tried it. But now gives syntax error.

Code:
#picaxe 28x1
#gosubs 255

for b0 = 1 to 100
next b0
Gives error

Error: #Directive error - invalid #gosubs value for #picaxe type
Note View/Options is set for 28X1 Picaxe

I am using Editor Version 5.2.6
 

eclectic

Moderator
@peter

Latest Manual 2 , page 9
#gosubs 16/255 Programming Editor Only
Set the gosubs mode (16/255) on X parts.
Example: #gosubs 16

This works, in simulation and on a real 28X1

Code:
#picaxe 28x1
; PE 5.2.6
; A.2 firmware

main:

gosub A0
gosub A1
gosub A2
gosub A3
gosub A4
gosub A5
gosub A6
gosub A7
gosub A8
gosub A9
gosub A10
gosub A11
gosub A12
gosub A13
gosub A14
gosub A15
gosub A17

b0 =b0 +1
sertxd (#b0," ")
outpins = b0
goto main

A0: return
A1: return
A2: return
A3: return
A4: return
A5: return
A6: return
A7: return
A8: return
A9: return
A10:return
A11:return
A12:return
A13:return
A14:return
A15:return
A16:return
A17:return
I'm much too lazy to type any more gosubs. :)

e
 

hippy

Ex-Staff (retired)
#Gosubs doesn't need to be defined for the X1 or X2 parts as the number of Gosubs is fixed. In fact the only current PICAXE it affects is the 18X.
 

westaust55

Moderator
Manual 2 page 9 states:
#gosubs 16/255 Programming Editor Only
Set the gosubs mode (16/255) on X parts.
Example: #gosubs 16
Often on this forum, the term "X parts" is used to refer to X, X1 and X2 parts such as when referring to those PICAXE chips with inbuilt i2c comms capability.
So can see where the confusion may arise.
 
Top