Re: SEQ file/PRINT# default line terminator CRLF in VICE?

From: Ethan Dicks <ethan.dicks_at_gmail.com>
Date: Mon, 12 Jun 2023 15:52:16 -0400
Message-ID: <CAALmimnAFKNykGWq1Tr=eDcPrZCyw=+pztBiJRiAn62aOSrOCg_at_mail.gmail.com>
On Sun, Jun 11, 2023 at 4:28 PM Ethan Dicks <ethan.dicks_at_gmail.com> wrote:
> I'm dusting off an ancient project (updating previous work on FLOPTRAN
> IV from Byte in 1980) and I'm running into something odd...
> ...with disk files... PRINT# is writing out CRLF, not CR...

OK... finally found something that answers my original question.

In Raeto West's "Programming the PET/CBM" on pg 163 - tape files _are_
handled differently than IEEE devices:

"There is one complication peculiar to Commodore: PRINT and PRINT#
each follow [Return] with linefeed (this is ASCII character 10
decimal), originally so that the next line on the screen would be
moved to, whenever Return was pressed. This character is filtered out
of cassette tape files but, with BASIC<4, left to print to disk. To
get rid of it a construction like

  PRINT#8,X$;CHR$(13); or PRINT#8,X$CR$;

had to be used. BASIC 4 has a patch in its print routine which deletes
this character if the file number is less than 128. "

So the technique used in the VIC-20 descendant of the program I'm
working with _is_ the recommended way of doing it with disk files and
the original code from 1980 works with tape files because they are
different.

I haven't dug through the tape routines to see _where_ this happens,
but since I'm seeing it happen, I can accept Raeto West's comment as
it stands.

Because my goal is to work with all 8-bit Commodores, and my first
machine is a 2001N (3032) witu Upgrade ROMs, I will probably take my
version of the program from 1980 and leave it as-is for writing tape
files then make a modern mod to handle disk or tape files.  I only had
tape back in the day, so this never came up for me then, and for the
C-64, I switched to a different writing technique (a USR() call that
printed the number and advanced the internal pointer) so with all the
code changes for that port, it didn't come up there either.

Mystery solved.  It's different because it's different.

Cheers,

-ethan
Received on 2023-06-12 22:03:39

Archive generated by hypermail 2.3.0.