Classic Computer Magazine Archive COMPUTE! ISSUE 55 / DECEMBER 1984 / PAGE 10

Commodore Secondary Addresses

I own a Commodore computer and can't find out what the different secondary addresses are for device #2 (the RS-232 port). What numbers do you use here?

Kevin Rose

The secondary address is not really used for opening an RS-232 channel, so you should use a value of zero. Remember that OPENing an RS-232 channel clears out all variables and closes all other files, so OPEN the RS-232 file at the beginning of your program before any variables are defined or DIMensioned. The optional parameters for RS-232 are specified in the filename (we use a file number of 2 here):

OPEN 2,2,0,CHR$(control register);CHR$(command register)

For 300 baud, with a word length of eight bits, one stop bit, full duplex, and no parity, you can use:

OPEN 2,2,0,CHR$(6)+CHR$(0)

Complete tables are given on pages 350 and 351 of the Commodore 64 Programmer's Reference Guide.