Author Topic: converting BASIC 7 programs to ascii text files?  (Read 1538 times)

0 Members and 1 Guest are viewing this topic.

ruthven

  • Guest
converting BASIC 7 programs to ascii text files?
« on: January 15, 2011, 05:42 AM »
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.

Offline moiree

  • O_o
  • KIM-1 user
  • **
  • Posts: 12
  • Location: FRG
  • Activity:
    0%
  • Country: 00
  • Reputation: 1
  • With us since: 09/01/2011
    YearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #1 on: January 15, 2011, 10:19 AM »
You could use petcat, which is included in VICE.

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

Voilá.

ruthven

  • Guest
Re: converting BASIC 7 programs to ascii text files?
« Reply #2 on: January 16, 2011, 06:59 AM »
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.

Offline marquisor

  • KIM-1 user
  • **
  • Posts: 38
  • Location: Germany
  • Activity:
    0%
  • Reputation: 0
  • Gender: Male
  • With us since: 17/03/2010
    YearsYearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #3 on: January 16, 2011, 07:05 AM »
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

Offline Hershey

  • KIM-1 user
  • **
  • Posts: 33
  • Age: 51
  • Location: Strathclair, Manitoba
  • Activity:
    0%
  • Country: ca
  • Reputation: 6
  • Gender: Male
  • With us since: 04/06/2006
    YearsYearsYearsYearsYearsYearsYears
    • View Profile
    • elitebbs
Re: converting BASIC 7 programs to ascii text files?
« Reply #4 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
 
Full review here
http://www.commodorefree.com/magazine/vol4/issue42.html#NEWS8
« Last Edit: January 16, 2011, 10:46 AM by Hershey »
Hershey

Offline marquisor

  • KIM-1 user
  • **
  • Posts: 38
  • Location: Germany
  • Activity:
    0%
  • Reputation: 0
  • Gender: Male
  • With us since: 17/03/2010
    YearsYearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #5 on: January 16, 2011, 11:01 AM »
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

Offline moiree

  • O_o
  • KIM-1 user
  • **
  • Posts: 12
  • Location: FRG
  • Activity:
    0%
  • Country: 00
  • Reputation: 1
  • With us since: 09/01/2011
    YearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #6 on: January 16, 2011, 12:05 PM »
This is what petcat can (de-)tokenize:
Code: [Select]
        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)
« Last Edit: January 16, 2011, 12:08 PM by moiree »

Offline marquisor

  • KIM-1 user
  • **
  • Posts: 38
  • Location: Germany
  • Activity:
    0%
  • Reputation: 0
  • Gender: Male
  • With us since: 17/03/2010
    YearsYearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #7 on: January 16, 2011, 12:09 PM »
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
« Last Edit: January 16, 2011, 12:15 PM by marquisor »
preserve what you deserve

Offline moiree

  • O_o
  • KIM-1 user
  • **
  • Posts: 12
  • Location: FRG
  • Activity:
    0%
  • Country: 00
  • Reputation: 1
  • With us since: 09/01/2011
    YearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #8 on: January 17, 2011, 12:39 PM »
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 :)

Offline marquisor

  • KIM-1 user
  • **
  • Posts: 38
  • Location: Germany
  • Activity:
    0%
  • Reputation: 0
  • Gender: Male
  • With us since: 17/03/2010
    YearsYearsYears
    • View Profile
Re: converting BASIC 7 programs to ascii text files?
« Reply #9 on: January 17, 2011, 07:07 PM »
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

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...
« Last Edit: January 18, 2011, 11:02 AM by marquisor »
preserve what you deserve

Offline Steve Gray

  • VIC 20 user
  • ****
  • Posts: 129
  • Location: Markham, Ontario, Canada
  • Activity:
    1%
  • Reputation: 11
  • Gender: Male
  • With us since: 23/03/2007
    YearsYearsYearsYearsYearsYears
    • View Profile
    • My Web Page
Re: converting BASIC 7 programs to ascii text files?
« Reply #10 on: January 19, 2011, 09:22 AM »
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

 



Back to top