Device numbers are numbers that identify various peripheral devices connected to (or, in some cases, built into) the C64: The device number is used when creating logical files through the KERNAL file system; see OPEN (BASIC command) and OPEN (KERNAL routine).
The first four device numbers relate to various hardware that requires the CPU, memory and other resources of the core C64:
- 0 is the keyboard.
- 1 is the datassette, if any is connected.
- 2 is the RS232 interface.
- 3 is the text screen.
Device numbers above 3 all refer to devices connected through the serial port. They are all handled in exactly the same way from KERNAL's point of view, but by convention:
Often the default device number of printers, plotters and disk drives can be changed via dip-switches.