Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!steinmetz!nyfca1!brspyr1!davef From: davef@brspyr1.BRS.Com (Dave Fiske) Newsgroups: comp.sys.cbm Subject: Re: SEQ -> PRG Message-ID: <1767@brspyr1.BRS.Com> Date: Tue, 8-Sep-87 15:33:19 EDT Article-I.D.: brspyr1.1767 Posted: Tue Sep 8 15:33:19 1987 Date-Received: Thu, 10-Sep-87 01:42:37 EDT References: <5237@j.cc.purdue.edu> Distribution: na Organization: BRS Info Technologies, Latham NY Lines: 63 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 There is a way to do it, but it gets involved. What you need is a "tokenizer" program. Such programs have been published in magazines dealing with Commodore computers, and there are probably some floating around in software libraries of online services and bulletin boards. When you type in a Basic statement on your computer keyboard, the Basic interpreter (which is stored in ROM on your 64) looks up the words you type in, and, if they are legitimate Basic keywords, uses a one-byte abbreviation, a "token", to store the keywords. Non-keywords are stored in a different way. For a program to "run", it must be stored in such a tokenized format, so that the interpreter will recognize the various commands, and know what to do. An ASCII file, even though it consists of Basic statements, is NOT tokenized, and cannot be run. To make such a program runnable, it has to be tokenized. This can be done in two ways: write a program that does its own interpreting, which converts the Basic keywords into the correct tokens, and stores them in this format; or, write a program that utilizes the built-in Basic interpreter to tokenize the statements. The second method is easier, since, in addition to converting keywords to the appropriate tokens, there are other non-keyword things (like quoted strings) that have to be handled. When you use the interpreter, it takes care of all this on its own. The way the Basic interpreter can be used is to use the "dynamic keyboard" technique to enter the Basic statements as though there were a person typing them from the keyboard. The statements are read in, and Carriage Returns (fed into the keyboard buffer) simulate a person entering the statements. One hitch here is that, since the Basic program you are entering is constantly having new lines added to it, variables, etc. are constantly being cleared (anytime you alter a Basic program in memory, this happens). This messes up trying to read a disk file, so the file first has to be read into RAM and stored, and this "image" of the disk file is what gets tokenized. Well, I hope this points you in the right direction. If you absolutely, positively have to convert such a file, I have a tokenizer program that I wrote for my own use, but it is sort of clunky. Unless you have really long files it is probably easier to retype them than to do all the above. Also, if the Basic programs were from an IBM-PC, chances are they will utilize some commands that don't exist in the Version 2.0 Basic on your C-64. This means you would have to monkey around with them to get them to work on your machine anyway. As a general rule, anything other than a fairly simple program couldn't simply be "ported" over to your C-64, and anything that is short should just be re-typed on your Commodore. -- 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