Hasty Briefsbeta

Bilingual

A whole boss fight in 256 bytes

a day ago
  • #assembly
  • #optimization
  • #demo
  • Endbot is a 256-byte DOS intro that runs in real-time on DosBox-X, featuring a robot sprite with progressive bullet damage, a growing explosion, a scrolling checkerboard landscape, and a MIDI soundtrack all from a single tiny .com file.
  • The demo is written in assembly using FASM, with no linker step required, and leverages hardware tricks like VGA mode 13h for 320x200 graphics and MIDI port 0x330 for music, using specific DosBox-X configurations for proper emulation.
  • Key programming optimizations include using the BP register as a global timer, the Rrrola trick with mul 0xCCCD for pixel coordinates without division, and combining sprite data with MIDI initialization bytes to save space.
  • Visual effects include an explosion that grows over time with an orange ring edge, a robot sprite that drifts downward and accumulates damage via bit flips, and a perspective-correct scrolling checkerboard landscape generated with arithmetic operations.
  • The code is highly optimized for size, employing techniques like stosb for pixel writing, hlt for frame syncing, xlat for color lookup, and ret for exiting, with all effects and music fitting within exactly 256 bytes.