From: David Riley
Sent: Monday, March 19, 2012 9:58 AM
Actually, Toolbox routines from assembly weren't
*that* bad. You had
to marshal your parameters properly and then drop a word in there
whose first nybble was 0xA; this was an explicitly illegal
instruction prefix (much like 0xF was the floating-point instruction
prefix) which invoked the A-Line Instruction exception handler. The
other 12 bits indicated which Toolbox instruction you were trying to
call.
If I recall correctly, this isn't too different
from how TOPS-10 did
its system calls. I haven't worked much with TOPS-10 yet.
On the PDP-10 architecture, illegal instructions trap. The instruction
itself is stored in location 40, and the calculated effective address is
stored in location 41. In kernel mode, these are physical locations 40
and 41; in user mode, they are locations 40 and 41 in the program address
space.
All PDP-10 operating systems utilize this behaviour as their system call
mechanism. In TOPS-20, the JSYS instruction (op code 104) is used, and
if the effective address is < 1000, a monitor call dispatch is performed;
if 1000+, a dispatch to a handler in the user's program or an error
handler is made. JSYS is essentially a defined illegal instruction.
Tops-10 and its variants (e.g., WAITS at Stanford, TymCOM-10 at Tymshare,
and the operating system used at CompuServe) and ITS use the hardware-
defined monitor calls. Opcodes in the range 001-037 are user program
calls; those in the range 040-077 are monitor calls.
(Because these do not interfere with the TOPS-20 mechanism, the original
developers included a partial emulation package for the Tops-10 monitor
calls. Execution of a Tops-10 call causes the emulation package to be
mapped into the user's address space, where it handles many of the most
common cases.)
As far as C on the Mac, it didn't come until
rather later. Most of
the system which wasn't done in assembly was done in some compiled
version of Pascal (i.e. not UCSD Pascal), which is why all the
strings are Pascal-style strings (prefixed with a length byte) and
all callbacks have to use Pascal function return conventions for
stack cleanup, etc.
Object Pascal was an object-oriented dialect of Pascal developed at Apple
for Lisa operating system and applications development, IIRC. Its size
and complexity were the reason that official development for the Mac was
done on Lisas for a long time. (Assembly was discouraged for large
programs on the Mac for the same reason it was discouraged on mainframe
systems: On average, the same number of lines of debugged code can be
generated per day in any language, so HLLs are more efficient of programmer
time.)
I don't think Apple programmers began using Objective-C in earnest until
MacOS 9, though it could have been MacOS 8. (Certainly the manual set for
MacOS 7 was still very much Object Pascal oriented.) Third-party programs
were much more frequently in C than in any form of Pascal, of course.
Rich Alderson
Vintage Computing Sr. Systems Engineer
Vulcan, Inc.
505 5th Avenue S, Suite 900
Seattle, WA 98104
mailto:RichA at
vulcan.com
mailto:RichA at
LivingComputerMuseum.org
http://www.LivingComputerMuseum.org/