Tag: general

  • A Simple Guide to Porting Your BASIC

    A Simple Guide to Porting Your BASIC

    You may have considered porting some BASIC code from one dialect to another.

    Do not be dissuaded, the process can sometimes be rewarding.

    When porting on BASIC to another, I have found the following guides to be useful:

    Strip out all lines with references to POKE and PEEK.

    This is my preferred strategy. Almost every system addresses memory differently, and has a different memory map.

    Check the way arrays work on your target machine. Especially string arrays.

    Many systems will allow simple string arrays, such as: S$(100)

    But how long are these strings? How does the machine assign and evaluate each index? Some machines may even accept two-dimensional string arrays.

    Every application will make use of some subset, and not every single feature of it’s machine’s arrays, so don’t be daunted. Sometimes the job can be done with very little modification.

    INPUT statements may be an issue. Some parse input differently.

    Does you machine have LINE INPUT, or just INPUT?

    INPUT splits the input into multiple variables on commas in the input, whereas LINE INPUT puts the entire line into one variable.

    File operations like OPEN and CLOSE will accept different arguments.

    This can be quite tricky.

    Since you have made it this far into the blog post, please consider the following table of conversions between my most used BASICS:

    DartmouthAPPLESOFTATARI 8-BITBBC BASICCOMMODORE BASIC V2
    OPENFILE #file, “filenameOPEN filenameOPEN #fileno,mode control code,filenamevar = OPENIN, var = OPENOUTOPEN #exp, fileno, mode, “filename”
    CLOSECLOSE “filenameCLOSE #fileno, #filenoCLOSE #fileno; CLOSE #0 (all files)CLOSE #fileno
    LOADLOAD filenameLOAD “disk:filenameLOAD “filenameLOAD “filename“,8,[disk]
    PRINTPRINT #file, record, …PRINT exp, exp, …PRINT #fileno, record, record, …PRINT #filename, record, record, …PRINT #fileno, record, record, …
    INPUTINPUT #file, record, …INPUT [string,] var, var, …INPUT #[file,disk] varINPUT #filename, record, record, …INPUT “string” var, var, …

    Is your BASIC indexed from one (1) or zero (0)?

    Because this is an easy one. Convert every index accordingly:

    (e.g.) DIM A(255) -> DIM A(256)
    
    (e.g.) FOR I=0 TO 255 -> FOR I=1 TO 256
  • Introduction

    Introduction

    The original purpose of this project was to design and then construct computers that would be able to survive a societal collapse.

    After working on the project, it became apparent that the point of the project should not be to imagine a hypothetical future, but to engage practically with the problems of the present.

    The entire computing stack of the modern era is large, confusing, and unsafe. People would rather excuse themselves from having to learn about it. Who can blame them?

    The first aim of the project is to be exceedingly cost effective: “if the oppressed cannot access some technology, then it is not revolutionary”.

    The second aim of the project is the promotion of digital literacy. Digital literacy should promote a joyful user experience that is non-exploitative. It should also foster a sense of community–“no-one is an island”.

    To this end, the scope of the people’s permacomputer project was deliberately limited to programs around or just over 100 lines. Definitely not more than 200.

    The project therefore decided to investigate BASIC as the paradigmatic human-computer interface for the permacomputer.

    For the application towards which it was targeted, the investigation the project has done so far into BASIC has been fruitful, and even quite surprising–the 70s/80s hobby computing scene was far richer and more creative than the project previously assumed: not less than five (5) different text editors in BASIC were unearthed!