Skip to content

Commit da28dc5

Browse files
authored
Merge pull request #256 from venomix666/lbforth
Port of lbForth
2 parents d89d650 + d6c83ed commit da28dc5

File tree

16 files changed

+1326
-18
lines changed

16 files changed

+1326
-18
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,43 @@ website](http://pascal.hansotten.com/px-descendants/pascal-m/pascal-m-2k1/).
585585
However, do not report bugs on the CP/M-65 port to him --- [file bug reports
586586
here](https://github.com/davidgiven/cpm65/issues/new) instead.
587587
588+
### The Forth
589+
590+
lbForth is a minimal Forth implementation but still contains a fair amount of
591+
built in words. It is currently not included on the disks for the C64, VIC20
592+
or BBC Micro due to lack of disk space.
593+
594+
The original source code is available [here](https://gist.github.com/lbruder/10007431).
595+
596+
It has been extended with the possibility to load a script from file at
597+
startup if the filename is given as a command line argument, and a small
598+
example file (`TRIANGLE.FRT`) is included:
599+
```
600+
: STAR 42 EMIT ;
601+
: STARS 0 DO STAR LOOP ;
602+
: TRIANGLE 1 + 1 DO I STARS CR LOOP ;
603+
CR 10 TRIANGLE CR
604+
```
605+
When run from the command line it produces the following output:
606+
```
607+
A> LBFORTH TRIANGLE.FRT
608+
lbForth for CP/M-65. Use BYE to exit.
609+
610+
*
611+
**
612+
***
613+
****
614+
*****
615+
******
616+
*******
617+
********
618+
*********
619+
**********
620+
621+
END OF FILE
622+
OK
623+
```
624+
588625
### Utilities
589626
590627
`bin/cpmemu` contains a basic CP/M-65 user mode emulator and debugger. It'll run
@@ -645,3 +682,6 @@ and is available under the terms of the BSD 2-Clause License. See
645682
`third_party/zmalloc` contains a copy of zmalloc, which is © 2024 by Ivo van
646683
Poorten and is available under the terms of the 0BSD License. See
647684
`third_party/zmalloc/LICENSE` for the full text.
685+
686+
`third_party/lbforth` contains a port of lbForth, which is © 2014 by Leif Bruder
687+
and is released as Public Domain.

config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@
6666
"0:hello.pas": "cpmfs+hello_pas_cpm",
6767
}
6868

69+
FORTH_APPS = {
70+
"0:lbforth.com": "third_party/lbforth",
71+
"0:triangle.frt": "cpmfs+triangle_frt_cpm",
72+
}
73+
6974
SERIAL_APPS = {
7075
"0:xrecv.com": "apps+xrecv",
7176
"0:xsend.com": "apps+xsend",

cpmfs/build.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
unixtocpm(name="demo_sub_cpm", src="./demo.sub")
77
unixtocpm(name="hello_asm_cpm", src="./hello.asm")
88
unixtocpm(name="hello_pas_cpm", src="./hello.pas")
9+
unixtocpm(name="triangle_frt_cpm", src="./triangle.frt")

cpmfs/triangle.frt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
: STAR 42 EMIT ;
2+
: STARS 0 DO STAR LOOP ;
3+
: TRIANGLE 1 + 1 DO I STARS CR LOOP ;
4+
CR 10 TRIANGLE CR
5+

src/arch/apple2e/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
SCREEN_APPS_SRCS,
1010
BIG_SCREEN_APPS,
1111
PASCAL_APPS,
12+
FORTH_APPS,
1213
)
1314

1415
llvmcfile(
@@ -71,7 +72,8 @@
7172
format="appleiie",
7273
bootimage=".+bios_shuffled",
7374
size=143360,
74-
items={} | SCREEN_APPS | SCREEN_APPS_SRCS | BIG_SCREEN_APPS | PASCAL_APPS,
75+
items={} | SCREEN_APPS | SCREEN_APPS_SRCS | BIG_SCREEN_APPS | PASCAL_APPS
76+
| FORTH_APPS,
7577
)
7678

7779

src/arch/atari800/build.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
SCREEN_APPS_SRCS,
1111
BIG_SCREEN_APPS,
1212
PASCAL_APPS,
13+
FORTH_APPS,
1314
)
1415

1516
llvmclibrary(name="headers", hdrs={"atari800.inc": "./atari800.inc"})
@@ -70,7 +71,8 @@
7071
name="atari800c_rawdiskimage",
7172
format="atari90",
7273
size=128 * 720,
73-
items={} | MINIMAL_APPS_SRCS | SCREEN_APPS_SRCS | BIG_APPS_SRCS,
74+
items={} | MINIMAL_APPS_SRCS | SCREEN_APPS_SRCS | BIG_APPS_SRCS
75+
| FORTH_APPS,
7476
)
7577

