From 104e521c04d1a0cad9c68fb11e250e12ad8917ef Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 17 Oct 2018 07:08:47 -0700 Subject: 4709 --- html/subx/053new_segment.subx.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'html/subx/053new_segment.subx.html') diff --git a/html/subx/053new_segment.subx.html b/html/subx/053new_segment.subx.html index 49724d37..af0bd778 100644 --- a/html/subx/053new_segment.subx.html +++ b/html/subx/053new_segment.subx.html @@ -62,11 +62,11 @@ if ('onhashchange' in window) { 7 # 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 8 9 # main: (manual test if this is the last file loaded) -10 # EAX = new_segment(0x1000) +10 # EAX = new-segment(0x1000) 11 # push arg 12 68/push 0x1000/imm32 13 # call -14 e8/call new_segment/disp32 +14 e8/call new-segment/disp32 15 # discard arg 16 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP 17 @@ -75,22 +75,22 @@ if ('onhashchange' in window) { 20 21 # exit(EAX) 22 89/copy 3/mod/direct 3/rm32/EBX . . . 0/r32/EAX . . # copy EAX to EBX -23 b8/copy . . . . . . . 1/imm32/exit # copy to EAX +23 b8/copy-to-EAX 1/imm32/exit 24 cd/syscall 0x80/imm8 25 -26 new_segment: # len : int -> address +26 new-segment: # len : int -> address 27 # prolog 28 55/push-EBP 29 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 30 53/push-EBX -31 # copy len to mmap_new_segment.len -32 # TODO: compute mmap_new_segment+4 before runtime -33 8b/copy 1/mod/*+disp8 4/rm32/SIB 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX -34 bb/copy . . . . . . . mmap_new_segment/imm32 # copy to EBX +31 # copy len to mmap-new-segment.len +32 # TODO: compute mmap-new-segment+4 before runtime +33 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX +34 bb/copy-to-EBX mmap-new-segment/imm32 35 89/copy 1/mod/*+disp8 3/rm32/EBX . . . 0/r32/EAX 4/disp8 . # copy EAX to *(EBX+4) -36 # mmap(mmap_new_segment) -37 bb/copy . . . . . . . mmap_new_segment/imm32 # copy to EBX -38 b8/copy . . . . . . . 0x5a/imm32/mmap # copy to EAX +36 # mmap(mmap-new-segment) +37 bb/copy-to-EBX mmap-new-segment/imm32 +38 b8/copy-to-EAX 0x5a/imm32/mmap 39 cd/syscall 0x80/imm8 40 # epilog 41 5b/pop-to-EBX @@ -100,7 +100,7 @@ if ('onhashchange' in window) { 45 46 == data 47 # various constants used here were found in the Linux sources (search for file mman-common.h) -48 mmap_new_segment: # type mmap_arg_struct +48 mmap-new-segment: # type mmap_arg_struct 49 # addr 50 00 00 00 00 # null 51 # len @@ -114,7 +114,7 @@ if ('onhashchange' in window) { 59 # offset 60 00 00 00 00 # 0 since MAP_ANONYMOUS is specified 61 -62 # vim:ft=subx:nowrap:tw& +62 # vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0