Serial IO
Volume Number: 5
Issue Number: 7
Column Tag: Assembly Lab
Related Info: Serial Drivers
Cerial (Serial) I/O
By Frank Henriquez, Los Angeles, CA
Programming The Serial Ports
The Macintosh serial ports are a neglected programming subject. Few (if any)
books on programming cover them, and this lack of information is compounded by an
absence of source code to study.
The simplest way of programming the serial ports is to use a high level language
and fool the compiler into thinking that the ports are disk files. Then you can use the
language’s generic file I/O routines for serial I/O. While this solution provides a
simple way of dealing with the serial ports, it may not provide the speed or flexibility
that may be required in certain applications.
I thought that a better approach would be to write a set of low level routines that
can be linked with compiler generated code, or with assembly language. How difficult
could this be? All I’d need was the hardware manual for the Mac’s serial port chip, a
copy of Inside Macintosh, a steady source of caffeine and a few hours of coding...right?
I quickly discovered that the task of writing drivers for the Mac is serious
business. Life is too short for the hassles involved in trying to write a driver for the
the complex (and bizarre) serial port chip, a Zilog 8530 SCC. Besides, it’s already
been done; Kirk Austin’s excellent articles “A Midi Library for Pascal” and “Midi