File tree Expand file tree Collapse file tree 5 files changed +26
-28
lines changed
Expand file tree Collapse file tree 5 files changed +26
-28
lines changed Original file line number Diff line number Diff line change 11#lang racket
2- (require "parse.rkt " "compile.rkt " "read-all.rkt " "a86/printer.rkt " )
2+ (require "stdlib.rkt " " parse.rkt " "compile.rkt " "read-all.rkt " "a86/printer.rkt " )
33(provide main)
44
55;; -> Void
Original file line number Diff line number Diff line change 5858 '(list list* make-list list? foldr map filter length append append*
5959 memq member append-map vector->list
6060 reverse
61- number->string gensym read read-char
61+ number->string gensym read read-char peek-char
6262 > <= >=
6363 void?
6464 list->string string->list
65- char<=?
65+ char<=? char=?
6666 remove-duplicates remq* remove* remove
6767 andmap vector list->vector boolean?
6868 substring odd?
6969 system-type ;; hard-coded
7070 not findf
7171 read-line
72+ exact->inexact / expt string->keyword ; unimplemented
7273 ;; Op0
7374 read-byte peek-byte void
7475 ;; Op1
Original file line number Diff line number Diff line change 11#lang racket
22(provide read)
3- (require "stdlib.rkt " )
3+ (require "stdlib.rkt " " utils.rkt " )
44;(require (only-in "stdlib.rkt" read-char))
55
66;; read.rkt
673673
674674(define (unimplemented x)
675675 (err (string-append "unimplemented: " x)))
676-
677-
678- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
679- ;; Multipliers
680-
681- (define (*2 a)
682- (arithmetic-shift a 1 ))
683-
684- (define (*8 a)
685- (arithmetic-shift a 3 ))
686-
687- (define (*16 a)
688- (arithmetic-shift a 4 ))
689-
690- (define (*10 a) ; 10a=2^3a+2a
691- (+ (arithmetic-shift a 1 )
692- (arithmetic-shift a 3 )))
693-
694- (define (*64 a)
695- (arithmetic-shift a 6 ))
Original file line number Diff line number Diff line change 11#lang racket
22(provide list list* make-list list? map foldr filter length append append*
33 memq member append-map vector->list
4- number->string gensym read read-char
4+ number->string gensym read read-char peek-char
55 > <= >= void?
66 char<=? char=?
77 list->string string->list
Original file line number Diff line number Diff line change 11#lang racket
2- (provide symbol->label symbol->data-label lookup pad-stack unpad-stack *8 )
2+ (provide symbol->label symbol->data-label lookup pad-stack unpad-stack *2 *8 *10 *16 *64 )
33(require "a86/ast.rkt " "registers.rkt " )
44
55;; Symbol -> Label
4949(define (unpad-stack)
5050 (seq (Add rsp r15)))
5151
52- (define (*8 n)
53- (arithmetic-shift n 3 ))
52+
53+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54+ ;; Multipliers
55+
56+ (define (*2 a)
57+ (arithmetic-shift a 1 ))
58+
59+ (define (*8 a)
60+ (arithmetic-shift a 3 ))
61+
62+ (define (*16 a)
63+ (arithmetic-shift a 4 ))
64+
65+ (define (*10 a) ; 10a=2^3a+2a
66+ (+ (arithmetic-shift a 1 )
67+ (arithmetic-shift a 3 )))
68+
69+ (define (*64 a)
70+ (arithmetic-shift a 6 ))
You can’t perform that action at this time.
0 commit comments