Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,43 @@ website](http://pascal.hansotten.com/px-descendants/pascal-m/pascal-m-2k1/).
However, do not report bugs on the CP/M-65 port to him --- [file bug reports
here](https://github.com/davidgiven/cpm65/issues/new) instead.

### The Forth

lbForth is a minimal Forth implementation but still contains a fair amount of
built in words. It is currently not included on the disks for the C64, VIC20
or BBC Micro due to lack of disk space.

The original source code is available [here](https://gist.github.com/lbruder/10007431).

It has been extended with the possibility to load a script from file at
startup if the filename is given as a command line argument, and a small
example file (`TRIANGLE.FRT`) is included:
```
: STAR 42 EMIT ;
: STARS 0 DO STAR LOOP ;
: TRIANGLE 1 + 1 DO I STARS CR LOOP ;
CR 10 TRIANGLE CR
```
When run from the command line it produces the following output:
```
A> LBFORTH TRIANGLE.FRT
lbForth for CP/M-65. Use BYE to exit.

*
**
***
****
*****
******
*******
********
*********
**********

END OF FILE
OK
```

### Utilities

`bin/cpmemu` contains a basic CP/M-65 user mode emulator and debugger. It'll run
Expand Down Expand Up @@ -645,3 +682,6 @@ and is available under the terms of the BSD 2-Clause License. See
`third_party/zmalloc` contains a copy of zmalloc, which is © 2024 by Ivo van
Poorten and is available under the terms of the 0BSD License. See
`third_party/zmalloc/LICENSE` for the full text.

`third_party/lbforth` contains a port of lbForth, which is © 2014 by Leif Bruder
and is released as Public Domain.
5 changes: 5 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
"0:hello.pas": "cpmfs+hello_pas_cpm",
}

FORTH_APPS = {
"0:lbforth.com": "third_party/lbforth",
"0:triangle.frt": "cpmfs+triangle_frt_cpm",
}

SERIAL_APPS = {
"0:xrecv.com": "apps+xrecv",
"0:xsend.com": "apps+xsend",
Expand Down
1 change: 1 addition & 0 deletions cpmfs/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
unixtocpm(name="demo_sub_cpm", src="./demo.sub")
unixtocpm(name="hello_asm_cpm", src="./hello.asm")
unixtocpm(name="hello_pas_cpm", src="./hello.pas")
unixtocpm(name="triangle_frt_cpm", src="./triangle.frt")
5 changes: 5 additions & 0 deletions cpmfs/triangle.frt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
: STAR 42 EMIT ;
: STARS 0 DO STAR LOOP ;
: TRIANGLE 1 + 1 DO I STARS CR LOOP ;
CR 10 TRIANGLE CR

4 changes: 3 additions & 1 deletion src/arch/apple2e/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
SCREEN_APPS_SRCS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)

llvmcfile(
Expand Down Expand Up @@ -71,7 +72,8 @@
format="appleiie",
bootimage=".+bios_shuffled",
size=143360,
items={} | SCREEN_APPS | SCREEN_APPS_SRCS | BIG_SCREEN_APPS | PASCAL_APPS,
items={} | SCREEN_APPS | SCREEN_APPS_SRCS | BIG_SCREEN_APPS | PASCAL_APPS
| FORTH_APPS,
)


Expand Down
10 changes: 7 additions & 3 deletions src/arch/atari800/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SCREEN_APPS_SRCS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)

llvmclibrary(name="headers", hdrs={"atari800.inc": "./atari800.inc"})
Expand Down Expand Up @@ -70,7 +71,8 @@
name="atari800c_rawdiskimage",
format="atari90",
size=128 * 720,
items={} | MINIMAL_APPS_SRCS | SCREEN_APPS_SRCS | BIG_APPS_SRCS,
items={} | MINIMAL_APPS_SRCS | SCREEN_APPS_SRCS | BIG_APPS_SRCS
| FORTH_APPS,
)

simplerule(
Expand Down Expand Up @@ -119,7 +121,8 @@
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

simplerule(
Expand Down Expand Up @@ -168,7 +171,8 @@
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

simplerule(
Expand Down
10 changes: 7 additions & 3 deletions src/arch/kim-1/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SCREEN_APPS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)

COMMODORE_ITEMS = (
Expand Down Expand Up @@ -126,7 +127,8 @@
| BIG_APPS_SRCS
| SCREEN_APPS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

mkcpmfs(
Expand All @@ -146,7 +148,8 @@
| BIG_APPS_SRCS
| SCREEN_APPS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

mkcpmfs(
Expand All @@ -169,7 +172,8 @@
| BIG_APPS_SRCS
| SCREEN_APPS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

mkimd(name="diskimage-k1013", src=".+rawdiskimage-k1013")
Expand Down
4 changes: 3 additions & 1 deletion src/arch/nano6502/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
PASCAL_APPS,
SERIAL_APPS,
SERIAL_SCREEN_APPS,
FORTH_APPS,
)

llvmrawprogram(
Expand Down Expand Up @@ -38,7 +39,8 @@
| BIG_SCREEN_APPS
| PASCAL_APPS
| SERIAL_APPS
| SERIAL_SCREEN_APPS,
| SERIAL_SCREEN_APPS
| FORTH_APPS,
)

mkcpmfs(
Expand Down
2 changes: 2 additions & 0 deletions src/arch/neo6502/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
SCREEN_APPS_SRCS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)
import re

Expand Down Expand Up @@ -78,6 +79,7 @@
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS
| PASCAL_APPS
| FORTH_APPS
).items()
},
)
4 changes: 3 additions & 1 deletion src/arch/oric/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
SCREEN_APPS_SRCS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)

llvmcfile(
Expand Down Expand Up @@ -53,7 +54,8 @@
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

mkoricdsk(name="diskimage", src=".+cpmfs")
Expand Down
19 changes: 13 additions & 6 deletions src/arch/osi/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
SCREEN_APPS_SRCS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)

# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -114,7 +115,8 @@
}
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS,
| BIG_SCREEN_APPS
| FORTH_APPS,
)

img2osi(
Expand Down Expand Up @@ -204,7 +206,8 @@
| BIG_APPS
| PASCAL_APPS
| MINIMAL_APPS_SRCS
| BIG_APPS_SRCS,
| BIG_APPS_SRCS
| FORTH_APPS,
)

mkcpmfs(
Expand All @@ -224,7 +227,8 @@
| BIG_APPS_SRCS
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS,
| BIG_SCREEN_APPS
| FORTH_APPS,
)

mkcpmfs(
Expand All @@ -241,7 +245,8 @@
| BIG_APPS
| PASCAL_APPS
| MINIMAL_APPS_SRCS
| BIG_APPS_SRCS,
| BIG_APPS_SRCS
| FORTH_APPS,
)

mkcpmfs(name="osif-b_rawdiskimage", format="osi8", size=128 * 1848, items={})
Expand Down Expand Up @@ -299,7 +304,8 @@
| BIG_APPS_SRCS
| SCREEN_APPS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS,
| BIG_SCREEN_APPS
| FORTH_APPS,
)

img2osi(
Expand Down Expand Up @@ -351,7 +357,8 @@
| MINIMAL_APPS_SRCS
| BIG_APPS_SRCS
| SCREEN_APPS_SRCS
| BIG_SCREEN_APPS,
| BIG_SCREEN_APPS
| FORTH_APPS,
)

mkcpmfs(
Expand Down
4 changes: 3 additions & 1 deletion src/arch/snes/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
SCREEN_APPS,
BIG_SCREEN_APPS,
PASCAL_APPS,
FORTH_APPS,
)

llvmrawprogram(
Expand All @@ -36,7 +37,8 @@
| BIG_APPS
| SCREEN_APPS
| BIG_SCREEN_APPS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

simplerule(
Expand Down
4 changes: 3 additions & 1 deletion src/arch/sorbus/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
BIG_APPS_SRCS,
PASCAL_APPS,
SERIAL_APPS,
FORTH_APPS,
)

llvmrawprogram(
Expand All @@ -27,7 +28,8 @@
| BIG_APPS
| BIG_APPS_SRCS
| PASCAL_APPS
| SERIAL_APPS,
| SERIAL_APPS
| FORTH_APPS,
)

zip(
Expand Down
4 changes: 3 additions & 1 deletion src/arch/x16/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
BIG_APPS,
BIG_APPS_SRCS,
PASCAL_APPS,
FORTH_APPS,
)

llvmrawprogram(
Expand All @@ -25,7 +26,8 @@
| MINIMAL_APPS_SRCS
| BIG_APPS
| BIG_APPS_SRCS
| PASCAL_APPS,
| PASCAL_APPS
| FORTH_APPS,
)

zip(
Expand Down
9 changes: 9 additions & 0 deletions third_party/lbforth/build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from build.ab import Rule, Target, Targets, simplerule
from build.llvm import llvmprogram
from tools.build import unixtocpm

llvmprogram(
name="lbforth",
srcs=["./lbforth.c"],
deps=["lib+cpm65"],
)
Loading