-
Using the MPF-1P Printer and PicoRAM 6116 simultaneously
04/13/2024 at 19:47 • 0 commentsLet's print out a solution for the Towers of Hanoi with 5 disks:
-
The Towers of Hanoi on the MPF-1P!
04/12/2024 at 17:54 • 0 comments -
Next-Level Software Development with PicoRAM 6116
02/26/2024 at 05:58 • 0 commentsPicoRAM 6116 is taking Microprofessor MPF-1B software development to the next level - instead of keying in hex codes with the monitor, use a comfortable state-of-the.art Z80 assembler on the PC or Mac, assemble / compile the HEX file there, put it on SD card, and feed it to the Microprofessor! In this video I am developing a "Towers of Hanoi" program for the MPF-1B (recursive version) using asm80.com:
-
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!