Skip to content

Commit d5967ad

Browse files
committed
Use value->bits to avoid a bug in example code.
1 parent 3d426f2 commit d5967ad

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

www/notes/hustle.scrbl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ So for example the following creates a box containing the value 7:
375375

376376
@#reader scribble/comment-reader
377377
(racketblock
378-
(seq (Mov 'rax (arithmetic-shift 7 imm-shift))
378+
(seq (Mov 'rax (value->bits 7))
379379
(Mov (Offset 'rbx 0) 'rax) ; write '7' into address held by rbx
380380
(Mov 'rax 'rbx) ; copy pointer into return register
381381
(Or 'rax type-box) ; tag pointer as a box
@@ -396,9 +396,9 @@ Pairs are similar. Suppose we want to make @racket[(cons 3 4)]:
396396

397397
@#reader scribble/comment-reader
398398
(racketblock
399-
(seq (Mov 'rax (arithmetic-shift 3 imm-shift))
399+
(seq (Mov 'rax (value->bits 3))
400400
(Mov (Offset 'rbx 0) 'rax) ; write '3' into address held by rbx
401-
(Mov 'rax (arithmetic-shift 4 imm-shift))
401+
(Mov 'rax (value->bits 4))
402402
(Mov (Offset 'rbx 8) 'rax) ; write '4' into word after address held by rbx
403403
(Mov 'rax rbx) ; copy pointer into return register
404404
(Or 'rax type-pair) ; tag pointer as a pair

0 commit comments

Comments
 (0)