[comp.sys.cbm] SEQ -> PRG, and how about PRG -> SEQ?

ali@rocky.STANFORD.EDU (Ali Ozer) (09/10/87)

[--]

Ok, I want to do the reverse --- take a C64 BASIC program (which appears
as a PRG file), and send it over the 1600 modem to my Amiga. (I was looking
at all the BASIC programs I wrote for the 64, and realized some could run
on the Amiga with minimal changes...)

I either have to send the program to the Amiga as is and do some conversion
on the Amiga, or convert it on the 64 and send over the actual BASIC words
(ie, the four characters GOTO instead of the token...). And there's the 
ASCII conversion... Is there any programs/utilities already out there that 
will do this? Or some easy tricks that will aid in "untokenizing" that I can
use in a program?

Ali Ozer, ali@rocky.stanford.edu

davef@brspyr1.BRS.Com (Dave Fiske) (09/11/87)

In article <575@rocky.STANFORD.EDU>, ali@rocky.STANFORD.EDU (Ali Ozer) writes:
> 
> Ok, I want to do the reverse --- take a C64 BASIC program (which appears
> as a PRG file), and send it over the 1600 modem to my Amiga. (I was looking
> at all the BASIC programs I wrote for the 64, and realized some could run
> on the Amiga with minimal changes...)


This is real easy.  Just open a disk file on the 64, use the CMD
command to direct output to that file, and list the program.

OPEN 2,8,2,"0:FILENAME,S,W"
CMD2:LIST

When everything stops, type 

PRINT#2:CLOSE2

(This is required to make sure the buffer gets cleared and that
everything got put into the file.)

The only oddity of this is that you will end up with a Linefeed and the
message "READY" at the end of the Sequential file (the same stuff you
would get if you had listed to the screen).  Either edit these out
somehow, or ignore them (since they're not Basic keywords, they'll
probably be harmlessly rejected by whatever computer receives
them--plus, since they don't have line numbers, they can't do any
damage to the Basic program anyway.)
-- 
As you read this, your eyelids are becoming very heavy.  You can barely
keep your eyes open.  You are getting sleepy, sleepy.  Now you are fast
asleep, you are in a deep restful sleep.  You will obey my every command.
Take out a $5 bill and email it to: ihnp4!philabs!nyfca1!brspyr1!davef

fred@cbmvax.UUCP (Fred Bowen) (09/11/87)

To convert SEQ -> PRG on the C64, the Transactor program that I posted
many moons ago, similar to the one Chris Bingham just posted, works well.

To convert PRG -> SEQ, assuming a BASIC program, simply LOAD the
program, then OPEN 8,8,8,"foo.seq,s,w": CMD8: LIST  followed by the
usual PRINT#8: CLOSE8 when it finishes.

--


-- 
Fred Bowen			uucp:	{ihnp4|rutgers|caip}!cbmvax!fred
				arpa:	beats me
				tele:	215 431-9100

Commodore Electronics, Ltd.,  1200 Wilson Drive,  West Chester,  PA,  19380

rex@otto.COM (Rex Jolliff) (09/12/87)

Expires:

Sender:

Followup-To:

Distribution:

Keywords:


In article <575@rocky.STANFORD.EDU> ali@rocky.UUCP (Ali Ozer) writes:
>Ok, I want to do the reverse --- take a C64 BASIC program (which appears
>as a PRG file), and send it over the 1600 modem to my Amiga. (I was looking
>at all the BASIC programs I wrote for the 64, and realized some could run
>on the Amiga with minimal changes...)
>Ali Ozer, ali@rocky.stanford.edu

Here's a simple way to do it... First, load the file into the C-64's memory.
Then, open a SEQ file on the disk by typing: OPEN 8,8,8,"text,s,w". then,
type: CMD 8:LIST:PRINT#8:CLOSE8 (you might have to type the print and close
statments on another line.). You should now have the PET-ASCII representation
of your program in the SEQ file.  You'll probably have to convert it to regular
ASCII, but that shouldn't be to much of a problem.

