Skip to main content
6 of 8
added 12 characters in body
Dennis
  • 211.7k
  • 41
  • 380
  • 830

C (tcc), x86_64, 29 31 33 39 40 bytes

main[]={(23*8),-~0xABEDFCfebdc%95674+1}; 

Returns 0. Thanks to @feersum for suggesting uppercase hex digits.

Try it online!

How it works

The assignment writes two ints (184 and 49664) to the memory location of main. With 32-bit ints and little-endian byte order, the exact bytes are b8 00 00 00 00 c2 00 00.

Since tcc doesn't declare the defined array as .data (most compilers would), so jumping to main executes the machine code it points to.

  • b8 00 00 00 00 stores the int 0 in the eax register.

  • c2 returns the value in the eax register.

Dennis
  • 211.7k
  • 41
  • 380
  • 830