# Translate literal strings within double quotes. # Replace them with references to new variables in the data segment. # # To run: # $ ./bootstrap translate init.linux 0*.subx apps/subx-params.subx apps/dquotes.subx -o apps/dquotes # $ cat x # == code # ab "cd ef"/imm32 # $ cat x |./bootstrap run apps/dquotes # == code # ab __string1/imm32 # == data # __string1: # 5/imm32 # 0x63/c 0x64/d 0x20/ 0x65/e 0x66/f == code # instruction effective address register displacement immediate # . op subop mod rm32 base index scale r32 # . 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 Entry: # run tests if necessary, convert stdin if not # . prologue 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp # initialize heap # . Heap = new-segment(Heap-size) # . . push args 68/push Heap/imm32 ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Heap-size/disp32 # push *Heap-size # . . call e8/call new-segment/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # - if argc > 1 and argv[1] == "test", then return run-tests() # if (argc <= 1) goto interactive 81 7/subop/compare 1/mod/*+disp8 5/rm32/ebp . . . . 0/disp8 1/imm32 # compare *ebp 7e/jump-if-<= $subx-dquotes-main:interactive/disp8 # if (!kernel-string-equal?(argv[1], "test")) goto interactive # . eax = kernel-string-equal?(argv[1], "test") # . . push args 68/push "test"/imm32 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) # . . call e8/call kernel-string-equal?/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp # . if (eax == false) goto interactive 3d/compare-eax-and 0/imm32/false 74/jump-if-= $subx-dquotes-main:interactive/disp8 # run-tests() e8/call run-tests/disp32 # syscall(exit, *Num-test-failures) 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/ebx Num-test-failures/disp32 # copy *Num-test-failures to ebx eb/jump $subx-dquotes-main:end/disp8 $subx-dquotes-main:interactive: # - otherwise convert stdin # var ed/eax: exit-descriptor 81 5/subop/subtract 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # subtract from esp 89/copy 3/mod/direct 0/rm32/eax . . . 4/r32/esp . . # copy esp to eax # configure ed to really exit() # . ed->target = 0 c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # copy to *eax # subx-dquotes(Stdin, Stdout, Stderr, ed) # . . push args 50/push-eax/ed 68/push Stderr/imm32 68/push Stdout/imm32 68/push Stdin/imm32 # . . call e8/call subx-dquotes/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x10/imm32 # add to esp # syscall(exit, 0) bb/copy-to-ebx 0/imm32 $subx-dquotes-main:end: e8/call syscall_exit/disp32 # conceptual hierarchy within a line: # line = wo
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package ranger.container</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> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="ranger.html"><font color="#ffffff">ranger</font></a>.container</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/container/__init__.py">/home/hut/work/ranger/ranger/container/__init__.py</a></font></td></tr></table>
<p><tt>This package includes container-objects which are<br>
used to manage stored data</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="ranger.container.bookmarks.html">bookmarks</a><br>
<a href="ranger.container.commandlist.html">commandlist</a><br>
</td><td width="25%" valign=top><a href="ranger.container.environment.html">environment</a><br>
<a href="ranger.container.history.html">history</a><br>
</td><td width="25%" valign=top><a href="ranger.container.keybuffer.html">keybuffer</a><br>
<a href="ranger.container.tags.html">tags</a><br>
</td><td width="25%" valign=top></td></tr></table></td></tr></table>
</body></html>