From 03d50cc83c7c2bebb2b019667b80c1c51f4a8def Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 5 Oct 2018 19:49:47 -0700 Subject: 4667 Standardize on hyphens in all names. And we'll use colons for namespacing labels in functions. --- subx/053new_segment.subx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'subx/053new_segment.subx') diff --git a/subx/053new_segment.subx b/subx/053new_segment.subx index 8dce1684..fc0dfffc 100644 --- a/subx/053new_segment.subx +++ b/subx/053new_segment.subx @@ -7,11 +7,11 @@ # 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 # main: (manual test if this is the last file loaded) - # EAX = new_segment(0x1000) + # EAX = new-segment(0x1000) # push arg 68/push 0x1000/imm32 # call - e8/call new_segment/disp32 + e8/call new-segment/disp32 # discard arg 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP @@ -23,18 +23,18 @@ b8/copy . . . . . . . 1/imm32/exit # copy to EAX cd/syscall 0x80/imm8 -new_segment: # len : int -> address +new-segment: # len : int -> address # prolog 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 53/push-EBX - # copy len to mmap_new_segment.len - # TODO: compute mmap_new_segment+4 before runtime + # copy len to mmap-new-segment.len + # TODO: compute mmap-new-segment+4 before runtime 8b/copy 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . 0/r32/EAX 8/disp8 . # copy *(EBP+8) to EAX - bb/copy . . . . . . . mmap_new_segment/imm32 # copy to EBX + bb/copy . . . . . . . mmap-new-segment/imm32 # copy to EBX 89/copy 1/mod/*+disp8 3/rm32/EBX . . . 0/r32/EAX 4/disp8 . # copy EAX to *(EBX+4) - # mmap(mmap_new_segment) - bb/copy . . . . . . . mmap_new_segment/imm32 # copy to EBX + # mmap(mmap-new-segment) + bb/copy . . . . . . . mmap-new-segment/imm32 # copy to EBX b8/copy . . . . . . . 0x5a/imm32/mmap # copy to EAX cd/syscall 0x80/imm8 # epilog @@ -45,7 +45,7 @@ new_segment: # len : int -> address == data # various constants used here were found in the Linux sources (search for file mman-common.h) -mmap_new_segment: # type mmap_arg_struct +mmap-new-segment: # type mmap_arg_struct # addr 00 00 00 00 # null # len -- cgit 1.4.1-2-gfad0