Also, there is an excellent terminal program that is well suited for just these
kind of operations.  It's called BOBSTERM PRO.  It has the facility to convert
from/to ASCII, PETASCII, and BASIC program files.  you can also edit the files
no matter what format they're in.  I didn't mean this to be an advertisment,
but it sounds like this is just what everybody is needing.
                                                                Rex.


-- 

Rex Jolliff  (rex@otto.UUCP, {akgua,ihnp4,mirror,sdcrdcf}!otto!rex)
The Sun Newspaper -            |Disclaimer:  The opinions and comments in
Nevada's Largest Daily Morning | this article are my own and in no way
Newspaper                      | reflect the opinions of my employers.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
What happened to our superior space program?

ali@rocky.STANFORD.EDU (Ali Ozer) (09/13/87)

[]
Many thanks to all people who responded to the PRG->SEQ question ---
What a wonderfully simple solution! (I thought the solution might
lie in the part of the machine that prints the programs to the screen or
the printer, but, hey, I didn't realize you could "redirect" the output
to a disk file! Actually, to say the truth, I even thought of printing
the programs out then scanning them back in with a text scanner --- What
a kludgy solution that would've been...)

Ali Ozer, ali@rocky.stanford.edu

elg@usl (Eric Lee Green) (09/14/87)

In article <575@rocky.STANFORD.EDU> ali@rocky.UUCP (Ali Ozer) writes:
>Ok, I want to do the reverse --- take a C64 BASIC program (which appears
>as a PRG file), and send it over the 1600 modem to my Amiga. (I was looking
>at all the BASIC programs I wrote for the 64, and realized some could run
>on the Amiga with minimal changes...)

load"program",8
open8,8,8,"text file,s,w"
cmd8:list
print#8:close8

and presto, converted to a CBM ASCII file.

To convert to a Real Ascii file, just look at the tables of CBM ASCII
and Real Ascii. I'm afraid I can't really help you here, I use my own
conversion tables (from various programs I've written in the past) and
whip up a 5-minute program in ML whenever I need to do the job. Should
take maybe 15 minutes at most to write it in BASIC. And then 5 minutes
waiting for the compiler to compile it, if you want it to run at a
decent speed :-). 

-- 
Eric Green {ihnp4,cbosgd}!killer!elg
           {ut-sally,killer}!usl!elg
           elg@usl.CSNET

mwilson@crash.CTS.COM (Marc Wilson) (09/15/87)

In article <575@rocky.STANFORD.EDU> ali@rocky.UUCP (Ali Ozer) writes:
>[--]
>
>Ok, I want to do the reverse --- take a C64 BASIC program (which appears
>as a PRG file), and send it over the 1600 modem to my Amiga. (I was looking
>at all the BASIC programs I wrote for the 64, and realized some could run
>on the Amiga with minimal changes...)
>
>I either have to send the program to the Amiga as is and do some conversion
>on the Amiga, or convert it on the 64 and send over the actual BASIC words
>(ie, the four characters GOTO instead of the token...). And there's the 
>ASCII conversion... Is there any programs/utilities already out there that 
>will do this? Or some easy tricks that will aid in "untokenizing" that I can
>use in a program?
>

     The easiest way to untokenize the program is the following:

1) Load program
2) Type the following:

     OPEN 2,8,2,"<programname>.LST,s,w"
     CMD 2
     LIST
     PRINT#2
     CLOSE 2

     What you have now is an ASCII copy of your program on the disk.  You
can send this to the Amiga with a minimum of effort ( Amiga MS Basic DOES
allow you to load an ASCII file, doesn't it? )

     Apologies if this isn't correct... I haven't touched a Commodore machine
in over a year, and I'm sure I'm rusty.

>Ali Ozer, ali@rocky.stanford.edu


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Wilson
     ARPA: ...!crash!mwilson@nosc.mil
           ...!crash!pnet01!pro-sol!mwilson@nosc.mil
     UUCP: [ cbosgd | hp-sdd!hplabs | sdcsvax | nosc ]!crash!mwilson
     INET: mwilson@crash.CTS.COM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~