https://github.com/akkartik/mu/blob/main/linux/130emit.subx
  1 == code
  2 #   instruction                     effective address                                                   register    displacement    immediate
  3 # . op          subop               mod             rm32          base        index         scale       r32
  4 # . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes
  5 
  6 # If datum of 'word' is not a valid name, it must be a hex int. Parse and print
  7 # it in 'width' bytes of hex, least significant first.
  8 # Otherwise just print the entire word including metadata.
  9 # Always print a trailing space.
 10 emit:  # out: (addr buffered-file), word: (addr slice), width: int
 11     # . prologue
 12     55/push-ebp
 13     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 14     # . save registers
 15     50/push-eax
 16     56/push-esi
 17     57/push-edi
 18     # esi = word
 19     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           6/r32/esi   0xc/disp8       .                 # copy *(ebp+12) to esi
 20     # var datum/edi: slice
 21     68/push  0/imm32/end
 22     68/push  0/imm32/start
 23     89/copy                         3/mod/direct    7/rm32/edi    .           .             .           4/r32/esp   .               .                 # copy esp to edi
 24     # datum = next-token-from-slice(word->start, word->end, '/')
 25     # . . push args
 26     57/push-edi
 27     68/push  0x2f/imm32/slash
 28     ff          6/subop/push        1/mod/*+disp8   6/rm32/esi    .           .             .           .           4/disp8         .                 # push *(esi+4)
 29     ff          6/subop/push        0/mod/indirect  6/rm32/esi    .           .             .           .           .               .                 # push *esi
 30     # . . call
 31     e8/call  next-token-from-slice/disp32
 32     # . . discard args
 33     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               0x10/imm32        # add to esp
 34     # if (valid-name?(datum)) write-slice-buffered(out, word) and return
 35     # . eax = valid-name?(name)
 36     # . . push args
 37     57/push-edi
 38     # . . call
 39     e8/call  valid-name?/disp32
 40     # . . discard args
 41     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               4/imm32           # add to esp
 42     # . if (eax != false)
 43     3d/compare-eax-and  0/imm32/false
 44     74/jump-if-=  $emit:hex-int/disp8
 45 $emit:name:
 46     # . write-slice-buffered(out, word)
 47     # . . push args
 48     56/push-esi
 49     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 50     # . . call
 51     e8/call  write-slice-buffered/disp32
 52     # . . discard args
 53     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 54     # . write-buffered(out, " ")
 55     # . . push args
 56     68/push  Space/imm32
 57 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.gui.bar</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.<a href="ranger.gui.html"><font color="#ffffff">gui</font></a>.bar</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/hut/work/ranger/ranger/gui/bar.py">/home/hut/work/ranger/ranger/gui/bar.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="builtins.html#list">builtins.list</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.gui.bar.html#BarSide">BarSide</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="builtins.html#object">builtins.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.gui.bar.html#Bar">Bar</a>
</font></dt><dt><font face="helvetica, arial"><a href="ranger.gui.bar.html#ColoredString">ColoredString</a>
</font></dt></dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Bar">class <strong>Bar</strong></a>(<a href="builtins.html#object">builtins.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="Bar-__init__"><strong>__init__</strong></a>(self, base_color_tag)</dt></dl>

<dl><dt><a name="Bar-add"><strong>add</strong></a>(self, *a, **kw)</dt></dl>

<dl><dt><a name="Bar-addright"><strong>addright</strong></a>(self, *a, **kw)</dt></dl>

<dl><dt><a name="Bar-combine"><strong>combine</strong></a>(self)</dt></dl>

<dl><dt><a name="Bar-fill_gap"><strong>fill_gap</strong></a>(self, char, wid, gapwidth<font color="#909090">=False</font>)</dt></dl>

<dl><dt><a name="Bar-fixedsize"><strong>fixedsize</strong></a>(self)</dt></dl>

<dl><dt><a name="Bar-shrink_by_cutting"><strong>shrink_by_cutting</strong></a>(self, wid)</dt></dl>

<dl><dt><a name="Bar-shrink_by_removing"><strong>shrink_by_removing</strong></a>(self, wid)</dt></dl>

<dl><dt><a name="Bar-sumsize"><strong>sumsize</strong></a>(self)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>gap</strong> = None</dl>

<dl><dt><strong>left</strong> = None</dl>

<dl><dt><strong>right</strong> = None</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="BarSide">class <strong>BarSide</strong></a>(<a href="builtins.html#list">builtins.list</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="ranger.gui.bar.html#BarSide">BarSide</a></dd>
<dd><a href="builtins.html#list">builtins.list</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="BarSide-__init__"><strong>__init__</strong></a>(self, base_color_tag)</dt></dl>

<dl><dt><a name="BarSide-add"><strong>add</strong></a>(self, string, *lst, **kw)</dt></dl>

<dl><dt><a name="BarSide-add_space"><strong>add_space</strong></a>(self, n<font color="#909090">=1</font>)</dt></dl>

<dl><dt><a name="BarSide-fixedsize"><strong>fixedsize</strong></a>(self)</dt></dl>

<dl><dt><a name="BarSide-nonfixed_items"><strong>nonfixed_items</strong></a>(self)</dt></dl>

<dl><dt><a name="BarSide-sumsize"><strong>sumsize</strong></a>(self)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="builtins.html#list">builtins.list</a>:<br>
<dl><dt><a name="BarSide-__add__"><strong>__add__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__add__">__add__</a>(y)&nbsp;&lt;==&gt;&nbsp;x+y</tt></dd></dl>

<dl><dt><a name="BarSide-__contains__"><strong>__contains__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__contains__">__contains__</a>(y)&nbsp;&lt;==&gt;&nbsp;y&nbsp;in&nbsp;x</tt></dd></dl>

<dl><dt><a name="BarSide-__delitem__"><strong>__delitem__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__delitem__">__delitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;del&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="BarSide-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__eq__">__eq__</a>(y)&nbsp;&lt;==&gt;&nbsp;x==y</tt></dd></dl>

<dl><dt><a name="BarSide-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__ge__">__ge__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;=y</tt></dd></dl>

<dl><dt><a name="BarSide-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="BarSide-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="BarSide-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__gt__">__gt__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&gt;y</tt></dd></dl>

<dl><dt><a name="BarSide-__iadd__"><strong>__iadd__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__iadd__">__iadd__</a>(y)&nbsp;&lt;==&gt;&nbsp;x+=y</tt></dd></dl>

<dl><dt><a name="BarSide-__imul__"><strong>__imul__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__imul__">__imul__</a>(y)&nbsp;&lt;==&gt;&nbsp;x*=y</tt></dd></dl>

<dl><dt><a name="BarSide-__iter__"><strong>__iter__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__iter__">__iter__</a>()&nbsp;&lt;==&gt;&nbsp;iter(x)</tt></dd></dl>

<dl><dt><a name="BarSide-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#BarSide-__le__">__le__</a>(y)&nbsp;&lt;==&gt;&nbsp;x&lt;=y</tt></