From 5dd63750e8c44fb6fbf2c8c0b1c01ef564d08f99 Mon Sep 17 00:00:00 2001 From: plugd Date: Sun, 29 Dec 2019 09:10:26 +1100 Subject: [PATCH] Default instr is now a hard-coded constant. --- mars.scm | 6 ++++-- run-mars.scm | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) 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) -- 2.20.1