; Les exemples LAP de la documentation.

(defvar fiblap '(

          (fentry fiblap subr1)
          (cnbgt a1 '2 100)
          (mov '1 a1)
          (return)
 100
          (diff '1 a1)
          (push a1)
          (jcall fiblap)
          (mov a1 a2)
          (pop a1)
          (push a2)
          (diff '1 a1)
          (jcall fiblap)
          (pop a2)
          (plus a2 a1)
          (return)))

(loader fiblap t)

(print (fiblap 10))

(defvar llap1 '(

          (fentry dlq subr2)
          (btcons a2 1001)
          (mov nil a1)
          (return)
 1001
          (mov (car a2) a3)
          (cabne a1 a3 1003)
          (mov (cdr a2) a1)
          (jmp dlq)
 1003
          (push a3)
          (mov (cdr a2) a2)
          (jcall dlq)
          (mov a1 a2)
          (pop a1)
          (jmp cons)))

(loader llap1 t)

(print (dlq 'a '(b a c a b)))

(defvar llap2 '(

          (fentry screat subr2)
          (push a1)
          (push a2)
          (mov '6 a1)
          (mov '#/X a2)
          (jcall makestring)
          (hbmovx '#/a a1 (& 1))
          (hbmovx '#/b a1 (& 0))
          (adjstk '2)
          (return)))

(loader llap2 t)

(print  (screat 2 4))

(defvar llap3 '(

          (fentry invector nsubr)
          (push a4)
          (mov a4 a1)
          (mov nil a2)
          (jcall makevector)
          (pop a4)
          (mov '0 a3)
          (bra 1005)
 1002
          (pop a2)
          (hpmovx a2 a1 a3)
          (plus '1 a3)
 1005
          (sobgez a4 1002)
          (return)))

(loader llap3 t)

(print (invector 1 2 3 4 5))