for-loops - break and continue
Bwain| No Comments »I *think* I have for-loops fully working. I can’t come up with an expression that breaks it. So the last two features to implement are ‘break’ and ‘continue’. Continue seems easier with the current architecture. Just need to disable the proc until the current loop finishes. ‘break’ seems a bit more difficult. Break will permenantly disable a proc for the duration of the current loop. I’m not certain that the current architecture will support this.
In any case, it will be easier to test continue/break after implementing if/then/else.
- exec test -> boolTmp
- deact neg threads
- if (boolTmp==all false) then {jmp else-clause:}
- execute if section
- else-clause:
- flip boolTmp. deact neg threads, act pos threads
- if (boolTmp==all false) then { jmp endif:}
- execute else section
- endif:
- activate neg threads
So we need 3 assembly commands. We should be able to generate all three from a template.
- deactivate threads if tmp = false. branch if all false
- deactivate/activate threads if tmp = true/false. branch if all true
- activate threads if tmp=false
Very good guess. I was testing the vex compiler, it seems to do something very similar. 1,2,3 are if,else,endif, respectively.
I’ve got if-then-else working. I keep having to come up with ways to break it, but its passing so far….


