This project is read-only.

About Script6502

Script6502 is a new scripting language designed to be implemented on all 6502-based platforms.  The core language is very sparse, including only functionality necessary to implement a full language.  Script6502 uses delegates to provide a simple and clean interface between the runtime and the host computer (see examples below).

Script6502 Language Specification

See the documentation for a full explanation of the Script6502 language.

Script6502 Examples

// Script6502 Example program 1 - hello world for Commodore 64
CONST
    Str hw = "Hello, world^N"
CEND

DELEGTES
    Del PrintStr(Str) : Void
    Del PrintChr(I16) : Void
    NDel OutChar(U16, A, X, Y)
DEND

FUNCTIONS
    // C64 specific. Defines the kernal function for delegate OutChar for CHROUT.
    // Specifies that the Accumulator is used, but not X and Y registers
    OutChar ($FFD2, 1, 0, 0)

    // Generic function that implemented delegate PrintCharacter
    PrintChr
    FBEGIN
        OutChar(param, 0, 0)
    FEND

    // Generic function that implements delegate PrintString
    PrintStr 
    FBEGIN
        FOR(0, LEN(param), 1, PrintChr)
    FEND
FUNEND

MAIN
    CALLP(PrintStr(hw))
    SETA(0)
MEND

Last edited Apr 19, 2015 at 3:24 AM by plbyrd, version 3