BlitzScript3D

Blitz3D Forums/Blitz3D Programming/BlitzScript3D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Getting Closer to resolving Select...Case. I'm designing it with Nested Select...Cases in mind. What I noticed in your Select...Case opcode segment above
;Select a
    mov   eax,[a]
    mov ebx, eax
is that you use a ebx register which holds the value or pointer to [a]. BlitzScript only uses eax and ecx.

Taking Nested Select...Case into consideration, the ebx register's contents will have to pushed and popped off the stack as needed with each Case comparison otherwise it will be overwritten if nested Select.Case is encountered.
;Select a
    mov   eax,[a]
    push eax

;Case 1
_Flow_2
    mov   eax,1
    pop ebx
    cEQ eax, ebx
    push ebx
    jz  _Flow_3

   {statements}
    jmp _Flow_1
This is completely dependent on how the VM Stack is implemented... I only use one.