By building my own "TTL" homebrew cpu I've learned the hard way that whilst this video is alluring it doesn't explain the limitations and tradeoffs of the minimalistic approach. I don't have an academic compsci background and had never written an assembler or compiler before starting work on my own homebrew TTL cpu but ... as your instruction set and assembler becomes more sophisticated then a multipass assembler becomes increasingly complex and a tangle. In my experience parsing the ASM into an abstract syntax tree and then evaluating the tree, tend to lead to a more extensible and cleaner design. The benefits of the AST approach / lesson learned became more obvious as a learning exercise once one tries to build a high level language (eg something C like or whatever) for your home brew cpu - don't try it without an AST unless you love exercises in complexity. So I'd see the more scalable AST based approach for an assembler as a sensible stepping stone in learning how to build a compiler, but the multipass approach is definitely the initial approach most folk will end up with unless they have the premonition of storms ahead. AST's tend to end up using recursion as opposed to the itertive approach of multipass - but the result is worth it from a scalability point of view..
John, from a standpoint of a serious developer I am absolute with you! But since I am only interested in very basic principles and since I am well aware of the overall limitations of my hardware I won't make the mistake of trying to push things too far on this little platform. It's simply not "worth" it :-) Having that said: I have just finished math expression parsing, a text editor and will soon finish a native assembler. Another "Minimal" team member (a senior software developer) is working on a BASIC JIT compiler. He is working wonders on this architecture and has already completed a FIG Forth :-) Stay tuned...
@@slu467 Right! The Minimal family is growing. A FORTH programming environment is available via Github. Look for "Minimal-FORTH". A modern BASIC is on its way. I hope to have it available via Github during the summer.
Thanks for this, I want to write my own for my own minimal computer design and it's nice to see a method used. I need to finish up this very of the minimal soon as well!
Perfect video for my computer architecture thirst on a Saturday morning! Fascinating explanation of assembler operation and a great in insight into some broad Python concepts. A veritable tour de force!
You should use regular expressions instead of these string functions. Makes your code smaller, faster and more readable (assuming you learned regex, which I advise all).
Lovely. I'm trying to make an assembly language for a programming game. I won't quite translate it to bytecode, instead I'll transpile it to Lua. I thought it would be fun to explore youtube for some videos about assemblers.
Hi, if you are referring to the Minimal UART 1.5 please consult the reference manual. The link is given in the video descriptions of this series or in the GitHub readme.
dude... you are a genius.... now come up with a highly optimized ISA of 255 instructions (byte size)... a 16 32bit register CPU with all registers also byte#4/word#2 addressable... a 32 bit addressable memory space... (a optional version will be 64 bit addressable) and you are in the right track for the cheap Universal-Processor that will be pervasive to all controllable devices... ;-)
Will the upcoming Minimal CPU 1.5 require a board revision, or just a flash chip upgrade to something like the 28SF040? Just wanting to verify before I order boards.
Hi John, I suggest you wait for the revision 1.5 to come out. I am just starting work on the release video. The hardware is long finished. It *will* require a new board - but it will we worth it promise (double speed, 512KB SSD and an expansion port to connect *anything*). Cheers!
@@slu467 Thank you. I am anxious to learn (have built Ben Eater and a couple each 6502 and Z80 SBCs, but really want to understand the real fundamentals you are teaching) and look forward to 1.5. Your explanation videos are top notch.
Hi Daniel, yes, now I'll port this over to the Minimal to have it run natively. But I'll need a simple editor, too. FORTH already exists! See the post of Nils Kullberg further below with the link therein. He is part of the 'Minimal' development team and is currently working wonders on a 'Minimal BASIC' using a JIT compiler - also running natively.
osea... estas traduciendo el codigo en hexadecimal para insertarlo en texto nuevamente y executarlo.. ... no seria mas facil y menos lineas traducir el hex dentro de un buffer y despues ejecutarlo al viejo y puro estilo de un shell code ? ..porque veo que de todas maneras veo que estas compilandolo el codigo asm para ver el codigo hexadecimal de las instrucciones..
Hi, back in the old days a "first" assembler on a new platform had to be coded in machine language on a piece of paper and written into memory directly via front panel toggle switches (see PDP-8 for example) Very painful indeed ;-)
I really like what you've done here. I'd like to have an assembler where the source file actually IS the Python (well, I'd prefer Ruby - but it's all the same) that way any constants or assemble-time expressions can be prepared or calculated in a nice scripting language. (we had something like this for the 6502 in BBC BASIC back in the 1980s) I've been looking at github.com/keystone-engine/keystone but it's far too complicated... I'm thinking I might be able to do something using a more minimal approach... and you've inspired me to try this again now.
Glad to hear that it inspired you! But beware, this approach is (barely) okay for simple assembler syntax. It is way too unsophisticated to parse any "higher" language. One would need to implement expressions with BNF and stuff... and you are well over 32KB land...
@@slu467 most of what I do is little microcontrollers and 32k is pretty much my upper limit. :) but I am worried that my ISAs might be a bit too complex for a minimal minimal approach.... I'll have to see how it pans out.
By building my own "TTL" homebrew cpu I've learned the hard way that whilst this video is alluring it doesn't explain the limitations and tradeoffs of the minimalistic approach. I don't have an academic compsci background and had never written an assembler or compiler before starting work on my own homebrew TTL cpu but ... as your instruction set and assembler becomes more sophisticated then a multipass assembler becomes increasingly complex and a tangle. In my experience parsing the ASM into an abstract syntax tree and then evaluating the tree, tend to lead to a more extensible and cleaner design. The benefits of the AST approach / lesson learned became more obvious as a learning exercise once one tries to build a high level language (eg something C like or whatever) for your home brew cpu - don't try it without an AST unless you love exercises in complexity. So I'd see the more scalable AST based approach for an assembler as a sensible stepping stone in learning how to build a compiler, but the multipass approach is definitely the initial approach most folk will end up with unless they have the premonition of storms ahead. AST's tend to end up using recursion as opposed to the itertive approach of multipass - but the result is worth it from a scalability point of view..
John, from a standpoint of a serious developer I am absolute with you! But since I am only interested in very basic principles and since I am well aware of the overall limitations of my hardware I won't make the mistake of trying to push things too far on this little platform. It's simply not "worth" it :-)
Having that said: I have just finished math expression parsing, a text editor and will soon finish a native assembler. Another "Minimal" team member (a senior software developer) is working on a BASIC JIT compiler. He is working wonders on this architecture and has already completed a FIG Forth :-) Stay tuned...
Another solid video, clear,coscise and to the point.
Thank you for sharing Slu4.
Glad you find it useful!
Another beautifully minimalistic tool for the Minimal CPU. Way to go @Slu4 !
Thank you, Nisse :-D I've heard you're working on some amazing stuff for the Minimal CPU, too... Forth, BASIC, JIT compiler...
@@slu467 Right! The Minimal family is growing. A FORTH programming environment is available via Github. Look for "Minimal-FORTH". A modern BASIC is on its way. I hope to have it available via Github during the summer.
@@NilsKullberg Awesome, Nils! That's takin' it to the next level :-D Thanks for being part of the 'Minimal' team!
This was very helpful video. My CPU was waiting for an assembler until I found this video.
Well done, I'm surprised yet another time. This minimalizm idea is so addictive.
Hi Dariusz, you are right... once you start with it...
This channel deserves more subscribers, likes and views
Thanks for this, I want to write my own for my own minimal computer design and it's nice to see a method used. I need to finish up this very of the minimal soon as well!
Hi Aaron, happy to hear that you can use it or your own design :-)
damn, that's an incredible video; just asking, do you have a discord server?
There is a user forum available at minimal-cpu-system.boards.net/
Perfect video for my computer architecture thirst on a Saturday morning! Fascinating explanation of assembler operation and a great in insight into some broad Python concepts. A veritable tour de force!
Thanks, glad you like the way I build my assembler. It *is* a bit off the beaten track I've heard...
Thanks mate, your videos help me a ton!
Man !! You are incredible!!!
Thanks a lot, Francois. Glad you like this stuff, too :-)
Great content as always. Thank you!
Thanks for tuning in, Adam!
You should use regular expressions instead of these string functions. Makes your code smaller, faster and more readable (assuming you learned regex, which I advise all).
CallousCoder, this asm was meant to be portable to a *very* limited machine. Hence, I only use the very basics.
@@slu467 and then you code in Python? C with preg lib or even C++ with stl would’ve been just as portable.
Lovely. I'm trying to make an assembly language for a programming game. I won't quite translate it to bytecode, instead I'll transpile it to Lua. I thought it would be fun to explore youtube for some videos about assemblers.
can someone give list of syntax so I can understand what these mnemonics stand for?
Hi, if you are referring to the Minimal UART 1.5 please consult the reference manual. The link is given in the video descriptions of this series or in the GitHub readme.
Einfach toll! Danke!
:-D
dude... you are a genius....
now come up with a highly optimized ISA of 255 instructions (byte size)...
a 16 32bit register CPU with all registers also byte#4/word#2 addressable...
a 32 bit addressable memory space... (a optional version will be 64 bit addressable)
and you are in the right track for the cheap Universal-Processor that will be pervasive to all controllable devices... ;-)
Will the upcoming Minimal CPU 1.5 require a board revision, or just a flash chip upgrade to something like the 28SF040? Just wanting to verify before I order boards.
Hi John, I suggest you wait for the revision 1.5 to come out. I am just starting work on the release video. The hardware is long finished. It *will* require a new board - but it will we worth it promise (double speed, 512KB SSD and an expansion port to connect *anything*). Cheers!
@@slu467 Thank you. I am anxious to learn (have built Ben Eater and a couple each 6502 and Z80 SBCs, but really want to understand the real fundamentals you are teaching) and look forward to 1.5. Your explanation videos are top notch.
the source code for the assembler is missing on your github link. please reupload
Amazing!!!!Cool :)
That was very interesting. So now you can write you assembler in assembler and not need python, then after that Forth or C ?
Hi Daniel, yes, now I'll port this over to the Minimal to have it run natively. But I'll need a simple editor, too.
FORTH already exists! See the post of Nils Kullberg further below with the link therein. He is part of the 'Minimal' development team and is currently working wonders on a 'Minimal BASIC' using a JIT compiler - also running natively.
osea... estas traduciendo el codigo en hexadecimal para insertarlo en texto nuevamente y executarlo.. ... no seria mas facil y menos lineas traducir el hex dentro de un buffer y despues ejecutarlo al viejo y puro estilo de un shell code ? ..porque veo que de todas maneras veo que estas compilandolo el codigo asm para ver el codigo hexadecimal de las instrucciones..
there is no source code on the github
Thanks a lot. I want to write my own assembler to JVM bytecode compiler.
Glad you consider this helpful. Good luck ;-)
deutsch?
edit:
hab gesehen in kanalinfo das der standort in deutschland ist
Ja, genau 🙂
nice, but since you wrote this in python how was the first assembler written?
Hi, back in the old days a "first" assembler on a new platform had to be coded in machine language on a piece of paper and written into memory directly via front panel toggle switches (see PDP-8 for example) Very painful indeed ;-)
WWhhaaao ! 😳 Great.
رائعة
أنا موافق
@@whoblue579beta3
عربي لو مترجم قوقل
@@kayezero703 ':-D
Sub'd, thx
nomads of mongolia!
тще
not be abAB USE ED))
COMPILE IN QWANT))
JORNEY YOU
I really like what you've done here.
I'd like to have an assembler where the source file actually IS the Python (well, I'd prefer Ruby - but it's all the same) that way any constants or assemble-time expressions can be prepared or calculated in a nice scripting language. (we had something like this for the 6502 in BBC BASIC back in the 1980s) I've been looking at github.com/keystone-engine/keystone but it's far too complicated... I'm thinking I might be able to do something using a more minimal approach... and you've inspired me to try this again now.
Glad to hear that it inspired you! But beware, this approach is (barely) okay for simple assembler syntax. It is way too unsophisticated to parse any "higher" language. One would need to implement expressions with BNF and stuff... and you are well over 32KB land...
@@slu467 most of what I do is little microcontrollers and 32k is pretty much my upper limit. :) but I am worried that my ISAs might be a bit too complex for a minimal minimal approach.... I'll have to see how it pans out.
ivea. to you. space in invaers