Feature request : 31 Oct 2022 : Please give PE6 the ability to edit and simulate multi #slot code.

Buzby

Senior Member
#Slots are useful, but PE6 can't create more than one, or simulate them. ( At least, I've not found a way to make it work. )

The editor in PE6 won't allow the use of more than one #Slot directive, which seems a bit of a limitation.
It is not unreasonable to write code for two slots in one .bas file. Slots are not only useful for when slot 0 gets full, they can be used for other things as well.

( Now I know this is a 'Feature request', and not likely to be even acknowledged, even less likely to be implemented, but if you don't ask you have no chance of getting. )

The original request for this feature was over 10 years ago, in Jan 2012, in the Wishlist - https://picaxeforum.co.uk/threads/programming-editor-wishlist.20188/#post-192021 - so it's not a new request, Rev-Ed knew about it before PE6 was released. Why did they choose not to make it happen ?

It doesn't seem like it would be a major effort to implement this.
All the tools are already in PE6 ( Editor, Pre-processor, Simulator ), they just need to be able to handle multiple slots.
It could be done by a kind of 'context switching', to switch the tools to a different slot, or it could be done by having multiple instances of the tools, each dedicated to a particular slot.

Cheers,

Buzby
 

Buzby

Senior Member
Now I know this is a 'Feature request', and not likely to be even acknowledged, even less likely to be implemented, but if you don't ask you have no chance of getting.
A year later, and my words are proved !

If someone is struggling to implement multi-slot, I suggest that Rev-Ed upload the code to ChatGPT ( the paid version ) and ask it to do the changes. Then the task is one of testing and tweaking, a lot easier than starting from scratch.
 

Buzby

Senior Member
Is it likely we will ever get multi-slot running in the PE simulator ?.

From the PE6 intro document - "By moving to a modern development platform our software developers can also now work far more productively. Furthermore the entire PICAXE software architecture has simultaneously been moved over to a much more modular system, allowing future additions and new features (e.g. new PICAXE chip generations or extra code assistance wizards) to be added much more rapidly."

In a 'much more modular system' it should be reasonably easy to implement multi-slot. Also, it's not as complex as I first thought.

The simulator runs the code a line at a time, and the PICAXE runs a line at a time, no matter what #slot it is in. ( This is not the same as 'tasks', where the PICAXE 'appears' to be running multiple lines at the same time, each in a different task. )

Because it just one line at a time, it should be fairly easy to execute #slot code. In fact, I suspect most of what's needed for multi-slot simulation could be implemented in the pre-processor.

On the first pass the PP records the location of each #slot directive, then on the second pass these locations are added to the #run directive. ( Or maybe a table is made of #run / #slot locations )

Now, if the simulator sees a #slot it just ends the prog, like a 'stop'. But if it sees a #run then it resets the stacks etc., and jumps to the location associated with the #run.

This is just a rough idea. I'm not familiar with exactly how the simulator executes code. However, no matter how the simulator is built it should not be difficult to add some new behaviors. This is, after all, just a 'new feature', exactly what PE6 promised to make easy to add !.

Cheers,

Buzby
 
Top