Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Now if only they'd port Perl to the Commodore 64...

by myocom (Deacon)
on Jan 19, 2001 at 07:05 UTC ( #52920=obfuscated: print w/ replies, xml ) Need Help??

Passes -w, requires a wide display.

use strict;my@c=(15,6,6,6,6,54,28,0);my@o=(51,51,51,51,51,51,30,0); my@m=(30,51,48,30,3,51,30,0);my@d=(63,12,12,12,12,12,12,0);my@r=(12 ,30,51,63,51,51,51,0);my@e=(51,59,63,63,55,51,51,0);my@s=(30,51,51, 51,51,51,30,0);my@i=(51,51,51,63,51,51,51,0);my@x=(63,48,48,60,48, 48,63,0);my@t=(62,51,51,62,60,54,51,0);my@y=(62,51,51,62,48,48,48,0 );my@f=(48,48,48,48,48,48,63,0);my@u=(30,51,48,48,48,51,30,0);my@k= (51,54,60,56,60,54,51,0);print C(\@c,\@o,\@m,\@d);print C(\@r,\@e, \@s,\@d,\@i,\@x,\@t);print C(\@y,\@x,\@t,\@f);print C(\@i,\@r,\@u, \@k,\@x,\@t);sub C{my@c64;my@c=@_;for my $c(0..7){for my $c64(@c){ push@c64,c64(2*${$c64}[$c])}push@c64,"\n"}return@c64}sub c64{my$c= substr unpack("B32",pack"N",shift),-8;$c=~s/0/ /g;$c=~s/1/C=/g; return $c}

Comment on Now if only they'd port Perl to the Commodore 64...
Select or Download Code
Re: Now if only they'd port Perl to the Commodore 64...
by rje (Deacon) on Dec 12, 2013 at 18:39 UTC
    Thread resurrect....

    What sort of Perl COULD you cram Into 8k of RAM?

    Might look a lot like BASIC...

    Assume a tokenizer for space savings... Assume 6510 assembly language... Maybe... But would we even have hash maps?

    Ah, maybe it could be a lite variant of NQP, or Parrot...

      > What sort of Perl COULD you cram Into 8k of RAM?

      the "64" was for 64K but IIRC there were only ~56K available. =)

      Cheers Rolf

      ( addicted to the Perl Programming Language)

        Not at all! If you were writing BASIC, you had 38911 bytes available. BUT, page 0 had a control byte that let you turn on/off the various ROM banks, making the "shadowed" RAM accessible.

        So if you bypassed all the "shadowed" ROM, including the 8K BASIC ROM, you had 64K available.

        Anyway, taking that 8K of RAM that was hidden by BASIC, and writing a poor man's Perl, what would you be able to accomplish?

        Assuming I can create and manage a primitive symbol table, then I've also got hashmaps, and in a pinch I therefore also have arrays.

        The trick is not doing it RIGHT the first time, but just DOING it.

      Hmm, maybe PIR...
        Well, I guess the first thing I need is to design the "intermediate language" at any rate...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://52920]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2014-09-15 04:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls