Compiling C to printable x86, to make an executable research paper

431,232
0
Published 2017-03-31
In this oddly paced "educational" video, I explain how I created a paper for SIGBOVIK 2017 that consists of only printable ASCII bytes, but is also a valid DOS executable. This involves making a C compiler that targets the printable subset of x86 (without using self-modifying code), and just barely scraping out solutions to some tricky puzzles that arise due to the constraints. The final result is functionality that is oh so very important, however!

Download the paper/program and source code: tom7.org/abc/
SIGBOVIK: sigbovik.org/
All Tom thingies: tom7.org/

All Comments (21)
  • @moth.monster
    "printable x86" is actually the best esoteric programming language
  • @jdlenl
    i love how you explained assembly without mentioning assembly
  • @therealfranklin
    "Outside of this region is a bunch of hooey." Might be the best description of UTF-8 I've ever heard of.
  • @SirChris314
    this video was good up until 25:03 at which point it was a masterpiece
  • @magneticflux-
    14:38 "This kind of fractal structure shows up a lot in computer science and mathematics and Hyrule."
  • @woulg
    This is my favorite flavor of art. I don't know if you have won any modern art prizes but imo you deserve many. There was a guy who came to my uni to give a talk who did stuff like this but only a fraction as labour intensive (and therefore exponentially less cool), and he was a big time, famous conceptual artist. I can't remember his name but he did one piece where he threw colored sticks in the air and took pictures of them because hypothetically they could randomly happen to arrange themselves into a perfect representation of a hypercube (the pictures are wonderful). He did another one where he got every possible attachment for his camera and several pairs of glasses and things to improve vision and then took the shittiest bluriest self portraits (because it was basically impossible to operate with this many "upgrades"). And the last one that I remember which was also very beautiful, he took 2 super long exposure photos of him laying on his back and then his front while listening to the whole back and then front of a public enemy record. He was one of my favs but after watching several of my videos you've definitely usurped him (and the others who shall remain nameless because of my shit memory). In about a decade look out for my comment on someone else's video where I detail my vague memory of your work hahaha. Anyway, sorry for the ramble, great stuff as usual, I'm off to watch the rest.
  • @FishamanP
    I'd love to see a video of you creating a blank text file, typing the program in, saving it as a .exe, and running it. It would really drive the point of this exercise home.
  • @BludtheThursty
    "This kind of fractal structure shows up a lot in computer science, mathematics, and Hyrule" Gold
  • @TerjeMathisen
    The huge step here is when you realized that it is in fact impossible to write a regular program without any of the 8-bit bytes, and then decided to use an entire 64 KB block as your program, with wraparound at the end. I did the opposite back around 1992, by deciding to write an executable ascii program that used an even smaller character set: Just the 70+ chars that are blessed by MIME as passing transparently through any email gateway. This is the 65 MIME Base-64 set plus a handful of others that don't need any quoting. My final result does the absolute minimum possible amount of self-modification: A single 2-byte backwards JMP opcode is sufficient to enable the primary bootloader (two 64-byte lines, with optionally one or two line separator chars) to run. This boot loader decodes pairs of Base-64 chars to generate any byte value, so it encodes a maximally dense Base64 decoder which is used to decode and optionally either save to disk or execute the actual payload.
  • @gkcs
    This is just brilliant! Do you have any source for your inspiration, or is it just plain craziness?
  • @javierbg1995
    14:33 You already had me in, but man... BTW: I didn't think I'd ever see a Numberphile parody. Very nice
  • @car-keys
    I've played enough TIS-100 to know how impressive this is.
  • @Reecer77
    Man, "boring"? Tom7, I LIVE to see you post a new video, because it's always super interesting each and every time. I really hope that's not the sole reason you only make videos on things like, twice a year, if that, because I would be ECSTATIC if you had slightly more video content to share, WHATEVER it is.
  • @car-keys
    Tom, as a young CS major, this channel is incredibly interesting. Thanks for all you do!
  • @evinmathai
    You may find Ladder Diagram an interesting “programming language”. It is widely used in industrial automation on programmable logic controllers (PLC). It follows like your ladder idea and evolved out of industrial machinery using hardwired relay logic.
  • @pixelflow
    This needs to be printed in a book with one of those misleading 80s qbasic 'games, puzzles and more!' covers. Because nothing is better than OPLrolling yourself after typing for several hours.
  • @TheUnknownsShow
    This is still my favorite YouTube channel of all time. I really wish Tom would upload more often, but at least what he does upload is always gold!
  • @TheMaplestrip
    Oh how I love this channel! This video reminds me most of glitch abusers of video games like Pokémon and Super Mario 64, using the compiled-level code in ways it was never supposed to be used. What you did is absolutely gorgeous.