Hacker News new | past | comments | ask | show | jobs | submit login
Compiling C Programs Into “Mov” Instructions (And Only “Mov” Instructions) (github.com/xoreaxeaxeax)
78 points by optimalsolver on Aug 14, 2021 | hide | past | favorite | 16 comments



Oh boy. If anyone here is coming across Chris Domas (the author of this github) for the first time, you're in for a treat! Some of his talks on youtube are absolutely mind-blowing:

DEF CON 26 - Christopher Domas - GOD MODE UNLOCKED Hardware Backdoors in redacted x86: https://invidious.snopyta.org/watch?v=jmTwlEh8L7g

DEF CON 26 - Christopher Domas - The Ring 0 Facade Awakening the Processors Inner Demons: https://invidious.snopyta.org/watch?v=XH0F9r0siTI


Domas is incredible — every time I see watch his talks (and they are absolutely worth re-watching) I always think to myself “this guy is /so good/ at what he does”. Sadly he seems to have stopped putting content out after he began working for Intel.


These links don't work for me, but the videos are on YT:

- https://www.youtube.com/watch?v=jmTwlEh8L7g

- https://www.youtube.com/watch?v=XH0F9r0siTI

And yes, they are spectacular.


Unfortunately neither of these links work for me. Might they be available elsewhere or do you or someone else have updated links? The title seem very interesting. Thanks.


These links are just to an invidious[0] instance. I guess the instance was temporarily down. It worked when I tried right now. You can also replace the domain with youtube.com and it should work. Better yet, you can try any of the alternative invidious instances listed at invidio.us.

Happy hacking!

[0]:https://github.com/iv-org/invidious


Interesting how the project nightshyft link from the second talk is gone. Was looking forward to giving it a try.


What is snopyta.org? These links don't work for me (403) so I had to manually change them to YouTube


It's an invidious[0] instance. Looks like it was down for a bit. You can replace the URL domains with youtube.com and get the same video. Better yet, you can use any alternative invidious instances given at invidio.us.

[0]:https://github.com/iv-org/invidious



Making hardware that'd take advantage of this simple instruction set might have some interesting results.


All you need is memory mapping. You map an ALU/whatever to some memory locations. Move your register to the right input addresses, move out the output.


For a project in an undergrad (3rd year) computer architecture course we had to invent a netlist language, implement a netlist interpreter, and then write a processor in our own netlist language and write an assembly program for that processor that would output a timer (the idea was to produce something fast enough to update the output each second).

With a friend we "invented" exactly what you described. Our original idea started as a joke to make a processor with a single instruction,and when we thought of having registers that would systematically be updated with the results of different operations on two operand registers we understood we could actually do it. So we did. It was a bit tricky and quite slow but it was a lot of fun and we still managed to beat the second at the end =).


Early computers did it a lot more. C64 and the like still had typical instructions, but if you wanted to deal with the video chip, it had lots of sections of memory that you just altered to get the results on screen. Want a character up at the top left? put it's PETSCII code at $0400.


Still the one of the best things ever. The author also has some amazing talks available: https://www.youtube.com/results?search_query=chris+domas


Reminds me of Tom Murphy VII's compiler that generates executable that only contain text-friendly ASCII characters: http://tom7.org/abc/


cf. the Wireworld computer, which also has a construction set consisting of only MOV: https://www.quinapalus.com/wi-index.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: