(loader '((title |genarith.lo|)))
(if (not (>= (version) 15.2)) (progn (error 'load 'erricf 'genarith)))
(loader'((fentry #:genarith:+ subr2)
(entry #:genarith:+ subr2)
(push a2)
(bffix a1 101)
(bffix a2 101)
(jcall float)
(push a1)
(mov (& 1) a1)
(jcall float)
(pop a4)
(fplus a1 a4)
(mov a4 a1)
(adjstk '1)
(return)
101
(push (@ 103))
(push '+)
(push a1)
(push a2)
(mov '3 a4)
(bra #:genarith:error)
103
(eval ())
(adjstk '1)
(return)
))
(loader'((fentry #:genarith:- subr2)
(entry #:genarith:- subr2)
(push a2)
(bffix a1 101)
(bffix a2 101)
(jcall float)
(push a1)
(mov (& 1) a1)
(jcall float)
(pop a4)
(fdiff a1 a4)
(mov a4 a1)
(adjstk '1)
(return)
101
(push (@ 103))
(push '-)
(push a1)
(push a2)
(mov '3 a4)
(bra #:genarith:error)
103
(eval ())
(adjstk '1)
(return)
))
(loader'((fentry #:genarith:0- subr1)
(entry #:genarith:0- subr1)
(bffix a1 101)
(jcall float)
(mov '0. a4)
(fdiff a1 a4)
(mov a4 a1)
(return)
101
(push (@ 103))
(push '0-)
(push a1)
(mov '2 a4)
(bra #:genarith:error)
103
(eval ())
(return)
))
(loader'((fentry #:genarith:* subr2)
(entry #:genarith:* subr2)
(push a2)
(bffix a1 101)
(bffix a2 101)
(jcall float)
(push a1)
(mov (& 1) a1)
(jcall float)
(pop a4)
(ftimes a1 a4)
(mov a4 a1)
(adjstk '1)
(return)
101
(push (@ 103))
(push '*)
(push a1)
(push a2)
(mov '3 a4)
(bra #:genarith:error)
103
(eval ())
(adjstk '1)
(return)
))
(loader'((fentry #:genarith:/ subr2)
(entry #:genarith:/ subr2)
(push a2)
(bffix a1 101)
(bffix a2 101)
(cnbne '0 a2 103)
(push (@ 105))
(push a1)
(push a2)
(mov '2 a4)
(jmp list)
105
(eval ())
(mov a1 a3)
(mov (cvalq err0dv) a2)
(mov '/ a1)
(adjstk '1)
(jmp error)
103
(jcall float)
(push a1)
(mov (& 1) a1)
(jcall float)
(pop a4)
(fquo a1 a4)
(mov a4 a1)
(adjstk '1)
(return)
101
(push (@ 106))
(push '/)
(push a1)
(push a2)
(mov '3 a4)
(bra #:genarith:error)
106
(eval ())
(adjstk '1)
(return)
))
(loader'((fentry #:genarith:1/ subr1)
(entry #:genarith:1/ subr1)
(bffix a1 101)
(cnbne a1 '0 103)
(mov a1 a3)
(mov (cvalq err0dv) a2)
(mov '1/ a1)
(jmp error)
103
(jcall float)
(mov '1. a4)
(fquo a1 a4)
(mov a4 a1)
(return)
101
(push (@ 105))
(push '1/)
(push a1)
(mov '2 a4)
(bra #:genarith:error)
105
(eval ())
(return)
))
(defvar #:ex:mod 0)
(loader'((fentry #:genarith:quomod subr2)
(entry #:genarith:quomod subr2)
(push a2)
(push a1)
(push (@ 101))
(push a1)
(mov a2 a1)
(jcall abs)
(push a1)
(mov '2 a4)
(jmp /)
101
(eval ())
(jcall floor)
(push a1)
(push (@ 102))
(push (& 2))
(push (@ 103))
(mov (& 5) a1)
(jcall abs)
(push a1)
(push (& 4))
(mov '2 a4)
(jmp *)
103
(eval ())
(push a1)
(mov '2 a4)
(jmp -)
102
(eval ())
(mov a1 (cvalq #:ex:mod))
(push (@ 106))
(push (& 3))
(push '0)
(mov '2 a4)
(jmp <)
106
(eval ())
(btnil a1 104)
(push (@ 107))
(push (& 1))
(mov '1 a4)
(jmp -)
107
(eval ())
(adjstk '3)
(return)
104
(mov (& 0) a1)
(adjstk '3)
(return)
))
(loader'((entry #:genarith:error nsubr)
(diff '1 a4)
(jcall #:llcp:nlist)
(push a1)
101
(btnil (& 0) 102)
(mov (& 0) a4)
(btfix (car a4) 105)
(bffloat (car a4) 103)
105
(mov (& 0) a4)
(mov (cdr a4) (& 0))
(bra 101)
103
(mov (& 0) a3)
(mov (car a3) a3)
(mov 'errnna a2)
(mov (& 1) a1)
(jcall error)
(bra 101)
102
(mov nil a1)
(adjstk '2)
(return)
))
(defvar #:sys-package:genarith 'genarith)
(loader'((fentry floor subr1)
(entry floor subr1)
(push a1)
(jcall numberp)
(bfnil a1 101)
(mov (& 0) a3)
(mov 'errnna a2)
(mov 'floor a1)
(adjstk '1)
(jmp error)
101
(mov (& 0) a1)
(jcall truncate)
(push a1)
(push (@ 105))
(push a1)
(push (& 3))
(mov '2 a4)
(jmp >)
105
(eval ())
(btnil a1 103)
(push (@ 106))
(push (& 1))
(push '1)
(mov '2 a4)
(jmp -)
106
(eval ())
(adjstk '2)
(return)
103
(mov (& 0) a1)
(adjstk '2)
(return)
))
(loader'((fentry ceiling subr1)
(entry ceiling subr1)
(push a1)
(jcall floor)
(push a1)
(push (@ 103))
(push a1)
(push (& 3))
(mov '2 a4)
(jmp <)
103
(eval ())
(btnil a1 101)
(push (@ 104))
(push (& 1))
(push '1)
(mov '2 a4)
(jmp +)
104
(eval ())
(adjstk '2)
(return)
101
(mov (& 0) a1)
(adjstk '2)
(return)
))
(loader'((fentry round subr2)
(entry round subr2)
(push a2)
(push a1)
(push (@ 103))
(push a2)
(push '0)
(mov '2 a4)
(jmp <)
103
(eval ())
(btnil a1 101)
(mov (& 1) a1)
(jcall 0-)
(mov a1 a2)
(mov (& 0) a1)
(jcall round)
(adjstk '2)
(jmp 0-)
101
(push (@ 106))
(push (& 1))
(push '0)
(mov '2 a4)
(jmp <)
106
(eval ())
(btnil a1 104)
(push (@ 109))
(push (cvalq #:ex:mod))
(push (@ 110))
(push (& 4))
(push (cvalq #:ex:mod))
(mov '2 a4)
(jmp -)
110
(eval ())
(push a1)
(mov '2 a4)
(jmp =)
109
(eval ())
(btnil a1 107)
(push (@ 111))
(push '-1)
(mov (& 2) a1)
(jcall 0-)
(mov (& 3) a2)
(jcall round)
(push a1)
(mov '2 a4)
(jmp -)
111
(eval ())
(adjstk '2)
(return)
107
(mov (& 0) a1)
(jcall 0-)
(mov (& 1) a2)
(jcall round)
(jcall 0-)
(mov a1 (& 0))
(mov (cvalq #:ex:mod) a1)
(jcall 0-)
(mov a1 (cvalq #:ex:mod))
(mov (& 0) a1)
(adjstk '2)
(return)
104
(mov (& 1) a2)
(mov (& 0) a1)
(jcall quotient)
(mov a1 (& 0))
(push (@ 114))
(push (& 2))
(push (cvalq #:ex:mod))
(mov '2 a4)
(jmp -)
114
(eval ())
(mov a1 (& 1))
(btnil a1 112)
(push (@ 117))
(push a1)
(push (cvalq #:ex:mod))
(mov '2 a4)
(jmp <)
117
(eval ())
(btnil a1 115)
(mov (& 1) a1)
(jcall 0-)
(mov a1 (cvalq #:ex:mod))
(push (@ 118))
(push '1)
(push (& 2))
(mov '2 a4)
(jmp +)
118
(eval ())
(mov a1 (& 0))
(adjstk '2)
(return)
115
(mov (& 0) a1)
(adjstk '2)
(return)
112
(mov nil a1)
(adjstk '2)
(return)
))
(loader '((end)))