https://github.com/akkartik/mu/blob/main/linux/135next-word-or-string.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 # (re)compute the bounds of the next word or string literal in the line
  7 # return empty string on reaching end of file
  8 next-word-or-string:  # line: (addr stream byte), out: (addr slice)
  9     # . prologue
 10     55/push-ebp
 11     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 12     # . save registers
 13     50/push-eax
 14     51/push-ecx
 15     56/push-esi
 16     57/push-edi
 17     # esi = line
 18     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           6/r32/esi   8/disp8         .                 # copy *(ebp+8) to esi
 19     # edi = out
 20     8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           7/r32/edi   0xc/disp8       .                 # copy *(ebp+12) to edi
 21     # skip-chars-matching(line, ' ')
 22     # . . push args
 23     68/push  0x20/imm32/space
 24     ff          6/subop/push        1/mod/*+disp8   5/rm32/ebp    .           .             .           .           8/disp8         .                 # push *(ebp+8)
 25     # . . call
 26     e8/call  skip-chars-matching/disp32
 27     # . . discard args
 28     81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
 29 $next-word-or-string:check0:
 30     # if (line->read >= line->write) clear out and return
 31     # . eax = line->read
 32     8b/copy                         1/mod/*+disp8   6/rm32/esi    .           .             .           0/r32/eax   4/disp8         .                 # copy *(esi+4) to eax
 33     # . if (eax < line->write) goto next check
 34     3b/compare                      0/mod/indirect  6/rm32/esi    .           .      
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module ranger.colorschemes.jungle</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.colorschemes.html"><font color="#ffffff">colorschemes</font></a>.jungle</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/colorschemes/jungle.py">/home/hut/work/ranger/ranger/colorschemes/jungle.py</a></font></td></tr></table>
    <p></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="curses.html">curses</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><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="ranger.gui.colorscheme.html#ColorScheme">ranger.gui.colorscheme.ColorScheme</a>(<a href="builtins.html#object">builtins.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="ranger.colorschemes.jungle.html#Default">Default</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="Default">class <strong>Default</strong></a>(<a href="ranger.gui.colorscheme.html#ColorScheme">ranger.gui.colorscheme.ColorScheme</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.colorschemes.jungle.html#Default">Default</a></dd>
<dd><a href="ranger.gui.colorscheme.html#ColorScheme">ranger.gui.colorscheme.ColorScheme</a></dd>
<dd><a href="builtins.html#object">builtins.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Default-use"><strong>use</strong></a>(self, context)</dt></dl>

<hr>
Methods inherited from <a href="ranger.gui.colorscheme.html#ColorScheme">ranger.gui.colorscheme.ColorScheme</a>:<br>
<dl><dt><a name="Default-__init__"><strong>__init__</strong></a>(self)</dt></dl>

<dl><dt><a name="Default-get"><strong>get</strong></a>(self, *keys)</dt><dd><tt>Determine&nbsp;the&nbsp;(fg,&nbsp;bg,&nbsp;attr)&nbsp;tuple&nbsp;or&nbsp;get&nbsp;it&nbsp;from&nbsp;cache</tt></dd></dl>

<dl><dt><a name="Default-get_attr"><strong>get_attr</strong></a>(self, *keys)</dt><dd><tt>Returns&nbsp;the&nbsp;curses&nbsp;attr&nbsp;integer&nbsp;for&nbsp;the&nbsp;specified&nbsp;keys</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="ranger.gui.colorscheme.html#ColorScheme">ranger.gui.colorscheme.ColorScheme</a>:<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>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>COLOR_PAIRS</strong> = {10: 0}<br>
<strong>black</strong> = 0<br>
<strong>blue</strong> = 4<br>
<strong>bold</strong> = 2097152<br>
<strong>cyan</strong> = 6<br>
<strong>default</strong> = -1<br>
<strong>default_colors</strong> = (-1, -1, 0)<br>
<strong>green</strong> = 2<br>
<strong>invisible</strong> = 8388608<br>
<strong>magenta</strong> = 5<br>
<strong>normal</strong> = 0<br>
<strong>red</strong> = 1<br>
<strong>reverse</strong> = 262144<br>
<strong>underline</strong> = 131072<br>
<strong>white</strong> = 7<br>
<strong>yellow</strong> = 3</td></tr></table>
</body></html>
. . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax 279 2b/subtract 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # subtract *ecx from eax 280 50/push-eax 281 # . . call 282 e8/call check-ints-equal/disp32 283 # . . discard args 284 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 285 # . epilogue 286 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 287 5d/pop-to-ebp 288 c3/return 289 290 test-next-word-or-string-returns-string-literal: 291 # . prologue 292 55/push-ebp 293 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 294 # setup 295 # . clear-stream(_test-input-stream) 296 # . . push args 297 68/push _test-input-stream/imm32 298 # . . call 299 e8/call clear-stream/disp32 300 # . . discard args 301 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 302 # var slice/ecx: slice 303 68/push 0/imm32/end 304 68/push 0/imm32/start 305 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx 306 # write(_test-input-stream, " \"a b\"/imm32 ") 307 # . . push args 308 68/push " \"a b\"/imm32 "/imm32 309 68/push _test-input-stream/imm32 310 # . . call 311 e8/call write/disp32 312 # . . discard args 313 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 314 # next-word-or-string(_test-input-stream, slice) 315 # . . push args 316 51/push-ecx 317 68/push _test-input-stream/imm32 318 # . . call 319 e8/call next-word-or-string/disp32 320 # . . discard args 321 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 322 # check-ints-equal(slice->start - _test-input-stream->data, 1, msg) 323 # . check-ints-equal(slice->start - _test-input-stream, 13, msg) 324 # . . push args 325 68/push "F - test-next-word-or-string-returns-string-literal: start"/imm32 326 68/push 0xd/imm32 327 # . . push slice->start - _test-input-stream 328 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax 329 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 330 50/push-eax 331 # . . call 332 e8/call check-ints-equal/disp32 333 # . . discard args 334 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 335 # check-ints-equal(slice->end - _test-input-stream->data, 12, msg) 336 # . check-ints-equal(slice->end - _test-input-stream, 24, msg) 337 # . . push args 338 68/push "F - test-next-word-or-string-returns-string-literal: end"/imm32 339 68/push 0x18/imm32 340 # . . push slice->end - _test-input-stream 341 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax 342 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 343 50/push-eax 344 # . . call 345 e8/call check-ints-equal/disp32 346 # . . discard args 347 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 348 # . epilogue 349 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 350 5d/pop-to-ebp 351 c3/return 352 353 test-next-word-or-string-returns-string-with-escapes: 354 # . prologue 355 55/push-ebp 356 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 357 # setup 358 # . clear-stream(_test-input-stream) 359 # . . push args 360 68/push _test-input-stream/imm32 361 # . . call 362 e8/call clear-stream/disp32 363 # . . discard args 364 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 365 # var slice/ecx: slice 366 68/push 0/imm32/end 367 68/push 0/imm32/start 368 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx 369 # write(_test-input-stream, " \"a\\\"b\"/x") 370 # . . push args 371 68/push " \"a\\\"b\"/x"/imm32 372 68/push _test-input-stream/imm32 373 # . . call 374 e8/call write/disp32 375 # . . discard args 376 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 377 # next-word-or-string(_test-input-stream, slice) 378 # . . push args 379 51/push-ecx 380 68/push _test-input-stream/imm32 381 # . . call 382 e8/call next-word-or-string/disp32 383 # . . discard args 384 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 385 # check-ints-equal(slice->start - _test-input-stream->data, 1, msg) 386 # . check-ints-equal(slice->start - _test-input-stream, 13, msg) 387 # . . push args 388 68/push "F - test-next-word-or-string-returns-string-with-escapes: start"/imm32 389 68/push 0xd/imm32 390 # . . push slice->start - _test-input-stream 391 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax 392 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 393 50/push-eax 394 # . . call 395 e8/call check-ints-equal/disp32 396 # . . discard args 397 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 398 # check-ints-equal(slice->end - _test-input-stream->data, 9, msg) 399 # . check-ints-equal(slice->end - _test-input-stream, 21, msg) 400 # . . push args 401 68/push "F - test-next-word-or-string-returns-string-with-escapes: end"/imm32 402 68/push 0x15/imm32 403 # . . push slice->end - _test-input-stream 404 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax 405 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 406 50/push-eax 407 # . . call 408 e8/call check-ints-equal/disp32 409 # . . discard args 410 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 411 # . epilogue 412 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 413 5d/pop-to-ebp 414 c3/return 415 416 # . . vim:nowrap:textwidth=0