Skip to content

Commit 21fefaa

Browse files
committed
Use Global in Jig and Mug examples.
1 parent 04b3464 commit 21fefaa

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

www/notes/jig.scrbl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ Here's what this code will compile to, roughly:
210210
@#reader scribble/comment-reader
211211
(ex
212212
(asm-interp
213-
(seq (Label 'entry)
213+
(seq (Global 'entry)
214+
(Label 'entry)
214215

215216
;; calling (f 100), so set up return address,
216217
;; push argument, then jump
@@ -419,7 +420,8 @@ We can modify the code to embody these ideas:
419420
@#reader scribble/comment-reader
420421
(ex
421422
(asm-interp
422-
(seq (Label 'entry)
423+
(seq (Global 'entry)
424+
(Label 'entry)
423425

424426
;; calling (f 100), so set up return address,
425427
;; push argument, then jump
@@ -535,7 +537,8 @@ call:
535537
@#reader scribble/comment-reader
536538
(ex
537539
(asm-interp
538-
(seq (Label 'entry)
540+
(seq (Global 'entry)
541+
(Label 'entry)
539542

540543
;; TAIL calling (f 100),
541544
;; no args to pop

www/notes/mug.scrbl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ We can run it just to make sure:
8282
@ex[
8383
(unload/free
8484
(asm-interp
85-
(seq (Label 'entry)
85+
(seq (Global 'entry)
86+
(Label 'entry)
8687
(Mov 'rbx 'rdi)
8788
(compile-string "Hello!")
8889
(Ret))))
@@ -143,7 +144,8 @@ following:
143144
@ex[
144145
(unload/free
145146
(asm-interp
146-
(seq (Label 'entry)
147+
(seq (Global 'entry)
148+
(Label 'entry)
147149
(Lea 'rax 'hi)
148150
(Or 'rax type-str)
149151
(Ret)
@@ -191,7 +193,8 @@ instruction, instead computing that type tagging at link time:
191193
@ex[
192194
(unload/free
193195
(asm-interp
194-
(seq (Label 'entry)
196+
(seq (Global 'entry)
197+
(Label 'entry)
195198
(Lea 'rax (Plus 'hi type-str))
196199
(Ret)
197200
(Data)
@@ -225,7 +228,8 @@ efficient to evaluate string literals. We could replace the old
225228

226229
(unload/free
227230
(asm-interp
228-
(seq (Label 'entry)
231+
(seq (Global 'entry)
232+
(Label 'entry)
229233
(compile-string "Hello!")
230234
(Ret))))
231235
]

0 commit comments

Comments
 (0)