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.

John J.

I'm totally amazed. I sure could have used this insight with BlitzScript3D initially. I can visualize the cover of your book entitled: "How to write a Scripting Engine in 7 days with Blitz3D."

I create some weird opcodes for handling labels and jumps. Your opcode output is very elegant and holds true to nature. I'm gonna leave things in that area alone for now, but, i will definately take a second look at it in the future. At least for optimizing purposes.

I getting used to looking at BlitzScript3D code now. Its time to start adding these constructs:)

Frank Taylor's Distorted Opcode for Select...Case

;Select expression
mov eax,<expression>
push eax
jz start
 
;dummycase
 
;Case <expression>
label_next
mov eax,<expression>
seq eax  ;auto pops stack -> ecx and compares
push ecx ;push ecx back to stack
jz next
;statements
jmp last
 
;Case expression$
label_next
mov eax,<expression$>
seq eax str ;auto pops stack to ecx and compare strings
push ecx ;push ecx back to stack
jz next
;statements
jmp last

;Default
label_next
;statements

;EndSelect
label_last