Compilateur et Générateur VM
- (load "compilateur.lisp")
- (compiler '(defun fibo (n) (cond ((= n 0) 0) ((= n 1) 1) (m ( + (fibo1 (- n 1)) (fibo1 (- n 2)))))))
- (compiler '(fibo 6))
- (load "vm.lisp")
- (make_vm 'essai 1000000)
- (charger_fichier_vm 'essai "fibo.lisp.asm")
- (apply_vm 'essai '((MOVE ($ 6) R0) (PUSH R0) (MOVE ($ 1) R0) (PUSH R0) (INCR R0) (MOVE FP R1) (MOVE SP FP) (MOVE SP R2) (SUB R0 R2) (PUSH R2) (PUSH R1) (JSR (@ FIBO)) (POP R1) (POP R2) (MOVE R1 FP) (MOVE R2 SP) (HALT)) 1) // Pour (fibo 6)