From: plugd Date: Sat, 28 Dec 2019 22:10:26 +0000 (+1100) Subject: Default instr is now a hard-coded constant. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=5dd63750e8c44fb6fbf2c8c0b1c01ef564d08f99;p=jars.git Default instr is now a hard-coded constant. --- diff --git a/mars.scm b/mars.scm index 3ead51f..e97d2ba 100644 --- a/mars.scm +++ b/mars.scm @@ -79,7 +79,9 @@ ;;; Memory setup and addressing ;; - (define (make-core core-size initial-instr . set-functions) + (define INITIAL-INSTR (make-instr 'DAT 'F 'immediate 0 'immediate 0)) + + (define (make-core core-size . set-functions) (let ((core-vec (make-vector core-size '())) (names-vec (make-vector core-size '()))) (define (norm-addr i) @@ -105,7 +107,7 @@ (print)) (let loop ((i 0)) (unless (>= i core-size) - (vector-set! core-vec i (initial-instr 'make-copy)) + (vector-set! core-vec i (INITIAL-INSTR 'make-copy)) (loop (+ i 1)))) (lambda args (match args diff --git a/run-mars.scm b/run-mars.scm index 7919e4d..db5a8b5 100644 --- a/run-mars.scm +++ b/run-mars.scm @@ -24,14 +24,13 @@ (lambda (fname) (string->prog (with-input-from-file fname read-string))) files)) - (empty-instr (make-instr 'DAT 'F 'immediate 0 'immediate 0)) (core (if visualization (let* ((colors '("red" "blue" "green" "magenta" "cyan")) (color-map (make-color-map progs colors)) (vis (make-vis 640 480 core-size color-map))) - (make-core 8000 empty-instr (lambda (i n) - (vis 'update-owner i n)))) - (make-core 8000 empty-instr))) + (make-core 8000 (lambda (i n) + (vis 'update-owner i n)))) + (make-core 8000))) (queues (run-mars core (install-progs core progs) iters))) (for-each (lambda (q) (print)