Commodore 64 Hiding BASIC Code technique ..
Posted: Sat Apr 02, 2016 4:46 pm
This is how the program Madam FiFi Whore House hides the Basic listing. Very cleaver indeed.
Here is a little gem that you may find interesting. Did you ever wish that you could `hide' parts of a program, while leaving it all in BASIC and copyable ? Well here is a simple and effective way to do just that!
Simply load your program into memory, and place five colons (:::::) in front of every statement that you wish to hide, after the line number and before the BASIC line itself. Then just key in the following statements and exe-cute them via a `goto.' List the program and you will see that your secret code has vanished! To make the lines reappear, just ` goto' the line number you assigned to the second half of the statements below.
Try this little trick on the small program below just to see it work, it's fun and only costs you a little more space for the five colons and the extra statements.
10 rem "simple program"
20 print"this line will not be protected"
30 print"this line will not be protected either" 40 :::::print"but this line will. . . ." 50 :::::print"and this one too......
55 stop: rem "assume that this is the logical end of the program
60 rem "the coding from 60000-60020 will make the lines vanish
70 rem "the coding from 60030-60050 will make the lines reappear
60000 :::::fori = 1024 to 15000
60010 :::::ifpeek(i) = 58andpeek(i + 2) = thenpokei,0:i = i + 5
60020 :::::next:stop
60030 :::::fori = 1024 to 15000
60040 :::::ifpeek(i) = Oandpeek(i + 1) = 58andpeek(i + 2) = 58thenpokei,58:i = 1 + 5 60050 :::::next:stop
NOTE . . . the value of 15000 in lines 60000 and 60030 just needs to be any value large enough so that it is larger than the number of bytes of your code to ensure that the search for the five colons continues through your entire program.
Thanks for this great programming technique from the guys at commodore.ca
Regards
Colin
Here is a little gem that you may find interesting. Did you ever wish that you could `hide' parts of a program, while leaving it all in BASIC and copyable ? Well here is a simple and effective way to do just that!
Simply load your program into memory, and place five colons (:::::) in front of every statement that you wish to hide, after the line number and before the BASIC line itself. Then just key in the following statements and exe-cute them via a `goto.' List the program and you will see that your secret code has vanished! To make the lines reappear, just ` goto' the line number you assigned to the second half of the statements below.
Try this little trick on the small program below just to see it work, it's fun and only costs you a little more space for the five colons and the extra statements.
10 rem "simple program"
20 print"this line will not be protected"
30 print"this line will not be protected either" 40 :::::print"but this line will. . . ." 50 :::::print"and this one too......
55 stop: rem "assume that this is the logical end of the program
60 rem "the coding from 60000-60020 will make the lines vanish
70 rem "the coding from 60030-60050 will make the lines reappear
60000 :::::fori = 1024 to 15000
60010 :::::ifpeek(i) = 58andpeek(i + 2) = thenpokei,0:i = i + 5
60020 :::::next:stop
60030 :::::fori = 1024 to 15000
60040 :::::ifpeek(i) = Oandpeek(i + 1) = 58andpeek(i + 2) = 58thenpokei,58:i = 1 + 5 60050 :::::next:stop
NOTE . . . the value of 15000 in lines 60000 and 60030 just needs to be any value large enough so that it is larger than the number of bytes of your code to ensure that the search for the five colons continues through your entire program.
Thanks for this great programming technique from the guys at commodore.ca
Regards
Colin