diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-12-03 12:03:23 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-12-03 12:03:23 -0800 |
commit | 91dab3e1a499cac50abd146ce849d3dab94229ab (patch) | |
tree | 0ae698ea9ed9e1e3523aa6e5aefa9e0b8c8e2400 /html/subx/053new_segment.subx.html | |
parent | 26efb5f5c2a3ddbaf82f06e6ca6090caf7ab5a16 (diff) | |
download | mu-91dab3e1a499cac50abd146ce849d3dab94229ab.tar.gz |
4824
Diffstat (limited to 'html/subx/053new_segment.subx.html')
-rw-r--r-- | html/subx/053new_segment.subx.html | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/html/subx/053new_segment.subx.html b/html/subx/053new_segment.subx.html index 8ae47381..92a3f0e5 100644 --- a/html/subx/053new_segment.subx.html +++ b/html/subx/053new_segment.subx.html @@ -75,33 +75,33 @@ if ('onhashchange' in window) { <span id="L12" class="LineNr">12 </span> <span class="subxS2Comment"># . . call</span> <span id="L13" class="LineNr">13 </span> e8/call new-segment/disp32 <span id="L14" class="LineNr">14 </span> <span class="subxS2Comment"># . . discard args</span> -<span id="L15" class="LineNr">15 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> +<span id="L15" class="LineNr">15 </span> 81 0/subop/add 3/mod/direct 4/rm32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/imm32 <span class="subxComment"># add to ESP</span> <span id="L16" class="LineNr">16 </span> <span id="L17" class="LineNr">17 </span> <span class="subxComment"># write to *EAX to check that we have access to the newly-allocated segment</span> -<span id="L18" class="LineNr">18 </span> c7/copy 0/mod/direct 0/rm32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0x34/imm32 <span class="subxComment"># copy to *EAX</span> +<span id="L18" class="LineNr">18 </span> c7/copy 0/mod/direct 0/rm32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0x34/imm32 <span class="subxComment"># copy to *EAX</span> <span id="L19" class="LineNr">19 </span> <span id="L20" class="LineNr">20 </span> <span class="subxComment"># syscall(exit, EAX)</span> -<span id="L21" class="LineNr">21 </span> 89/copy 3/mod/direct 3/rm32/EBX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0/r32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy EAX to EBX</span> +<span id="L21" class="LineNr">21 </span> 89/copy 3/mod/direct 3/rm32/EBX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0/r32/EAX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy EAX to EBX</span> <span id="L22" class="LineNr">22 </span> b8/copy-to-EAX 1/imm32/exit <span id="L23" class="LineNr">23 </span> cd/syscall 0x80/imm8 <span id="L24" class="LineNr">24 </span> <span id="L25" class="LineNr">25 </span><span class="subxFunction">new-segment</span>: <span class="subxComment"># len : int -> address</span> <span id="L26" class="LineNr">26 </span> <span class="subxS1Comment"># . prolog</span> <span id="L27" class="LineNr">27 </span> 55/push-EBP -<span id="L28" class="LineNr">28 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/r32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy ESP to EBP</span> +<span id="L28" class="LineNr">28 </span> 89/copy 3/mod/direct 5/rm32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 4/r32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy ESP to EBP</span> <span id="L29" class="LineNr">29 </span> 53/push-EBX <span id="L30" class="LineNr">30 </span> <span class="subxComment"># copy len to _mmap-new-segment->len</span> <span id="L31" class="LineNr">31 </span> <span class="subxComment"># TODO: compute _mmap-new-segment+4 before runtime</span> -<span id="L32" class="LineNr">32 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none <span class="CommentedCode"> . </span> 0/r32/EAX 8/disp8 <span class="CommentedCode"> . </span> <span class="subxComment"># copy *(EBP+8) to EAX</span> +<span id="L32" class="LineNr">32 </span> 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none <span class="CommentedCode"> . </span> 0/r32/EAX 8/disp8 <span class="CommentedCode"> . </span> <span class="subxComment"># copy *(EBP+8) to EAX</span> <span id="L33" class="LineNr">33 </span> bb/copy-to-EBX _mmap-new-segment/imm32 -<span id="L34" class="LineNr">34 </span> 89/copy 1/mod/*+disp8 3/rm32/EBX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0/r32/EAX 4/disp8 <span class="CommentedCode"> . </span> <span class="subxComment"># copy EAX to *(EBX+4)</span> +<span id="L34" class="LineNr">34 </span> 89/copy 1/mod/*+disp8 3/rm32/EBX <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 0/r32/EAX 4/disp8 <span class="CommentedCode"> . </span> <span class="subxComment"># copy EAX to *(EBX+4)</span> <span id="L35" class="LineNr">35 </span> <span class="subxComment"># mmap(_mmap-new-segment)</span> <span id="L36" class="LineNr">36 </span> bb/copy-to-EBX _mmap-new-segment/imm32 <span id="L37" class="LineNr">37 </span> b8/copy-to-EAX 0x5a/imm32/mmap <span id="L38" class="LineNr">38 </span> cd/syscall 0x80/imm8 <span id="L39" class="LineNr">39 </span> <span class="subxS1Comment"># . epilog</span> <span id="L40" class="LineNr">40 </span> 5b/pop-to-EBX -<span id="L41" class="LineNr">41 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 5/r32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy EBP to ESP</span> +<span id="L41" class="LineNr">41 </span> 89/copy 3/mod/direct 4/rm32/ESP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> 5/r32/EBP <span class="CommentedCode"> . </span> <span class="CommentedCode"> . </span> <span class="subxComment"># copy EBP to ESP</span> <span id="L42" class="LineNr">42 </span> 5d/pop-to-EBP <span id="L43" class="LineNr">43 </span> c3/return <span id="L44" class="LineNr">44 </span> |