7678
simplerule(
@@ -119,7 +121,8 @@
119121
| SCREEN_APPS
120122
| SCREEN_APPS_SRCS
121123
| BIG_SCREEN_APPS
122-
| PASCAL_APPS,
124+
| PASCAL_APPS
125+
| FORTH_APPS,
123126
)
124127

125128
simplerule(
@@ -168,7 +171,8 @@
168171
| SCREEN_APPS
169172
| SCREEN_APPS_SRCS
170173
| BIG_SCREEN_APPS
171-
| PASCAL_APPS,
174+
| PASCAL_APPS
175+
| FORTH_APPS,
172176
)
173177

174178
simplerule(

src/arch/kim-1/build.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
SCREEN_APPS,
1111
BIG_SCREEN_APPS,
1212
PASCAL_APPS,
13+
FORTH_APPS,
1314
)
1415

1516
COMMODORE_ITEMS = (
@@ -126,7 +127,8 @@
126127
| BIG_APPS_SRCS
127128
| SCREEN_APPS
128129
| BIG_SCREEN_APPS
129-
| PASCAL_APPS,
130+
| PASCAL_APPS
131+
| FORTH_APPS,
130132
)
131133

132134
mkcpmfs(
@@ -146,7 +148,8 @@
146148
| BIG_APPS_SRCS
147149
| SCREEN_APPS
148150
| BIG_SCREEN_APPS
149-
| PASCAL_APPS,
151+
| PASCAL_APPS
152+
| FORTH_APPS,
150153
)
151154

152155
mkcpmfs(
@@ -169,7 +172,8 @@
169172
| BIG_APPS_SRCS
170173
| SCREEN_APPS
171174
| BIG_SCREEN_APPS
172-
| PASCAL_APPS,
175+
| PASCAL_APPS
176+
| FORTH_APPS,
173177
)
174178

175179
mkimd(name="diskimage-k1013", src=".+rawdiskimage-k1013")

src/arch/nano6502/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
PASCAL_APPS,
1212
SERIAL_APPS,
1313
SERIAL_SCREEN_APPS,
14+
FORTH_APPS,
1415
)
1516

1617
llvmrawprogram(
@@ -38,7 +39,8 @@
3839
| BIG_SCREEN_APPS
3940
| PASCAL_APPS
4041
| SERIAL_APPS
41-
| SERIAL_SCREEN_APPS,
42+
| SERIAL_SCREEN_APPS
43+
| FORTH_APPS,
4244
)
4345

4446
mkcpmfs(

src/arch/neo6502/build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
SCREEN_APPS_SRCS,
1212
BIG_SCREEN_APPS,
1313
PASCAL_APPS,
14+
FORTH_APPS,
1415
)
1516
import re
1617

@@ -78,6 +79,7 @@
7879
| SCREEN_APPS_SRCS
7980
| BIG_SCREEN_APPS
8081
| PASCAL_APPS
82+
| FORTH_APPS
8183
).items()
8284
},
8385
)

src/arch/oric/build.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
SCREEN_APPS_SRCS,
1010
BIG_SCREEN_APPS,
1111
PASCAL_APPS,
12+
FORTH_APPS,
1213
)
1314

1415
llvmcfile(
@@ -53,7 +54,8 @@
5354
| SCREEN_APPS
5455
| SCREEN_APPS_SRCS
5556
| BIG_SCREEN_APPS
56-
| PASCAL_APPS,
57+
| PASCAL_APPS
58+
| FORTH_APPS,
5759
)
5860

5961
mkoricdsk(name="diskimage", src=".+cpmfs")

0 commit comments

Comments
 (0)