File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ $(course):
1717 $(course ) .scrbl
1818 mkdir -p $(course ) /code/
1919 cd notes ; \
20- tar -c ` git ls-files -X .gitignore intro abscond blackmail con dupe extort fraud hustle` | \
20+ tar -c ` git ls-files -X .gitignore intro abscond blackmail con dupe extort fraud hustle iniquity ` | \
2121 (cd ../main/code ; tar -x) ; cd ../..
2222
2323clean :
Original file line number Diff line number Diff line change 1515@include-section{notes/grift.scrbl}
1616@include-section{notes/hustle.scrbl}
1717@include-section{notes/iniquity.scrbl}
18+ @include-section{notes/jig.scrbl}
1819@;{
1920@include-section{notes/5.scrbl}
2021@include-section{notes/6.scrbl}
Original file line number Diff line number Diff line change 3131 [`(neg ,a1)
3232 (string-append "\tneg " (arg->string a1) "\n " )]
3333 [`(call ,l)
34- (string-append "\tcall " (arg ->string l) "\n " )]
34+ (string-append "\tcall " (label ->string l) "\n " )]
3535 [`(push ,r)
36- (string-append "\tpush " (reg->string r) "\n " )]
36+ (string-append "\tpush " (reg->string r) "\n " )]
37+ [`(pop ,r)
38+ (string-append "\tpop " (reg->string r) "\n " )]
3739 [l (string-append (label->string l) ":\n " )]))
3840
3941(define (opcode2? x)
5355;; Any -> Boolean
5456(define (reg? x)
5557 (and (symbol? x)
56- (memq x '(rax rbx rcx rsp rdi rip))))
58+ (memq x '(rax rbx rcx rdx rsp rdi rip rbp rsi r8 r9 r10 r11 r12 r13 r14 r15 ))))
5759
5860;; Reg -> String
5961(define (reg->string r)
7476 (display
7577 (string-append "\tglobal " (label->string g) "\n "
7678 "\tdefault rel\n "
77- "\textern " (label->string 'error ) "\n "
79+ "\textern " (label->string 'error ) "\n "
80+ "\textern " (label->string 'plus_two ) "\n "
7881 "\tsection .text\n "
7982 (asm->string a)))))
Original file line number Diff line number Diff line change 1818(define imm-type-bool (arithmetic-shift #b01 result-shift))
1919(define imm-type-char (arithmetic-shift #b10 result-shift))
2020(define imm-type-empty (arithmetic-shift #b11 result-shift))
21-
22-
23-
2421(define imm-val-false imm-type-bool)
25- (define imm-val-true (bitwise-ior (arithmetic-shift 1 (add1 imm-shift)) imm-type-bool))
22+ (define imm-val-true
23+ (bitwise-ior (arithmetic-shift 1 (add1 imm-shift)) imm-type-bool))
2624
2725;; Allocate in 64-bit (8-byte) increments, so pointers
2826;; end in #b000 and we tag with #b001 for boxes, etc.
5149 `(entry
5250 ,@(compile-tail-e e '() )
5351 ret
54-
5552 err
5653 (push rbp)
57- (call error)
58- ret))
59-
54+ (call error)))
55+
6056;; Expr CEnv -> Asm
6157;; Compile an expression in tail position
6258(define (compile-tail-e e c)
You can’t perform that action at this time.
0 commit comments