ross@ulowell.UUCP (Ross) (01/14/86)
(de line!-eater!-killer () (cond ((eaten) poison) (t nil)))
Hello all. I have recently been attempting to use the Lisp function
(exec REGISTER:vector):number
to invoke exec to call functions in the exec library. The documentation
on this is useless. For starters its incorrect, the documentation
says that number is to be an offset into the exec library, but number
is the value returned by the function. So, (set -216 (exec vec)) is
what the documentation tells us to do. Next I tried just a vector
as the only argument so:
(setq vec (mkvect 7)) % 8 elemets for registers d0-d3,a0-a3
(putv vec 1 2) % put a two in pos 1 so it will go in reg d1
vec
[nil,2,nil,nil,nil,nil,nil]
% if you change the other positions to say 0
% it makes no difference
(exec vec)
error message like "Bad type to exec function"
error message like "Bad pointer "
.
. Info about the bad pointer we passed
.
Some numbers about the end of code.
(exec vec -216)
Same thing save that Some numbers about end of code changes.
Giving the function three arguments has no effect. This
means that exec wants two not one argument as stated in the
documentation. My guess is the second argument is supposed
do be the offset in the exec library. -216 is AvailMem
I think. I believe that argument one is supposed to be
a vector of size 8 because sending it anything else results
in a task held; I have not tried everything, just a lot of
things. The farthest I have gotten is
(exec vec r)
where r is a vector of size 1 like [-216] does not return
a bad pointer error, but it still returns a bad type
error. There is a function call!-library, but you have to
know the library number, which the documentation states you
have to get from exec, no doubt calling OpenLibrary.
If anybody out there has any experience with using exec to call functions
then please help, or if you have a pointer where I can look I would
greatly appreciate that.
I am doing this because the Amiga Lisp is a sound product. It is
fast, has a compiler, and works. It is a very basic implementation
with the exception that it handles avl trees. (tyi) and (tyo) are there
and do work, but only after the eol is entered on the Amiga. Vectors,
which are the structures used to pass the registers to exec, look
suspiciously like they could be used as C structures for purposes of
calling Amiga functions. If I can get exec to work it opens up all
sorts of possibilites for this lisp. I dislike waiting 4 minutes
every time I want to test something. Lisp has a compiler, which
generates fast code, and has the call on demand facility.
Thanks.
Ross
UUCP: ...decvax!wanginst!ulowell!ross
ARPA: "ross@ulowell"@csnet-relay ;;; sorry don't know domains yet
POSTAL:
Ross Miller
University of Lowell
Computer Science
1 University Ave.
Lowell MA 01854.