[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Missing Traps?

Let me jump in here - NotInROM traps have been a pet project of mine
since MACL 1.32.

The approach to handling traps (esp NotInROM ones) has changed from
MCL2.0b1 to the final. So if you're doing a lot with traps you're
in for a few surprises when you switch to the final.
b1 users may want save this message for future reference.

NotInROM traps are those listed in Inside Mac with the Not in ROM
caveat. This means the Mac OS doesn't actually have such a trap,
and it's up to the compiler to generate the appropriate code.

This isn't normally problem - C & Pascal compilers take care of
everything for you. In assembly language you have to roll your
own. From MCL - the compiler doesn't take care of it, but there
are some libraries provided.

In b1 the NotInROM traps that are supported - are part of the
normal trap mechanism. In final the NotInROM traps are in separate
files you must explicitly require.

>> What is the best way to define missing traps not in ROM?  They don't seem to
>> be mentioned in any of the files in the interfaces directory.
>> I can't find the interfaces for FSOpen, FSClose, FSWrite, etc.
>The definitions for mac interfaces for the FS traps are in the 
>examples folder in the file mac-file-io.lisp for both MCL2.0b1p3 
>and for MCL2.0f. These include FSOpen FSRead FSWrite FSClose.

This isn't quite correct - mac-file-io.lisp doesn't define traps
that conform to IM. It defines high level functions with similar

Similarly, interfaces.lisp provide another set of high level interfaces
to NotInROM traps.

>The traps are not in ROM and are defined in the mac-file-io.lisp
>file in MCL2.0b1.  In mcl2.0f, you can examine the files in oodles-of-utils
>in the NotInROM folder in +Files.Lisp and +Devices.Lisp (for FSRead
>and FSWrite).

This isn't the whole picture either. In MCL final the NotInROM folder
resides in the MCL examples folder. oodles-of-utils is NOT required to
use these trap defns. Be sure to read the docs in the NotInROM folder.

NotInROM is also a part of the oodles-of-utils distribution, so you can
get it from there. In the 2.0b1 compatible version of oou, I think it's
called +interfaces. In any event, no matter what version of MCL you have
there is a version of my trap defns out there you can use. The stuff for
MCL final is little more complete (+ I think a few bugs caught).