Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C++
Script Assembler in C++: What operations should I implement?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Morten Aune Lyrstad, post: 1525684"] You seem to have some knowledge about this. What do you think about this as a translated 'for' loop? My virtual machine can handle this now. It should be the equivalent of for (int i = 0; i < 10; i++) { } -------------------- SAGA code -------------------- push [addr0] ;\ push 10 ;} Store 10 into the first variable store ;/ push [addr1] ;\ push 0 ;} Store 0 into the second variable store ;/ loopStart: push [addr1] ;} Load the second variable load ;/ push [addr0] ;} Load the first variable load ;} lessi ; Compare integer. Is A less than B? jmpzero endLabel ; No, exit loop push [addr1] ; Push address of second variable push [addr1] ;} Load the second variable load ;/ push 1 ;} Add 1 to the value addi ;/ store ; Store into the second variable jmp loopStart ; Start loop over endLabel: end ; End function ------------------ SAGA code end ------------------ I really appreciate your help. Yours, Morten Aune Lyrstad [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C++
Script Assembler in C++: What operations should I implement?
Top