Forum unknown
· Amiga at Work
#Modula Keyb.
1 messages in this thread
Larry, gonna disagre with you on this one. Assembler is "right" only for
documenting what a machine IS doing, not -repeat- NOT for documenting what
an operating system is going to do. As anyone who knows me will *gladly*
tell you I am NOT a UNIX ™ fan, but one thing they DID do right was to
document all of the calls in a language which a relative novice could read.
When I am reading a manual for the first I don't give a darn about all the
nitty-gritty details of how to call each and every system function (I sure
as heck don't care which registers have which arguments).
One of the VERY LARGE MISTAKES made with AmigaDOS, was the catering to the
Assembler writers who "need" to pass arguments in registers. Take a look
at what happens when a DOS call is made from 'C'. Push the arguments (in
reverse order) onto the stack, call the 'C' runtime library which loads up
the arguments from the stack into the "right" registers, gets the library
base into A6, then calls the jump vector; which pushes the "right"
registers back onto the stack to be processed by the BCPL code. What a
WASTE of time and space.
As for the pointers in BCPL, memory is viewed as overlapping arrays of
bytes, words, and longs. And memory_long[0] is followed by memory_long[1]
etc. Same for words and bytes (memory_byte[0] through memory_byte[3] are
in the same space as memory_long[0]). Now for the tricky part, a pointer
is the subscript for the item (byte, word, or long). That is, a pointer to
a byte is what you expect (and indeed need) on a 68000, but a pointer to a
word (16 bit thingie) would need to be shifted left once to be used on a
68000, but is indeed the "word number" of the word pointed to. Things are
similar on longs. Hope this clears things up, any questions and I'd be
happy to answer (my M-F 8-5 job has me maintaing .5 mega-lines of BCPL
multi-user, real-time operating system for a mini).
Incidently, BCPL was invented substantially before 'C' which was derived
from it. And Tripos pre-dates (I believe) UNIX (at least they are of the
same period (a`la 1976). UNIX is the registered trademark of Bell
Laboratories.