Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!uunet!nfsun!eklektik!danbabcock From: danbabcock@eklektik.UUCP (/dev/ph1) Newsgroups: comp.sys.amiga Subject: Using SetFunction with the dos.library Message-ID: <1730@eklektik.UUCP> Date: 10 Apr 90 21:44:08 GMT Reply-To: danbabcock@eklektik.UUCP (/dev/ph1) Organization: Computers, Gerbils, and Games in the Basement, Pgh, PA Lines: 24 alexander hinds wrote in <16223@snow-white.udel.EDU>: > I know this has been discussed before, but I've missed the summary. >COuld somebody tell me how to setfunction the dos.library? (remainder of text deleted) The Commodore autodocs (1.3 edition) for SetFunction have this note: "SetFunction cannot be used on non-standard libraries like dos.library. Here you must manually Forbid(), preserve all 6 original bytes, set the new vector, SumLibrary(), then Permit()" The problem is that instead of the standard "jmp.l address" used by most libraries, the dos.library uses moveq #dispatch_number,d0 bra dispatch_routine ;word displacement Where dispatch_routine is a routine that loads an address into a4 from a table indexed by the value in d0, then calls a routine, whose address is loaded from memory at a constant offset from the dispatch routine, indirectly via (a5). If you think this is strange, I agree. It's needed because AmigaDOS is written in BCPL. -- Dan Babcock / voice (412)-373-1753