Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!husc6!bloom-beacon!randy
From: randy@athena.mit.edu (Randall W Winchester)
Newsgroups: comp.sys.cbm
Subject: Re: SEQ -> PRG
Message-ID: <1414@bloom-beacon.MIT.EDU>
Date: Sat, 12-Sep-87 00:11:38 EDT
Article-I.D.: bloom-be.1414
Posted: Sat Sep 12 00:11:38 1987
Date-Received: Sun, 13-Sep-87 01:51:09 EDT
References: <5237@j.cc.purdue.edu>
Sender: daemon@bloom-beacon.MIT.EDU
Reply-To: randy@heracles.UUCP (Randall W Winchester)
Distribution: na
Organization: Massachusetts Institute of Technology
Lines: 36
Keywords: tokenizer
Summary: one-line/direct mode

In article <5237@j.cc.purdue.edu> abp@j.cc.purdue.edu (Jeffrey J Wieland) writes:
>I have a two BASIC programs that I have transferred from an IBM PC to a
>Commodore 64 using Kermit 2.0 and a serial cable.  I saved them as ascii
>files on the PC before I transferred them, and they are now safely on a
>C64 disk as SEQ files.  Now, I need to know how to convert them to PRG
>files.  Is there any way to do this?  Perhaps someone has written a program
>to do this.  I know next to nothing about the Commodore, so please assume
>that I know nothing.

From the November 1986 issue of The Transactor:

OPEN 2,8,2, "filename" : POKE 781,2 : POKE 812,73 : SYS 65478

This can not only be used to tokenize a BASIC PRoGram LISTed to a
SEQuential file, it will also execute a SEQuential file of BASIC
direct mode commands similar to the SUBMIT command in CP/M.  If you
end the file with CLOSE 2 : POKE 812,47 : SYS 65484 , the system will
be returned to normal after executing the command file.  It can also
be used to merge a program listing with an existing program in memory.
I also used this one-line technique in a utility to write BASIC DATA
statements from raw disk sectors.

On the subject of ASCII conversion, these two one-liners are also from
The Transactor, Volume 5, Issue 4:

ASCII -> CBM

a=asc(a$+chr$(0)):a$=chr$(a+32*(a>96 and a<123)-128*(a>64 and a<91))

This will convert a single character stored in A$.  For CBM to true ASCII:

a=asc(a$+chr$(0)):a$=chr$(a+128*(a>192 and a<220)-32*(a>64 and a<91))

Control characters are the exception.  There isn't much correlation
between ASCII and CBM control characters.  You have to handle them on
a case by case basis.