6 ms·
SizeCoding.org: creating very tiny programs for the 80x86 family of CPUs
- bencollier49 10y agoThis seems fairly focused on Windows? Would be interested to see some Linux stuff.
- userbinator 10y agoIt's not Windows but MS-DOS, which allows for pure binary executables (COM format) that are nothing but instructions. Thus even a single-byte file is executable (C3, RET - i.e. exit immediately.) AFAIK Linux has a higher minimum size, as the ELF header alone has to be at least 45 bytes: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html http://www.muppetlabs.com/~breadbox/software/tiny/teensy.htm...
- swiley 10y agoOne could write a com loader for Linux pretty easily.
- JoshTriplett 10y agocom programs assume they run on DOS, so you might as well use dosbox for that. Linux supports some other executable formats for embedded systems, but they don't have much less overhead than ELF.
- bencollier49 10y agoThe problem is that a lot of the demo programs are hooking Int 21h, which is provided by DOS / Windows.
- mlvljr 10y agoWould it run 16 bit code under x64 Linux (w/o any translation / emulation)? As Windows can't do it (only x32 versions can), thus wondering, if this is a CPU limitation.
- avian 10y agoIndeed https://github.com/avian2/linux-com-loader https://github.com/avian2/linux-com-loader
- bencollier49 10y agoMy point was around the DOS Int 21h, really. But I see what you mean about the file format.
- _c_ 10y agoUse int 80h for UNIX
- userbinator 10y agoThere is also this (unfortunately discontinued) competition series, with a lot more tiny programs to examine and maybe even challenge yourself against: http://www.hugi.scene.org/compo/compoold.htm http://www.hugi.scene.org/compo/compoold.htm
- zoom6628 10y agoThese are amazing. All kudos to the authors. This is what CS courses should start with.
- userbinator 10y agoAny CS course that includes Asm often includes writing tiny programs, but not tiny programs that do interesting things.
- exDM69 10y agoTiny assembler programs tend to abuse arcane x86 instructions that have one or two byte encodings, but aren't practical for real use (and compilers don't emit them). Add some binary format tricks on top. A little bit of assembly writing (and more importantly, reading) should be a part of a good CS curriculum but these tiny programs aren't a good place to start.
- hannob 10y agoI can probably claim to be the inventor of 64 and 32 byte competitions back in my demoscene days. I was organizer of a small demo party called 0a000h. 4k intro competitions were quite common, 256 bytes happened sometimes, I think we were the first to go even lower. We had some impressive results especially in the 64b. We also did fast-size-coding competitions. We showed a simple effect and then asked people to come up with the smallest way to replicate that within a couple of hours. Results are all linked on the webpage: https://www.0a000h.de/ https://www.0a000h.de/ Most of them should run in dosbox, unfortunately some make problems.
- Keyframe 10y agoIt brings smile to my face when I see someone wearing an Amiga ball logo on their shirt :)