(loader '((title |callext.lo|)))
(if (not (>= (version) 15.2)) (progn (error 'load 'erricf 'callext)))
(defvar #:sys-package:colon 'system)
(add-feature 'callext)
(loader'((fentry #:system:cached-getglobal subr1)
(entry #:system:cached-getglobal subr1)
(push a1)
(bfnil (cvalq #:system:defextern-cache) 101)
(adjstk '1)
(jmp getglobal)
101
(mov '0 a2)
(mov '0 a1)
(jcall cons)
(push a1)
(mov a1 a2)
(mov (& 1) a1)
(jcall cons)
(mov (cvalq #:system:getglobal-cache) a2)
(jcall cons)
(mov a1 (cvalq #:system:getglobal-cache))
(mov (& 0) a1)
(adjstk '2)
(return)
))
(loader'((fentry defextern dmsubr)
(entry defextern dmsubr)
(mov (cdr a1) a4)
(mov (car a1) a1)
(mov (cdr a4) a3)
(mov (car a4) a4)
(push a4)
(push a3)
(push (@ 101))
(push a1)
(jcall #:system:cached-getglobal)
(push a1)
(push (& 4))
(mov (& 4) a2)
(mov (car a2) a2)
(bfnil a2 102)
(mov 'fix a2)
102
(push a2)
(mov '4 a4)
(jmp buildextern)
101
(eval ())
(adjstk '2)
(return)
))
(loader'((fentry buildextern nsubr)
(entry buildextern nsubr)
(cnbeq a4 '4 0)
(mov 'buildextern a1)
(mov '4 a2)
(jmp #:llcp:errwna)
0
(push '-1)
(push (& 2))
(push nil)
101
(bfcons (& 1) 102)
(mov (& 1) a4)
(mov (cdr a4) (& 1))
(push (car a4))
(push (@ 103))
(push '"arg")
(mov (& 5) a1)
(jcall 1+)
(mov a1 (& 5))
(push a1)
(mov '2 a4)
(jmp concat)
103
(eval ())
(mov a1 a2)
(mov '#:system:callext a1)
(jcall symbol)
(adjstk '1)
(mov (& 0) a2)
(jcall cons)
(mov a1 (& 0))
(bra 101)
102
(mov (& 0) a1)
(jcall nreverse)
(adjstk '2)
(push a1)
(push (@ 104))
(push 'callextern)
(push (@ 105))
(push 'precompile)
(mov (& 8) a1)
(jcall numberp)
(btnil a1 106)
(mov (& 8) a4)
(bra 107)
106
(push (@ 108))
(push 'quote)
(push (& 10))
(mov '2 a4)
(jmp list)
108
(eval ())
(mov a1 a4)
107
(push a4)
(push nil)
(push nil)
(push (@ 109))
(push 'eval)
(push (@ 110))
(push 'kwote)
(push (@ 111))
(push '#:system:cached-getglobal)
(push (@ 112))
(push 'quote)
(push (& 20))
(mov '2 a4)
(jmp list)
112
(eval ())
(push a1)
(mov '2 a4)
(jmp list)
111
(eval ())
(push a1)
(mov '2 a4)
(jmp list)
110
(eval ())
(push a1)
(mov '2 a4)
(jmp list)
109
(eval ())
(push a1)
(mov '5 a4)
(jmp list)
105
(eval ())
(push a1)
(mov (& 5) a1)
(call #:system:conv-extern-to-ll)
(push a1)
(push (& 7))
(push (& 5))
(push nil)
113
(bfcons (& 2) 114)
(bfcons (& 1) 114)
(mov (& 2) a4)
(mov (cdr a4) (& 2))
(mov (& 1) a3)
(mov (cdr a3) (& 1))
(push (car a4))
(push (car a3))
(cabne (& 1) 'external 115)
(push (@ 117))
(push (@ 118))
(push 'vag)
(push (& 3))
(mov '2 a4)
(jmp list)
118
(eval ())
(push a1)
(mov (& 3) a1)
(call #:system:conv-ll-to-extern)
(push a1)
(mov '2 a4)
(jmp list)
117
(eval ())
(bra 116)
115
(push (@ 119))
(push (& 1))
(mov (& 3) a1)
(call #:system:conv-ll-to-extern)
(push a1)
(mov '2 a4)
(jmp list)
119
(eval ())
116
(adjstk '2)
(mov (& 0) a2)
(jcall nreconc)
(mov a1 (& 0))
(bra 113)
114
(mov (& 0) a1)
(jcall nreverse)
(adjstk '3)
(push a1)
(mov '4 a4)
(jmp mcons)
104
(eval ())
(push a1)
(cabne (& 3) 'external 121)
(push (@ 122))
(push 'loc)
(push a1)
(mov '2 a4)
(jmp list)
122
(eval ())
(mov a1 (& 0))
121
(mov (& 5) a1)
(jcall numberp)
(btnil a1 123)
(mov (& 5) a1)
(jcall zerop)
(btnil a1 123)
(mov (& 6) a3)
(mov 'errudf a2)
(mov 'defextern a1)
(adjstk '7)
(jmp error)
123
(push (@ 125))
(push 'de)
(push (& 8))
(push (& 4))
(push (& 4))
(mov '4 a4)
(jmp list)
125
(eval ())
(adjstk '7)
(return)
))
(loader'((entry #:system:conv-ll-to-extern subr1)
(cabne a1 'external 102)
(mov '0 a1)
(return)
102
(cabne a1 'fix 103)
(mov '1 a1)
(return)
103
(cabne a1 'float 104)
(mov '2 a1)
(return)
104
(cabne a1 'string 105)
(mov '3 a1)
(return)
105
(cabne a1 'vector 106)
(mov '4 a1)
(return)
106
(cabne a1 'rfix 107)
(mov '5 a1)
(return)
107
(cabne a1 'rfloat 108)
(mov '6 a1)
(return)
108
(cabne a1 'fixvector 109)
(mov '7 a1)
(return)
109
(cabne a1 'floatvector 110)
(cabne '0. '0. 111)
(mov '8 a1)
(return)
111
(mov '"floatvector (64BITFLOATS)" a3)
(mov 'errgen a2)
(mov 'defextern a1)
(jmp error)
110
(cabne a1 't 113)
114
(mov '0 a1)
(return)
113
(mov a1 a3)
(mov 'erroob a2)
(mov 'defextern a1)
(jmp error)
))
(loader'((entry #:system:conv-extern-to-ll subr1)
(cabne a1 'external 102)
(mov '0 a1)
(return)
102
(cabne a1 'fix 103)
(mov '1 a1)
(return)
103
(cabne a1 'float 104)
(mov '2 a1)
(return)
104
(cabne a1 'string 105)
(mov '3 a1)
(return)
105
(cabne a1 't 106)
107
(mov '0 a1)
(return)
106
(mov a1 a3)
(mov 'errgen a2)
(mov 'defextern a1)
(jmp error)
))
(if (not (boundp '#:system:getglobal-cache)) (progn (defvar #:system:getglobal-cache ())))
(if (not (boundp '#:system:defextern-cache)) (progn (defvar #:system:defextern-cache ())))
(loader'((fentry defextern-cache nsubr)
(entry defextern-cache nsubr)
(push a4)
(mov (& 0) a1)
(cabne a1 '0 102)
(mov (cvalq #:system:defextern-cache) a1)
(bra 101)
102
(cabne a1 '1 103)
(mov (& 0) a4)
(plus '0 a4)
(xspmov a4 a4)
(bfnil a4 105)
(btnil (cvalq #:system:defextern-cache) 105)
(call getglobal-flush-cache)
105
(mov (& 0) a4)
(plus '0 a4)
(xspmov a4 a4)
(mov a4 (cvalq #:system:defextern-cache))
(mov a4 a1)
(bra 101)
103
(mov '1 a3)
(mov 'errwna a2)
(mov 'defextern-cache a1)
(jcall error)
101
(pop a4)
(adjstk a4)
(return)
))
(loader'((entry getglobal-flush-cache subr0)
(btnil (cvalq #:system:getglobal-cache) 101)
(push (cvalq #:system:getglobal-cache))
(push nil)
103
(bfcons (& 1) 104)
(mov (& 1) a4)
(mov (cdr a4) (& 1))
(push (car a4))
(mov (& 0) a1)
(mov (car a1) a1)
(jcall string)
(adjstk '1)
(mov (& 0) a2)
(jcall cons)
(mov a1 (& 0))
(bra 103)
104
(mov (& 0) a1)
(jcall nreverse)
(adjstk '2)
(push nil)
(push a1)
(mov nil a2)
(call ←mgetglo)
(push (cvalq #:system:getglobal-cache))
(push (& 1))
105
(bfcons (& 1) 106)
(bfcons (& 0) 106)
(mov (& 1) a4)
(mov (cdr a4) (& 1))
(mov (& 0) a3)
(mov (cdr a3) (& 0))
(push (car a4))
(push (car a3))
(cabne '0 (& 0) 107)
(mov (& 1) a1)
(mov (& 5) a2)
(mov (car a1) a1)
(jcall cons)
(mov a1 (& 5))
(bra 108)
107
(mov (& 0) a1)
(jcall loc)
(mov a1 (& 0))
(mov (& 1) a1)
(bffix (& 0) 109)
(mov '0 a2)
(bra 110)
109
(mov (& 0) a2)
(mov (car a2) a2)
110
(bffix (& 0) 111)
(mov (& 0) a3)
(bra 112)
111
(mov (& 0) a3)
(mov (cdr a3) a3)
112
(mov (cdr a1) a1)
(jcall rplac)
108
(adjstk '2)
(bra 105)
106
(adjstk '2)
(mov nil (cvalq #:system:getglobal-cache))
(btnil (& 1) 113)
(mov (& 1) a1)
(jcall nreverse)
(mov a1 a3)
(mov 'errudf a2)
(mov 'defextern a1)
(adjstk '2)
(jmp error)
113
(mov nil a1)
(adjstk '2)
(return)
101
(mov nil a1)
(return)
))
(loader'((fentry cload subr1)
(entry cload subr1)
(btnil (cvalq #:system:cloadp) 101)
(push (@ 103))
(jcall string)
(push a1)
(push (@ 104))
(mov '0 a4)
(jmp #:system:ccode)
104
(eval ())
(push a1)
(jcall #:system:ecode)
(mov a1 a3)
(pop a2)
(pop a1)
(call ←cload)
(push a1)
(mov '1 a4)
(jmp #:system:ccode)
103
(eval ())
(return)
101
(jcall system)
(mov a1 a3)
(mov '"non implemente dans le systeme" a2)
(mov 'cload a1)
(jmp error)
))
(loader'((entry ←mgetglo subr2)
(push (@ 101))
(push (eval (kwote (#:system:cached-getglobal '←mgetglo))))
(push '1)
(push a1)
(push '0)
(push a2)
(push '0)
(mov '6 a4)
(jmp callextern)
101
(eval ())
(return)
))
(loader'((entry ←cload subr3)
(push a3)
(push (@ 101))
(push (eval (kwote (#:system:cached-getglobal '←cload))))
(push '0)
(push a1)
(push '3)
(mov a2 a1)
(jcall vag)
(push a1)
(push '0)
(mov (& 7) a1)
(jcall vag)
(push a1)
(push '0)
(mov '8 a4)
(jmp callextern)
101
(eval ())
(adjstk '1)
(jmp loc)
))
(loader '((end)))