view paste/paste.10912 @ 11969:df3a01142399 draft

<oerjan> le/rn Hungry//Hungry is a country in Europe, formerly part of the Ostrich empire. It split after a famine that got so severe that they had to start editing disgusting things like bell peppers. Absurdly, this became a tradition that continues until the present day.
author HackEso <hackeso@esolangs.org>
date Wed, 16 Oct 2019 08:34:37 +0000
parents e72ec4b21b8b
children
line wrap: on
line source

#!/bin/sh
echo "$1" > /tmp/asm.s; for o in ',' '-msyntax=intel -mnaked-reg,-M intel'; do if as ${o%,*} /tmp/asm.s -o /tmp/asm.o 2>>/tmp/asm.err; then objdump ${o#*,} -d --insn-width=20 /tmp/asm.o | sed -e "1,/0000000000000000/d" | perl -pe 'if (/^\s*(\d+:)\s*((?:\w\w )+)\s*(\S.*)$/) { ($a,$b,$c) = ($1,$2,$3); $_ = "$a  $b  ".($c =~ s/\s+/ /rg); }'; exit; fi; done; cat /tmp/asm.err