http://qs321.pair.com?node_id=11110033


in reply to 6502 Perl

This SO article is a good walk down memory lane: https://retrocomputing.stackexchange.com/a/6020/13676. It discusses what portions of the 64KB that could be mapped by a 6502 were used as RAM in an Apple II. There were a few bytes (256) mapped to device channels, and 12KB was the language module for Applesoft BASIC (10KB) and other low-level ROM stuff (2KB).

Keep in mind that contemporary BASIC implementations of the day were often in the 8KB to 12KB range. The slightly earlier generation of the 70s was often 4KB for the language. BASIC implementations were extremely simple; easy to parse, no actual subroutines (just GOSUB to line numbers).

And for architectures that facilitated memory bank swapping, I think you were limited to two banks. And there probably wasn't any shared memory other than the CPU itself that stayed in-place between swaps, so imagine how hard that would be to work with; any state that was needed across banks would have to be copied to both through a series of CPU register transfers and swaps. BASIC, of course, would never have exposed the ability to write programs that could access more than the 64kb of a single bank, without the programmer resorting to POKE/PEEK to do their own manual memory management.

Anyway, those were fun times, but you were a lot closer to the metal, and had a lot less resources to work with. It's one of the reasons that Perl was such a breath of fresh air for me as I first picked it up; coming from BASIC -> 6502 Assembler -> PASCAL -> Modula II -> C -> early C++... then suddenly discovering Perl.


Dave

Replies are listed 'Best First'.
Re^2: 6502 Perl
by RMGir (Prior) on Dec 12, 2019 at 19:46 UTC
    Of course, if you were actually doing perl on an Apple ][, you'd probably want to use overlays, and swap in the overlays from the tape deck :) (Or, if you're lucky, the 140kb floppy...)

    Mike

      "Uh oh this needs a couple more CPAN modules; where'd I put the x-acto knife . . ."

      (Also acceptable would be "where's the hole punch"; and if you don't get that, get offa my lawn you gol durned whippersnappers.)

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.