<commit_before>#include "forth_common.th"

// A little Forth.

.set link, 0
.global __zero
__zero:
__boot:
    S <- [reloc(_PSPinit)]
    R <- [reloc(_RSPinit)]
    I <- reloc(QUIT)        // enter text interpreter
    goto(NEXT)

    .global _PSPinit
    .global _RSPinit
_PSPinit:   .word   0x007fffff
_RSPinit:   .word   0x00ffffff

// TODO smudge internal words
head(RESET_RSP,RESET_RSP): .word . + 1
    R <- [reloc(_RSPinit)]
    goto(NEXT)

head(NEXT,NEXT):
    W  <- [I]
    W  <-  rel(W)
    I  <-  I + 1
    X  <- [W]
    jmp(X)

head(ENTER,ENTER):
    // ENTER is special and does not have an interp-word entry
    push(R,I)
    I  <- W + 1
    goto(NEXT)

head(EXIT,EXIT):
    .word . + 1<commit_msg>Fit forth into guaranteed RAM space<commit_after>#include "forth_common.th"

// A little Forth.

.set link, 0
.global __zero
__zero:
__boot:
    S <- [reloc(_PSPinit)]
    R <- [reloc(_RSPinit)]
    I <- reloc(QUIT)        // enter text interpreter
    goto(NEXT)

    .global _PSPinit
    .global _RSPinit
_PSPinit:   .word   ((1 << 13) - 1)
_RSPinit:   .word   ((1 << 14) - 1)

// TODO smudge internal words
head(RESET_RSP,RESET_RSP): .word . + 1
    R <- [reloc(_RSPinit)]
    goto(NEXT)

head(NEXT,NEXT):
    W  <- [I]
    W  <-  rel(W)
    I  <-  I + 1
    X  <- [W]
    jmp(X)

head(ENTER,ENTER):
    // ENTER is special and does not have an interp-word entry
    push(R,I)
    I  <- W + 1
    goto(NEXT)

head(EXIT,EXIT):
    .word . + 1
{'fraction_non_alphanumeric': 0.14835164835164835, 'fraction_numerical': 0.017170329670329672, 'mean_word_length': 2.1812227074235806, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1261234', 'n_tokens_mistral': 640, 'n_tokens_neox': 586, 'n_words': 152}