Skip to content

Commit f1f6a41

Browse files
committed
Add final disassembled output
1 parent 24023e8 commit f1f6a41

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

adrs/022-identifier-constants-bug.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,27 @@ First, the functions calling `emitIdent` will now call a function named `makeIde
119119
```
120120

121121
Second, the `SET_GLOBAL` instruction will **not** pop its instruction automatically - at least, for now. In the future, if we commit to assignment being an instruction, and the bytecode implementation is complete, we may revisit this decision.
122+
123+
With these changes, the new disassembled output for the same `for` loop is:
124+
125+
```
126+
20 1 CONSTANT 1
127+
20 3 DEFINE_GLOBAL i%
128+
20 5 GET_GLOBAL i%
129+
20 7 CONSTANT 10
130+
20 9 LE
131+
20 10 JUMP_IF_FALSE 10 -> 34
132+
20 13 POP
133+
20 14 JUMP 14 -> 28
134+
20 17 GET_GLOBAL i%
135+
20 19 CONSTANT 1
136+
20 21 ADD
137+
20 22 SET_GLOBAL i%
138+
20 24 POP
139+
20 25 LOOP 25 -> 5
140+
30 28 GET_GLOBAL i%
141+
30 30 PRINT
142+
40 31 LOOP 31 -> 17
143+
40 34 NIL
144+
40 35 RETURN
145+
```

0 commit comments

Comments
 (0)