Add iteration assembly concept

This commit is contained in:
Andrew Morris
2023-05-25 15:19:05 +10:00
parent 205f5efa02
commit a20f71a440

View File

@@ -0,0 +1,23 @@
export @_anon0 {}
@_anon0 = function() {
mov 0 %sub
mov [1, 2, 3] %nums
sub %nums $SymbolIterator %_iter0
jmp :for_continue0
for_test0:
jmpif %_done0 :for_end0
op+ %sub %_value0 %sub
for_continue0:
next %_iter0 %_iter_res0
unpack_iter_res %_value0 %_done0
jmp :for_test0
for_end0:
mov %sum %_tmp0
mov %_tmp0 %return
}