[net.micro.cbm] Problems with directing output to printer

goodenough@vogon.DEC (Jeff Goodenough IPG REO2-F/L9) (01/30/86)

Help!  The following code, using C64 Kernel routines, is supposed to direct
listing output to the device specified in LISDEV.  I've done everything
that the PRG says I should do, but the output still comes out on the screen,
even when I set LISDEV to 4 for the printer.  What am I doing wrong??

Jeff.

		LDX	LISDEV
		BEQ	...	; zero = no listing required
		LDY	#$FF	; no command
		LDA	#1	; logical file #1
		JSR	SETLFS
		LDA	#0	; no file name
		JSR	SETNAM
		JSR	OPEN
		LDX	LISDEV
		JSR	CHKOUT	; set LISDEV to listen
		..	..
		..	..
		LDA	char
		JSR	CHROUT	; still goes to screen