Importing BASIC code in to VICE C64 emulator with copy and paste


Often emulators require you to jump through hoops to get programs in an out of them. This may require various conversion tools and disk image editing software. In the VICE emulator there is a tool to do just that, see : using c1541 from Vice Commodore 64 Emulator to transfer PRG files on to disk images

But don’t overlook the most obvious. For most Commdore 64 BASIC programs you can simply copy the basic code in Windows (or other OS of your choice) and use the VICE window Edit > Paste command.

Try copying and pasting the BASIC program below in to VICE

10 rem a very short basic program
20 print “hello”
30 for i=0 to 10:print i:next

lowercase

Note the letters are all in uppercase after you paste them in VICE.

If you have a program in upercase as it would be, if it were typed out of a magazine, you may need to convert all the letter to lowercase, otherwise the commodore graphics characters will be displayed, rather than the code you were expecting.
Try copying and pasting the same code, but with all uppercase letters, and compare the difference.

10 REM A VERY SHORT BASIC PROGRAM
20 PRINT “HELLO”
30 FOR I=0 TO 10:PRINT I:NEXT

 

uppercase

An easy way to conver the entire BASIC program to uppercase is to use a text editor like Notepad2 which has a “convert to lowercase” feature built in. In Notepad2, to convert a text file to all lowercase you just have to press CTRL+u and all the letters will be in lowercase.

I have found this to be one of the quickest ways to get a BASIC listing in (or out) of VICE. There will be times when certain characters may not transfer accross correctly, like the special color characters, but you can make corrections using the native editor to fix up minor errors if required.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s