converting BASIC 7 programs to ascii text files?

Started by ruthven, January 15, 2011, 05:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ruthven

Does anybody know of a simple way to convert BASIC 7 programs into plain ascii text?--I want to get an old BASIC program over to my PC so I can print the source code...

(I use Star Commander to transfer files from the 1541 to the PC)

Thanks.

moiree

You could use petcat, which is included in VICE.

Call it from a shell with
petcat -o destination_filename.bas source_filename

Voilá.

ruthven

Thanks.  I ended up downloading an msdos program, I think it was called CBM2ASC... actually, it's apparently for C64 BASIC, not C128--it mistranslated all the BASIC 7 exclusive commands, changing them to random POKEs, PRINTs, SAVEs etc.  I didn't realize this had happened at first, and I was looking through my printed code trying to figure out how this program functioned--thinking what was it that I had PRINTed and SAVEd so many times?!  ???

I knew something was up when I spotted a bunch of LIST commands in the middle of code.

So thanks for the tip, I'll give it a shot.

marquisor

i'd appreciate a detailed "how to use" report from you ;)
loooking for something similar for BASIC 7 and also other various basic expansions like simon's basic...
because new tokens used there are not printable via petscii (or whatever it's called)...

further how to convert the stuff back?! i consider reading the commodore programs,  process them, maybe renumber them AND merge them with 6-7 other files parts (together with renumbering) and want to write it back to commodore format, whatever basic, expansion, etc. it is...
preserve what you deserve

Hershey

#4
Try out this windows program Works with all cbm basics
http://www.stojalowski.de/files/BasEdit.net.zip
Edit Commodore Basic files on the PC with syntax highlighting and support of the full PETSCII character set

can also save files as pc text file

Full review here
http://www.commodorefree.com/magazine/vol4/issue42.html#NEWS8
Hershey

marquisor

what about simon's basic and other basic expansions??

i mean at least printing them out on a PC. that's like OPEN4,4:CMD4:LIST
i dunno if the .prg file does the same, i doubt it does not!

preserve what you deserve

moiree

#6
This is what petcat can (de-)tokenize:

        Versions:
        1       PET Basic V1.0
        2       Basic v2.0
        superexp        Basic v2.0 with Super Expander (VIC20)
        turtle  Basic v2.0 with Turtle Basic by Craig Bruce (VIC20)
        mighty  Basic v2.0 with Mighty Basic by Craig Bruce (VIC20)
        a       Basic v2.0 with AtBasic (C64)
        simon   Basic v2.0 with Simon's Basic extension (C64)
        speech  Basic v2.0 with Speech Basic v2.7 (C64)
        F       Basic v2.0 with Final Cartridge III (C64)
        ultra   Basic v2.0 with Ultrabasic-64 (C64)
        graph   Basic v2.0 with Graphics basic (C64)
        WSB     Basic v2.0 with WS basic (C64)
        WSBF    Basic v2.0 with WS basic final (C64)
        Pegasus Basic v2.0 with Pegasus basic 4.0 (C64)
        Xbasic  Basic v2.0 with Xbasic (C64)
        Drago   Basic v2.0 with Drago basic 2.2 (C64)
        REU     Basic v2.0 with REU-basic (C64)
        Lightning       Basic v2.0 with Basic Lightning (C64)
        magic   Basic v2.0 with Magic Basic (C64)
        easy    Basic v2.0 with Easy Basic (VIC20)
        blarg   Basic v2.0 with Blarg (C64)
        Game    Basic v2.0 with Game Basic (C64)
        BSX     Basic v2.0 with Basex (C64)
        superbas        Basic v2.0 with Super Basic (C64)
        exp20   Basic 2.0 with Expanded Basic (VIC20)
        exp64   Basic 2.0 with Expanded Basic (C64)
        sxc     Basic 2.0 with Super Expander Chip (C64)
        warsaw  Basic 2.0 with Warsaw Basic (C64)
        4v      Basic 2.0 with Basic 4.0 extensions (VIC20)
        4 -w4e  PET Basic v4.0 program (PET/C64)
        5       Basic 2.0 with Basic 5.0 extensions (VIC20)
        3       Basic v3.5 program (C16)
        70      Basic v7.0 program (C128)
        71      Basic v7.1 program (C128)
        10      Basic v10.0 program (C64DX)

marquisor

#7
good information so far, but i miss (as said) simon's basic and f.e. exbasic level II. point is: there are many different and maybe not so popular basic extensions..
and well, they're all differently tokenized. i'm aware of that, BUT! as said before the "print command" to LIST on a printer does print it out all exactly as a LIST would do.

this and vice versa would be comfy (if possible)


EDIT: i'm also aware of tokens are declared individually. but... it should be "an ease" to make a table what token byte data is what PLAIN TEXT command and vice versa
preserve what you deserve

moiree

If you have list of tokens/keywords, you could add them to petcat yourself. The source is free. Even more, some people would thank you very much :)

marquisor

#9
unfortunately I'm currently not using exbasic level 2 and maybe later toolbasic. i will do a tokenlist as i need them and no other does, i even don't know the source yet and how that's all handled in detail.
as you seem to be more deep into this stuff, you'll have to do it for yourself if you urgently want or need it and make ppl happy with it :-) with my suggestions it shouldn't be a problem. further questions, you're welcome ;)
from me there'll be no tables or whatever needed for petcat as long as i don't use it in my projects.

EDIT:
BTW: it didn't come in my mind so fast... i also wanted to mention

Quote from: Hershey on January 16, 2011, 10:43 AM
Try out this windows program Works with all cbm basics
http://www.stojalowski.de/files/BasEdit.net.zip
Edit Commodore Basic files on the PC with syntax highlighting and support of the full PETSCII character set

can also save files as pc text file

this is a really good thing and tip, as i know the author and helped to improve it (along with others). the tokens in his proggy are really easy to (that's what i've meant with an "ease") update/change via a simple .txt-like file. w/o recompiling any source or so...
preserve what you deserve

Steve Gray

My CBMXfer can list all standard cbm basic prg files and will auto-detect the appropriate tokens based on load address of the file.

http://www.6502.org/users/sjgray/software/cbmxfer/cbmxfer.html

Steve