diff options
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))) |