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 . . . 0/r32/eax . . # compare eax with *esi 35 7c/jump-if-< $next-word-or-string:check-for-comment/disp8 36 # . return out 37 c7 0/subop/copy 0/mod/direct 7/rm32/edi . . . . . 0/imm32 # copy to *edi 38 c7 0/subop/copy 1/mod/*+disp8 7/rm32/edi . . . . 4/disp8 0/imm32 # copy to *(edi+4) 39 eb/jump $next-word-or-string:end/disp8 40 $next-word-or-string:check-for-comment: 41 # out->start = &line->data[line->read] 42 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 . # copy *(esi+4) to ecx 43 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/eax 0xc/disp8 . # copy esi+ecx+12 to eax 44 89/copy 0/mod/indirect 7/rm32/edi . . . 0/r32/eax . . # copy eax to *edi 45 # if (line->data[line->read] != '#') goto next check 46 # . eax = line->data[line->read] 47 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax 48 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 . # copy byte at *(esi+ecx+12) to AL 49 # . compare 50 3d/compare-eax-and 0x23/imm32/pound 51 75/jump-if-!= $next-word-or-string:check-for-string-literal/disp8 52 $next-word-or-string:comment: 53 # out->end = &line->data[line->write] 54 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax 55 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax . 0/r32/eax 0xc/disp8 . # copy esi+eax+12 to eax 56 89/copy 1/mod/*+disp8 7/rm32/edi . . . 0/r32/eax 4/disp8 . # copy eax to *(edi+4) 57 # line->read = line->write # skip rest of line 58 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax 59 89/copy 1/mod/*+disp8 6/rm32/esi . . . 0/r32/eax 4/disp8 . # copy eax to *(esi+4) 60 # return 61 eb/jump $next-word-or-string:end/disp8 62 $next-word-or-string:check-for-string-literal: 63 # if (line->data[line->read] != '"') goto next check 64 # . eax = line->data[line->read] 65 31/xor 3/mod/direct 0/rm32/eax . . . 0/r32/eax . . # clear eax 66 8a/copy-byte 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/AL 0xc/disp8 . # copy byte at *(esi+ecx+12) to AL 67 # . compare 68 3d/compare-eax-and 0x22/imm32/dquote 69 75/jump-if-!= $next-word-or-string:regular-word/disp8 70 $next-word-or-string:string-literal: 71 # skip-string(line) 72 # . . push args 73 56/push-esi 74 # . . call 75 e8/call skip-string/disp32 76 # . . discard args 77 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 78 # fall through 79 $next-word-or-string:regular-word: 80 # skip-chars-not-matching-whitespace(line) # including trailing newline 81 # . . push args 82 ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) 83 # . . call 84 e8/call skip-chars-not-matching-whitespace/disp32 85 # . . discard args 86 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 87 # out->end = &line->data[line->read] 88 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 1/r32/ecx 4/disp8 . # copy *(esi+4) to ecx 89 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 1/index/ecx . 0/r32/eax 0xc/disp8 . # copy esi+ecx+12 to eax 90 89/copy 1/mod/*+disp8 7/rm32/edi . . . 0/r32/eax 4/disp8 . # copy eax to *(edi+4) 91 $next-word-or-string:end: 92 # . restore registers 93 5f/pop-to-edi 94 5e/pop-to-esi 95 59/pop-to-ecx 96 58/pop-to-eax 97 # . epilogue 98 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 99 5d/pop-to-ebp 100 c3/return 101 102 test-next-word-or-string: 103 # . prologue 104 55/push-ebp 105 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 106 # setup 107 # . clear-stream(_test-input-stream) 108 # . . push args 109 68/push _test-input-stream/imm32 110 # . . call 111 e8/call clear-stream/disp32 112 # . . discard args 113 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 114 # var slice/ecx: slice 115 68/push 0/imm32/end 116 68/push 0/imm32/start 117 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx 118 # write(_test-input-stream, " ab") 119 # . . push args 120 68/push " ab"/imm32 121 68/push _test-input-stream/imm32 122 # . . call 123 e8/call write/disp32 124 # . . discard args 125 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 126 # next-word-or-string(_test-input-stream, slice) 127 # . . push args 128 51/push-ecx 129 68/push _test-input-stream/imm32 130 # . . call 131 e8/call next-word-or-string/disp32 132 # . . discard args 133 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 134 # check-ints-equal(_test-input-stream->read, 4, msg) 135 # . . push args 136 68/push "F - test-next-word-or-string/updates-stream-read-correctly"/imm32 137 68/push 4/imm32 138 b8/copy-to-eax _test-input-stream/imm32 139 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 140 # . . call 141 e8/call check-ints-equal/disp32 142 # . . discard args 143 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 144 # check-ints-equal(slice->start - _test-input-stream->data, 2, msg) 145 # . check-ints-equal(slice->start - _test-input-stream, 14, msg) 146 # . . push args 147 68/push "F - test-next-word-or-string: start"/imm32 148 68/push 0xe/imm32 149 # . . push slice->start - _test-input-stream 150 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax 151 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 152 50/push-eax 153 # . . call 154 e8/call check-ints-equal/disp32 155 # . . discard args 156 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 157 # check-ints-equal(slice->end - _test-input-stream->data, 4, msg) 158 # . check-ints-equal(slice->end - _test-input-stream, 16, msg) 159 # . . push args 160 68/push "F - test-next-word-or-string: end"/imm32 161 68/push 0x10/imm32 162 # . . push slice->end - _test-input-stream 163 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax 164 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 165 50/push-eax 166 # . . call 167 e8/call check-ints-equal/disp32 168 # . . discard args 169 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 170 # . epilogue 171 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 172 5d/pop-to-ebp 173 c3/return 174 175 test-next-word-or-string-returns-whole-comment: 176 # . prologue 177 55/push-ebp 178 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 179 # setup 180 # . clear-stream(_test-input-stream) 181 # . . push args 182 68/push _test-input-stream/imm32 183 # . . call 184 e8/call clear-stream/disp32 185 # . . discard args 186 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 187 # var slice/ecx: slice 188 68/push 0/imm32/end 189 68/push 0/imm32/start 190 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx 191 # write(_test-input-stream, " # a") 192 # . . push args 193 68/push " # a"/imm32 194 68/push _test-input-stream/imm32 195 # . . call 196 e8/call write/disp32 197 # . . discard args 198 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 199 # next-word-or-string(_test-input-stream, slice) 200 # . . push args 201 51/push-ecx 202 68/push _test-input-stream/imm32 203 # . . call 204 e8/call next-word-or-string/disp32 205 # . . discard args 206 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 207 # check-ints-equal(_test-input-stream->read, 5, msg) 208 # . . push args 209 68/push "F - test-next-word-or-string-returns-whole-comment/updates-stream-read-correctly"/imm32 210 68/push 5/imm32 211 b8/copy-to-eax _test-input-stream/imm32 212 ff 6/subop/push 1/mod/*+disp8 0/rm32/eax . . . . 4/disp8 . # push *(eax+4) 213 # . . call 214 e8/call check-ints-equal/disp32 215 # . . discard args 216 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 217 # check-ints-equal(slice->start - _test-input-stream->data, 2, msg) 218 # . check-ints-equal(slice->start - _test-input-stream, 14, msg) 219 # . . push args 220 68/push "F - test-next-word-or-string-returns-whole-comment: start"/imm32 221 68/push 0xe/imm32 222 # . . push slice->start - _test-input-stream 223 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax 224 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 225 50/push-eax 226 # . . call 227 e8/call check-ints-equal/disp32 228 # . . discard args 229 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 230 # check-ints-equal(slice->end - _test-input-stream->data, 5, msg) 231 # . check-ints-equal(slice->end - _test-input-stream, 17, msg) 232 # . . push args 233 68/push "F - test-next-word-or-string-returns-whole-comment: end"/imm32 234 68/push 0x11/imm32 235 # . . push slice->end - _test-input-stream 236 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 0/r32/eax 4/disp8 . # copy *(ecx+4) to eax 237 81 5/subop/subtract 3/mod/direct 0/rm32/eax . . . . . _test-input-stream/imm32 # subtract from eax 238 50/push-eax 239 # . . call 240 e8/call check-ints-equal/disp32 241 # . . discard args 242 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0xc/imm32 # add to esp 243 # . epilogue 244 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp 245 5d/pop-to-ebp 246 c3/return 247 248 test-next-word-or-string-returns-empty-slice-on-eof: 249 # . prologue 250 55/push-ebp 251 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp 252 # setup 253 # . clear-stream(_test-input-stream) 254 # . . push args 255 68/push _test-input-stream/imm32 256 # . . call 257 e8/call clear-stream/disp32 258 # . . discard args 259 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp 260 # var slice/ecx: slice 261 68/push 0/imm32/end 262 68/push 0/imm32/start 263 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx 264 # write nothing to _test-input-stream 265 # next-word-or-string(_test-input-stream, slice) 266 # . . push args 267 51/push-ecx 268 68/push _test-input-stream/imm32 269 # . . call 270 e8/call next-word-or-string/disp32 271 # . . discard args 272 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp 273 # check-ints-equal(slice->end - slice->start, 0, msg) 274 # . . push args 275 68/push "F - test-next-word-or-string-returns-empty-string-on-eof"/imm32 276 68/push 0/imm32 277 # . . push slice->end - slice->start 278 8b/copy 1/mod/*+disp8 1/rm32/ecx . . . 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 pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: module ranger.gui.widgets.statusbar</title> </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>.<a href="ranger.gui.html"><font color="#ffffff">gui</font></a>.<a href="ranger.gui.widgets.html"><font color="#ffffff">widgets</font></a>.statusbar</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/ranger/ranger/gui/widgets/statusbar.py">/home/hut/ranger/ranger/gui/widgets/statusbar.py</a></font></td></tr></table> <p><tt>The statusbar displays information about the current file and directory.<br> <br> On the left side, there is a display similar to what "ls -l" would<br> print for the current file. The right side shows directory information<br> such as the space used by all the files in this directory.</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="ranger.gui.widgets.statusbar.html#Message">Message</a> </font></dt></dl> </dd> <dt><font face="helvetica, arial"><a href="ranger.gui.widgets.html#Widget">ranger.gui.widgets.Widget</a>(<a href="ranger.gui.displayable.html#Displayable">ranger.gui.displayable.Displayable</a>) </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="ranger.gui.widgets.statusbar.html#StatusBar">StatusBar</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> <br> <font color="#000000" face="helvetica, arial"><a name="Message">class <strong>Message</strong></a>(<a href=