"System's code" fori/o
Originally, a programmer would have been able to use all of the computer'smemory (if possible, the area with the loader program was left alone so that theloader code wouldn't have to be toggled into memory again). The requirements of the new peripheral devices made it advantageous to reserve a part of memory for"systems code" – the specialized code that controlled the new devices. The neworganization for main memory is shown in Figure 3.1; part of memory is reservedfor the "system's code" (and, also, for system's data – the system needed memoryspace to record information such as identifiers associated with magnetic tapes ondifferent tape decks).
System's code anddata areasMemory available foruser's program.
Figure 3.1Part of main memory is reserved for "system's" code and data.
The "systems" area of memory had subroutines for whole variety of input outputtasks. There would have been a subroutines to handle tasks such as reading onecharacter from the control keyboard or one column of a punched card. Anotherroutine would exist to organize the transfer of the contents of a number of words of memory (containing binary data) to a tape block. Programmers could have calls tothese "systems subroutines" in the code of their programs. (Later, if you studycomputer architecture and operating systems you will learn why a specializedvariant on the
subroutine call instruction was added to the CPU's instructionset. This specialized instruction would have had a distinct name, e.g. "
" or"supervisor call (
)". Calls to the systems subroutines were made using this"system call" instruction rather than the normal
jump to subroutine.)Usually, rather than making direct calls to the "system's code" programmerscontinued to make use of library routines. For example, a program might use anumber input routine. This routine would read characters punched on a card(making a call to one of the systems' input routines to get each character in turn)and would convert the character sequence to a numeric value represented as a bitpattern. There would be two such input routines (one for integers, the other for realnumbers). There would be corresponding output routines that could generatecharacter sequences that could be printed on a line printer.These early systems established a kind of three component structure for arunning program. The structure, shown in Figure 3.2, is the same as on moderncomputer systems. The three kinds of code are: the code written for the specificprogram, library code (provided by colleagues, commercial companies, or possiblythe computer manufacturer), and "system's code" (usually provided by thecomputer manufacturer, though sometimes purchased from other commercialcompanies).