-
PicoRAM and the Microprofessor MPF-IP (One Plus)
12/25/2023 at 19:31 • 0 comments -
PicoRAM 6116 for the Microprofessor MPF-1B
12/18/2023 at 01:06 • 0 comments -
The Final FORTH Video is Available - DOER / MAKE on the Microprofessor
03/13/2022 at 07:45 • 0 commentsAs promised, we finally reached the end of our Forth exploration - Goodbye!
-
DOER / MAKE, ;AND and UNDO on the Microprofessor
03/12/2022 at 02:26 • 0 commentsSo, my whole Forth-learning endeavor started about 3 months ago when I couldn't wrap my head around how to write a recursive version of the Factorial function with the Microprofessor Forth. I quickly found Leo Brodie's excellent forthward-thinking "THINKING FORTH" book, and learned that this can be a use-case for DOER/MAKE. However, none of the 6 printed versions from the Appendix in the book would work out-of-the box on the Microprofessor, and what was worse, I only understood 20% of it! Having a PhD in computer science with quite a bit of background in programming languages, I couldn't accept this defeat by a > 50 year old language on an almost 40 year piece of Z80 hardware. So I had to figure it out, and it really took me down the FORTH rabbithole.
I became serious about learning FORTH. Starting with Brodie's other excellent book, "Starting FORT", the meager MPF-IP Forth manual, and a lot of experiments and Trial&Error, here I am, 3 months later, with a fully functional version of DOER, MAKE, &AND, and UNDO!
I will make one more MPF-IP Forth video in which I am going to share my findings - but here is already the code and examples as an exclusive preview to the upcoming video ;-)
Or, more readable:
: NOTHING ; : DOER CREATE ' NOTHING , DOES> @ >R ; VARIABLE MARKER : (MAKE) R> DUP 2+ DUP 2+ SWAP @ 4 + ! @ ?DUP IF >R THEN ; : MAKE COMPILE (MAKE) HERE MARKER ! 0 , ; IMMEDIATE : ;AND COMPILE EXIT HERE MARKER @ ! ; IMMEDIATE : UNDO ' NOTHING <COMPILE> ' ! ;
If you have no idea what that means, why it looks like an Ancient Alien Language, or what it is good for, then maybe it will motivate you to learn FORTH yourself! It is very rewarding once you figure it out.
Or watch my videos if you'd like to learn more about defining and compiling words, vectored execution, and similar black magic Death Star the Dark Side of the FORTH kind of stuff!
Here is a use-case. However, direct recursive definitions (words) are only one possible application for (the vectored execution of) DOER/MAKE (but the one I was after for):
DOER FAC : SETUP MAKE FAC DUP 1 > IF DUP 1- FAC * THEN ; SETUP 3 FAC . -> 6
Or, even indirect recursion is possible:
DOER ODD DOER EVEN : SETUPODD MAKE ODD DUP 2 < IF ELSE 1- EVEN THEN ; : SETUPEVEN MAKE EVEN DUP 2 < IF 1 SWAP - ELSE 1- ODD THEN ; SETUPODD SETUPEVEN 10 EVEN . -> 1 10 ODD . -> 0 11 EVEN . -> 0 11 ODD . -> 1
The Brodie book gives this example (slightly adjusted by myself), which also demonstrates :AND and UNDO:
DOER JOE : SETUPJOE MAKE JOE ." HI JOE " ; SETUPJOE JOE -> HI JOE FORGET SETUPJOE : SETUPJOE MAKE JOE ." HELLO JOE " ;AND ." NOW! "; SETUPJOE -> NOW! JOE -> HELLO JOE UNDO JOE JOE ->
Stay tuned for the video soon!
-
FORTH on the MPF-IP - Part 4 - Compiler Extensions & Recursion
02/27/2022 at 04:09 • 0 commentsThis time we are covering enough of FORTH to finally succeed at defining recursive words. The video is a bit longer this time (~1 hour), but it is done! If you want to learn how to extend the colon compiler by means of IMMEDIATE / compiling words, how to use COMPILE, LITERAL, and COMMA, and how to execute FORTH at compile time, then this video is for you. I also cover vectored execution, which lets you deal with forward references. We'll discuss various ways to implement a recursive version of the factorial function, and used self-defined defining and compiling words such as LABEL and REC to implement indirect recursion, using the classic ODD / EVEN example. I conclude by giving you some literature pointers and book recommendations. Maybe there will be one more (really final) video, in which I am going to share my version of the "standard" DOER / MAKE constructs - it wasn't easy to port this from Brodie's "Thinking FORTH"to the Microprofessor, so it is worth sharing. Next time though! So stay tuned for one more final video...
-
FORTH on the MPF-IP - Part 3 - The Dark Side of the FORTH
02/21/2022 at 17:43 • 0 commentsI know, I promised that I would demonstrate how to define (indirect) recursive words in this video, but the truth is - too much ground needs to be covered first, it would be incomprehensible otherwise! So, here we are going with the first "under the hood" video of the FORTH - THE DARK SIDE OF THE FORTH:
-
FORTH on the MPF-IP - Part 2
02/13/2022 at 23:47 • 0 commentsHere is my 2nd MPF-IP FORTH video; this time, we are taking a closer look at FORTH, and continue our exploration with do... loops, if else then, and write an iterative version of the factorial function - stay tuned for the next video!
-
News from @x48x4b - machine & Sargon chess code
02/13/2022 at 23:44 • 0 commentsI got another message from @x48x4b regarding his Microprofessor and the Sargon chess program; he writes:
"This is my machine from the 1980ies, in today's working condition: https://www.mycloud.ch/s/S00E8C2E8289DDE0E50B95028DFF9DB989ABBE58C10 It is an MPF-IP with the stock accessory boards IOM-MPF-IP and EPB-MPF-IP and 16k RAM. On the bread board section, I have installed an additional PIO, 4 motor drivers and 2 A/D converters. This was done in the 1980ies, to be used withe my Fischertechnik robot. Today, the accessory boards can occasionally be found on Ebay. The Sargon code for my MPF-IP is here: https://www.mycloud.ch/s/S007B47874D00053B738BFE0EA9720BCA96DFA769F "
I take the freedom to post hist machine here - what a setup!! A dream Microprofessor: -
FORTH on the MPF-IP - Part 1 (FORTH Basics)
02/06/2022 at 19:14 • 0 commentsAlright, that took a while... confident by now enough in my knowledge of the FORTH I am to attempt to present & demo it :-)
This is part 1 of ~ 3 parts that I am planning. Originally, I only wanted to define a recursive "factorial" word! That took me down the rabbit hole - from dictionaries, immediate words, over defining to compiling words - finally, I managed to implement CALL as well as DOER/MAKE. It'll take 2 more videos until we get there.
For now, here are the basics: FORTH background & history, installation, documentation & book, comments on meta-programming and "Forth in Forth", the stack, RPN (Reverse Polish Notation), HP calculators, simple user-defined words. Enjoy and stay tuned to hear more about this ingenious "alien" programming language on the MPF-IP!
-
x48x4b is running Sargon Chess on his MPF-IP!
02/03/2022 at 19:46 • 0 commentsVery cool info from @x48x4b - he ported the classic Sargon Chess to his MPF-IP as a Covid project. Just quoting his messages from the chat; this is too cool to be forgotten and left unnoticed in the chat, so turning this into a Log entry. @x48x4b wrote:
"An MPF-IP (with accessory boards) can be used to run a chess program, to see how, check out the following mkv-video (watch it on VLC):
https://www.mycloud.ch/s/S000DB711BCA0EE2949ADD0A240A68026A2650D987D
I had to modify the memory organisation and took out the video section. The original Sargon was installed on a Wavemate Jupiter III. This had a Z80. But e.g. it had a video board, which my MPF does not have. Instead I wrote a routine to direct the output to the serial interface. What I did not change at all are the chess algorithms. My current version uses x1d2d bytes excluding stack. I will tidy it up and post it somewhen.
It is the original IOM-MPF-IP experimental board from Multitech with a 8250 UART, a Zilog CTC and a bread board area. There are also sockets to add 3x2 kByte static RAM and other stuff. I purchased it in the 1980ies to drive my Fischertechnik Robot. Later the MPF-IP and the IOM-MPF-IP were stored away for more than 35 years on our attic. In the Corona lock down time, I reactivated it to have some fun. The reactivation turned out to be challenging because some of the chips had to be replaced, and some of the electrical contacts were bad. The goal of the project was to run the original Sargon chess program from Dan and Kathe Spracklen, which actually succeeded."
Looking forward to the code being released!Sadly, my 2 MPF-IPs only have 4 KBs of SRAM each, and no expansion boards besides the printer. I just ordered some SRAM chips. Maybe I am going to build my own extension board with additional SRAM, speech synth, and UART. Will see! But first I need to get the Forth videos out... soon!