diff options
author | Kartik Agaram <vc@akkartik.com> | 2021-11-09 09:23:31 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2021-11-09 09:23:31 -0800 |
commit | 3ff2fe607c2cb5690d201d3b83ddcc957e949b7a (patch) | |
tree | 2dd6019731bad313ecf0423d6063c9d0fa0bb77e /html/linux/104new-segment.subx.html | |
parent | ef8fd8851a883eefd7bd55ffc31d6e00f67d50a8 (diff) | |
download | mu-3ff2fe607c2cb5690d201d3b83ddcc957e949b7a.tar.gz |
.
Diffstat (limited to 'html/linux/104new-segment.subx.html')
-rw-r--r-- | html/linux/104new-segment.subx.html | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/html/linux/104new-segment.subx.html b/html/linux/104new-segment.subx.html index d0080976..5948db37 100644 --- a/html/linux/104new-segment.subx.html +++ b/html/linux/104new-segment.subx.html @@ -15,14 +15,14 @@ body { font-size:12pt; font-family: monospace; color: #000000; background-color: a { color:inherit; } * { font-size:12pt; font-size: 1em; } .subxComment { color: #005faf; } -.subxS2Comment { color: #8a8a8a; } -.LineNr { } -.subxFunction { color: #af5f00; text-decoration: underline; } .subxS1Comment { color: #0000af; } +.subxMinorFunction { color: #875f5f; } +.LineNr { } .Constant { color: #008787; } -.SpecialChar { color: #d70000; } +.subxS2Comment { color: #8a8a8a; } +.subxFunction { color: #af5f00; text-decoration: underline; } .Normal { color: #000000; background-color: #ffffd7; padding-bottom: 1px; } -.subxMinorFunction { color: #875f5f; } +.CommentedCode { color: #8a8a8a; } --> </style> @@ -76,26 +76,26 @@ if ('onhashchange' in window) { <span id="L16" class="LineNr">16 </span><span class="subxS1Comment"># . op subop mod rm32 base index scale r32</span> <span id="L17" class="LineNr">17 </span><span class="subxS1Comment"># . 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</span> <span id="L18" class="LineNr">18 </span> -<span id="L19" class="LineNr">19 </span><span class="SpecialChar">Entry</span>: <span class="subxComment"># manual test</span> -<span id="L20" class="LineNr">20 </span> <span class="subxComment"># var ad/ecx: allocation-descriptor</span> -<span id="L21" class="LineNr">21 </span> 68/push 0/imm32/limit -<span id="L22" class="LineNr">22 </span> 68/push 0/imm32/curr -<span id="L23" class="LineNr">23 </span> 89/copy 3/mod/direct 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 4/r32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy esp to ecx</span> -<span id="L24" class="LineNr">24 </span> <span class="subxComment"># new-segment(0x1000, ad)</span> -<span id="L25" class="LineNr">25 </span> <span class="subxS2Comment"># . . push args</span> -<span id="L26" class="LineNr">26 </span> 51/push-ecx -<span id="L27" class="LineNr">27 </span> 68/push 0x1000/imm32 -<span id="L28" class="LineNr">28 </span> <span class="subxS2Comment"># . . call</span> -<span id="L29" class="LineNr">29 </span> e8/call <a href='104new-segment.subx.html#L40'>new-segment</a>/disp32 -<span id="L30" class="LineNr">30 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L31" class="LineNr">31 </span> 81 0/subop/add 3/mod/direct 4/rm32/esp <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 8/imm32 <span class="subxComment"># add to esp</span> -<span id="L32" class="LineNr">32 </span> <span class="subxComment"># var eax: (addr _) = ad->curr</span> -<span id="L33" class="LineNr">33 </span> 8b/copy 0/mod/indirect 1/rm32/ecx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy *ecx to eax</span> -<span id="L34" class="LineNr">34 </span> <span class="subxComment"># write to *eax to check that we have access to the newly-allocated segment</span> -<span id="L35" class="LineNr">35 </span> c7 0/subop/copy 0/mod/direct 0/rm32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0x34/imm32 <span class="subxComment"># copy to *eax</span> -<span id="L36" class="LineNr">36 </span> <span class="subxComment"># syscall(exit, eax)</span> -<span id="L37" class="LineNr">37 </span> 89/copy 3/mod/direct 3/rm32/ebx <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="Normal"> . </span> 0/r32/eax <span class="Normal"> . </span> <span class="Normal"> . </span> <span class="subxComment"># copy eax to ebx</span> -<span id="L38" class="LineNr">38 </span> e8/call <a href='000init.subx.html#L18'>syscall_exit</a>/disp32 +<span id="L19" class="LineNr">19 </span><span class="CommentedCode">#? Entry: # manual test</span> +<span id="L20" class="LineNr">20 </span><span class="CommentedCode">#? # var ad/ecx: allocation-descriptor</span> +<span id="L21" class="LineNr">21 </span><span class="CommentedCode">#? 68/push 0/imm32/limit</span> +<span id="L22" class="LineNr">22 </span><span class="CommentedCode">#? 68/push 0/imm32/curr</span> +<span id="L23" class="LineNr">23 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 1/rm32/ecx . . . 4/r32/esp . . # copy esp to ecx</span> +<span id="L24" class="LineNr">24 </span><span class="CommentedCode">#? # new-segment(0x1000, ad)</span> +<span id="L25" class="LineNr">25 </span><span class="CommentedCode">#? # . . push args</span> +<span id="L26" class="LineNr">26 </span><span class="CommentedCode">#? 51/push-ecx</span> +<span id="L27" class="LineNr">27 </span><span class="CommentedCode">#? 68/push 0x1000/imm32</span> +<span id="L28" class="LineNr">28 </span><span class="CommentedCode">#? # . . call</span> +<span id="L29" class="LineNr">29 </span><span class="CommentedCode">#? e8/call new-segment/disp32</span> +<span id="L30" class="LineNr">30 </span><span class="CommentedCode">#? # . . discard args</span> +<span id="L31" class="LineNr">31 </span><span class="CommentedCode">#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp</span> +<span id="L32" class="LineNr">32 </span><span class="CommentedCode">#? # var eax: (addr _) = ad->curr</span> +<span id="L33" class="LineNr">33 </span><span class="CommentedCode">#? 8b/copy 0/mod/indirect 1/rm32/ecx . . . 0/r32/eax . . # copy *ecx to eax</span> +<span id="L34" class="LineNr">34 </span><span class="CommentedCode">#? # write to *eax to check that we have access to the newly-allocated segment</span> +<span id="L35" class="LineNr">35 </span><span class="CommentedCode">#? c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0x34/imm32 # copy to *eax</span> +<span id="L36" class="LineNr">36 </span><span class="CommentedCode">#? # syscall_exit(eax)</span> +<span id="L37" class="LineNr">37 </span><span class="CommentedCode">#? 89/copy 3/mod/direct 3/rm32/ebx . . . 0/r32/eax . . # copy eax to ebx</span> +<span id="L38" class="LineNr">38 </span><span class="CommentedCode">#? e8/call syscall_exit/disp32</span> <span id="L39" class="LineNr">39 </span> <span id="L40" class="LineNr">40 </span><span class="subxFunction">new-segment</span>: <span class="subxComment"># len: int, ad: (addr allocation-descriptor)</span> <span id="L41" class="LineNr">41 </span> <span class="subxS1Comment"># . prologue</span> |