diff options
author | aleksei <aleksei@aj.org> | 2024-04-14 12:34:40 +1000 |
---|---|---|
committer | aleksei <aleksei@aj.org> | 2024-04-14 12:34:40 +1000 |
commit | 5fd0592e0bf449ec25392d2cb1b4c3b45b9cd718 (patch) | |
tree | 1d35eb657a2f67f9eae2dda1b236b83166d647f6 /main.lisp | |
parent | 45045f2484f2eb88da587f98ec5c7fdeff672c94 (diff) |
Some housekeeping
Diffstat (limited to 'main.lisp')
-rw-r--r-- | main.lisp | 43 |
1 files changed, 6 insertions, 37 deletions
@@ -28,41 +28,10 @@ ESPECIALLY run through the output of macro-list to find collisions This owuld make it simple |# -(setf *the-program* - (program "~/clasm-6502/wozmon.s")) +(load "~/clasm-6502/utilities.lisp") + +(load "~/clasm-6502/6502.lisp") + +(load "~/calsm-6502/grammar.lisp") + -(defun macro-pass (program-list) - "Translate a programs macros" - (let ((macro-association-list - (let ((return-alist nil)) - (dolist (i program-list) - (if (equal (syntax-rule (cadr i) *grammar*) 'macro) - (setf return-alist - (cons (list (first (cadr i)) (car (last (cadr i)))) - return-alist)) - nil)) - return-alist)) - (return-list nil)) - ;; For every line in program list.. - (dolist (i program-list) - ;; ..excluding the macro lines.. - (if (eq (syntax-rule (cadr i) *grammar*) 'macro) - nil - ;; ..add to return list this value: - (setf return-list - (cons - ;; For every word in the line, - (let ((append-list nil)) - (dolist (j (cadr i)) - (setf append-list - ;; add it to the output line, and change whatever is a macro. - (cons (if (assoc j macro-association-list :test #'string=) - (cadr (assoc j macro-association-list :test #'string=)) - j) - append-list))) - ;; Return the line number and program. - (cons (car i) - (list (reverse append-list)))) - return-list)))) - ;; Return everything. - (reverse return-list))) |