Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!necntc!ames!oliveb!intelca!mipos3!omepd!intelisc!littlei!ogcvax!schaefer From: schaefer@ogcvax.UUCP (Barton E. Schaefer) Newsgroups: comp.sys.cbm Subject: Re: SEQ -> PRG Message-ID: <1406@ogcvax.UUCP> Date: Wed, 9-Sep-87 12:23:17 EDT Article-I.D.: ogcvax.1406 Posted: Wed Sep 9 12:23:17 1987 Date-Received: Sat, 12-Sep-87 17:06:03 EDT References: <5237@j.cc.purdue.edu> Reply-To: schaefer@ogcvax.UUCP (Ghostwheel) Organization: Oregon Graduate Center, Beaverton, OR Lines: 55 In article rufsmith@uokmax.UUCP (Random of Amber) writes: >In response to Jeff Wieland's question about SEQ-PRG conversion: > >Whew! Commodore disk protocol is a rarity in that programs do not >generally get saved as ASCII files; thus, to my knowledge, there is >no way to load a program from an ASCII file. Given time, I could >probably come up with a satisfactory machine language program to >do the trick; maybe not...but that is beside the point, since that >is not what you asked for. Sorry, but the only thing that comes >to mind is for you to print out the file (if you have a printer) >and type it in by hand. Write a short BASIC program that resides at some huge line numbers (like 9999 and above, or bigger than the last line of the program to be converted) that: 1) Reads a line from the ASCII file 2) Prints it to the screen 3) Positions the cursor on that line 4) Pokes a newline into the input buffer 5) Pokes a 1 into the "characters in input buffer" counter 6) If the file is not empty, go back to (1) I've left out a lot of details, like the addresses of things (I don't have them memorized, sorry) but this will cause the ASCII text to be added to the program in memory. Then you just delete the lines above 9999 (you can even automate *that*) and SAVE the program. There is a program-combiner in (I believe) _Mapping_the_Commodore_64_ from COMPUTE! books that uses exactly this technique. My modem came with a utility program that also does this, though it does some funny things to hide its work (so you don't see the program appearing on the screen). _Mapping_ also gives the addresses for the input buffer (and everything else). You could also use SYS to call the kernal tokenizer directly on the ASCII text, but that's more complicated than I want to discuss here. > I should also point out that a program >written on the IBM will very likely not work on the Commodore. True, especially if it uses the graphics calls. If you have a word processor or other editor that works on plain text files, use that to edit the ASCII before running the ASCII-to-BASIC program. If the file is saved in true ASCII, you will also need to convert it to PETASCII (the non-standard Commodore character set). > Random Let Merle answer these questions from now on, Random. -- Ghostwheel CSNET: schaefer@Oregon-Grad UUCP: ...{tektronix,verdix}!ogcvax!schaefer "Face it ... computers have revolutionized the workplace." "Right. The Ayatollah did the same thing to Iran." -- J. MacNelly