Back to General discussions forum
Friends, I'm now thinking of adding a set of problems on Assembly for Intel 4004 - the grandfather of all CPU-s.
It will work similarly to Brainf--k problems - you will need to submit the code in specific language which is then tested on server.
We already have asm-4004 emulator added to CodeAbbey - and you can see that TestUser already solved one of existing problems with it: Reverse String by TestUser. You will be also able to use emulator offline (it is written in Python and have only few small files - link to project).
Compared to BF you will need to learn about 25 commands instead of 10. On the other hand you will be able to perform more powerful operations (i.e. adding and multiplying even large numbers will not take millions of steps). I think we'll be able to learn funny algorithms for integer arithmetics and for graphics like Bresenham's line with it.
So please, if you have about 30 minutes of time, check few pages of the tutorial I wrote and watch its examples in online emulator. Then judge whether you would like such problems to be added to our site and comment your thoughts here :)
Thanks in advance for your help and advice!
P.S. this is also asked in our FaceBook page.
I found an in-depth instruction manual from 1973 if anybody is interested, which you can download here.
Christopher P. Matthews
The tutorial is good and I think it is a great idea for a set of problems. It must be easier than BF!
Hello Colleagues!
Christopher, thanks a lot! I've found two other pieces of original documentation, but completely missed this one! I regret I had no chance to study it earlier. Well, I hope I'll be able to made changes to my emulator if necessary along reading it!
I decided to collect all these documents also at dedicated project wiki page.
Graeme thanks for your kind and encouraging words. :)
I suspect you have more experience with assembly languages for some CPUs (probably of Z80 family) than any of us (or all of us, ha-ha). It is great to have your opinion for support! :)
P.S. It was me, Rodion, again from the wrong account - I was trying to find out some possible bug and forgot to switch back...
Yes, I've done a fair bit of Z80 assembler and some 6502 assembler. I've also done a little bit of IBM BAL.
No difficulty with the first 4004 problem. My solution was the same as yours, apart from the comments!
Grae
Hi Rodion,
Thanks, you've reminded me how much I like assembler!
In your solution for "Mul Two" you don't make any assumption about the initial state of carry and your code starts with a CLC.
However your solution for "Loops in Assembly" only works if carry is initially clear.
Grae
Grae, thanks for your kind word and for this correction!
I'm glad you like these problems and help in testing them. I have plans to build another interpreter, for contemporary chips (like Atmel's) if this kind of problems will be popular enough. So I hope this would be not only piece of story :)
BTW it is the first time I've heard about IBM BAL. I feel envious to your experience! :)
sincerely yours, Rodion