Repository navigation
Retrocomputing - Forth for PDP-7 #206
MitchBradley
started this conversation in
Show and tell
Replies: 4 comments 1 reply
|
That sounds like a great presentation for the monthly SVFIG Zoom
meeting. If you don't want to do a full-up presentation, perhaps a 10
or 15 minute overview on Forth Day.
Anyone who wishes to present to SVFIG is welcome to contact me at
***@***.***
…On 9/26/2026 7:01 PM, Mitch Bradley wrote:
Inspired by a friend who is working on a PDP-7 (the computer on which
Unix was first developed) emulator, I asked Claude to help me develop
a PDP-7 Forth with Turtle Graphics <https://MitchBradley/pdp7forth> .
It fits in 2K of the machine's 8K 18-bit words, including stacks and
buffers, with an additional 1K words wired down for the graphics
buffer. It is fairly complete as old-school Forths go, but I didn't
bother to implement CREATE .. DOES> . The thread format is native
machine instructions - calls to primitives are JMP
instructions, colon defs are called by CAL , constants and literals
are LAC , and variables are LAW . To save space, it uses the ancient
3-characters+count header format, with each header taking exactly 2
words.
FIND is 22 instructions. NEXT is 1 instruction in the usual case, and
3 for constants and variables. Pushing onto the stack is cheap, but
popping takes 6 instructions due to the way that auto-incrementing
(but not auto-decrementing) index registers work. BRANCH and ?BRANCH
are pretty conventional for a threaded code Forth - the branch offset
follows the primitive in the body.
The turtle graphics package is 113 lines of Forth code, compiling to
700 words.
You can load files from emulated paper tape. You can run conditionals
and loops directly from interpret state using the temporary
compilation technique that I developed for Open Firmware. Here is a
Turtle Graphics drawing and its code:
|: SQ 4 0 DO 200 FD 90 RT LOOP ; OK 8 0 DO SQ 45 RT LOOP OK |
Image: image (view on web)
<https://github.com/user-attachments/assets/55b55bce-5294-4b59-a55b-c591a5e0e3a3>
—
Reply to this email directly, view it on GitHub
<#206?email_source=notifications&email_token=ADUZY7BLZOUHSQMWJJVAUDL5RBYJFA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDQOJWG4YDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADUZY7FJYFZVUDFZ5RL2G5T5RBYJFAVCNFSNUABHKJSXA33TNF2G64TZHMZTCNBRGQ2DCNR3IRUXGY3VONZWS33OHMYTAOBZGY3TAM5BOYBA>.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ADUZY7GREQKHEMAV27UHUMD5RBYJFA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDQOJWG4YDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/ADUZY7DT44KJ3JCB4LEGU7L5RBYJFA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDQOJWG4YDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you are subscribed to this
thread.Message ID: ***@***.***>
|
0 replies
|
When is forth day this year?
On Sep 27, 2026, at 11:48 AM, Kevin Appert ***@***.***> wrote:
That sounds like a great presentation for the monthly SVFIG Zoom
meeting. If you don't want to do a full-up presentation, perhaps a 10
or 15 minute overview on Forth Day.
Anyone who wishes to present to SVFIG is welcome to contact me at
***@***.***
|
0 replies
|
By long tradition, Forth Day is the third Saturday of November. This
year, that falls on 21 November 2026.
December is also the third Saturday. All the rest of the year the
monthly meetings are on the fourth Saturday.
forther at comcast dot net
…On 9/27/2026 7:02 PM, Mitch Bradley wrote:
When is forth day this yearOn Sep 27, 2026, at 11:48 AM, Kevin Appert
***@***.***> wrote:
That sounds like a great presentation for the monthly SVFIG Zoom
meeting. If you don't want to do a full-up presentation, perhaps a 10
or 15 minute overview on Forth Day.
Anyone who wishes to present to SVFIG is welcome to contact me at
***@***.***
On 9/26/2026 7:01 PM, Mitch Bradley wrote:
>
> Inspired by a friend who is working on a PDP-7 (the computer on which
> Unix was first developed) emulator, I asked Claude to help me develop
> a PDP-7 Forth with Turtle Graphics <https://MitchBradley/pdp7forth> .
> It fits in 2K of the machine's 8K 18-bit words, including stacks and
> buffers, with an additional 1K words wired down for the graphics
> buffer. It is fairly complete as old-school Forths go, but I didn't
> bother to implement CREATE .. DOES> . The thread format is native
> machine instructions - calls to primitives are JMP
>
> instructions, colon defs are called by CAL , constants and literals
> are LAC , and variables are LAW . To save space, it uses the ancient
> 3-characters+count header format, with each header taking exactly 2
> words.
>
> FIND is 22 instructions. NEXT is 1 instruction in the usual case, and
> 3 for constants and variables. Pushing onto the stack is cheap, but
> popping takes 6 instructions due to the way that auto-incrementing
> (but not auto-decrementing) index registers work. BRANCH and ?BRANCH
> are pretty conventional for a threaded code Forth - the branch offset
> follows the primitive in the body.
>
> The turtle graphics package is 113 lines of Forth code, compiling to
> 700 words.
>
> You can load files from emulated paper tape. You can run conditionals
> and loops directly from interpret state using the temporary
> compilation technique that I developed for Open Firmware. Here is a
> Turtle Graphics drawing and its code:
>
> |: SQ 4 0 DO 200 FD 90 RT LOOP ; OK 8 0 DO SQ 45 RT LOOP OK |
> Image: image (view on web)
>
<https://github.com/user-attachments/assets/55b55bce-5294-4b59-a55b-c591a5e0e3a3>
>
>
> —
> Reply to this email directly, view it on GitHub
>
<#206?email_source=notifications&email_token=ADUZY7BLZOUHSQMWJJVAUDL5RBYJFA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDQOJWG4YDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L>,
> or unsubscribe
>
<https://github.com/notifications/unsubscribe-auth/ADUZY7FJYFZVUDFZ5RL2G5T5RBYJFAVCNFSNUABHKJSXA33TNF2G64TZHMZTCNBRGQ2DCNR3IRUXGY3VONZWS33OHMYTAOBZGY3TAM5BOYBA>.
> Triage notifications, keep track of coding agent tasks and review pull
> requests on the go with GitHub Mobile for iOS
>
<https://github.com/notifications/mobile/ios/ADUZY7GREQKHEMAV27UHUMD5RBYJFA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDQOJWG4YDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KUZTPN52GK4S7NFXXG>
> and Android
>
<https://github.com/notifications/mobile/android/ADUZY7DT44KJ3JCB4LEGU7L5RBYJFA5CNFSNUABBM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63RPGEYDQOJWG4YDHJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
> Download it today!
> You are receiving this because you are subscribed to this
> thread.Message ID: ***@***.***>
>
—Reply to this email directly, view it on GitHub, or unsubscribe.You
are receiving this because you authored the thread.Message ID:
***@***.***>
—
Reply to this email directly, view it on GitHub
<#206?email_source=notifications&email_token=ADUZY7DGHFQ5K3B4QQ5C25L5RHBC3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBWGMZDANZYUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-18632078>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADUZY7BLDT4SFPTS6CSBQ3T5RHBC3AVCNFSNUABHKJSXA33TNF2G64TZHMZTCNBRGQ2DCNR3IRUXGY3VONZWS33OHMYTAOBZGY3TAM5BOYBA>.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ADUZY7ATWJ7E2JT4L7TXRVD5RHBC3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBWGMZDANZYUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/ADUZY7BUZSOWOHHYPMJLMT35RHBC3A5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBWGMZDANZYUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you commented.Message ID:
***@***.***>
|
0 replies
|
I wrote a Forth for the IMLAC PDS-1 a while back. That machine is much like a 16-bit version of a PDP-7, with an added display processor, CRT for vector graphics, and keyboard. I elected to use subroutine threading with inlining of some primitives. I used an auto incrementing index location for the stack pointer, so e.g. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Inspired by a friend who is working on a PDP-7 (the computer on which Unix was first developed) emulator, I asked Claude to help me develop a PDP-7 Forth with Turtle Graphics . It fits in 2K of the machine's 8K 18-bit words, including stacks and buffers, with an additional 1K words wired down for the graphics buffer. It is fairly complete as old-school Forths go, but I didn't bother to implement CREATE .. DOES> . The thread format is native machine instructions - calls to primitives are JMP
instructions, colon defs are called by CAL , constants and literals are LAC , and variables are LAW . To save space, it uses the ancient 3-characters+count header format, with each header taking exactly 2 words.FIND is 22 instructions. NEXT is 1 instruction in the usual case, and 3 for constants and variables. Pushing onto the stack is cheap, but popping takes 6 instructions due to the way that auto-incrementing (but not auto-decrementing) index registers work. BRANCH and ?BRANCH are pretty conventional for a threaded code Forth - the branch offset follows the primitive in the body.
The turtle graphics package is 113 lines of Forth code, compiling to 700 words.
You can load files from emulated paper tape. You can run conditionals and loops directly from interpret state using the temporary compilation technique that I developed for Open Firmware. Here is a Turtle Graphics drawing and its code:
All reactions