diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-11-30 11:10:44 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-11-30 11:13:36 -0800 |
commit | ee9a9237d6324f1de1bb7150083eacf7b9af5f70 (patch) | |
tree | 86180456f2a3cf5503783afc78856280f088a863 /subx/053new_segment.subx | |
parent | 6030d7e2e56d445ca67c6a0e8c9cf33e46bc673c (diff) | |
download | mu-ee9a9237d6324f1de1bb7150083eacf7b9af5f70.tar.gz |
4802
Some automated commenting cleanup. Still needs more careful manual scanning. sed -i 's/^# 1-3/# . 1-3/' *.subx */*.subx sed -i 's/^# op/# . op/' *.subx */*.subx sed -i 's/# vim/# . . vim/' *.subx */*.subx sed -i 's/^ # push args/ # . . push args/' *.subx */*.subx sed -i 's/^ # discard args/ # . . discard args/' *.subx */*.subx sed -i 's/^ # call/ # . . call/' *.subx */*.subx sed -i 's/^ # prolog/ # . prolog/' *.subx */*.subx sed -i 's/^ # epilog/ # . epilog/' *.subx */*.subx sed -i 's/^ # save registers/ # . save registers/' *.subx */*.subx sed -i 's/^ # restore registers/ # . restore registers/' *.subx */*.subx sed -i 's/ operand / register /' *.subx */*.subx
Diffstat (limited to 'subx/053new_segment.subx')
-rw-r--r-- | subx/053new_segment.subx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/subx/053new_segment.subx b/subx/053new_segment.subx index 69115575..3809eee5 100644 --- a/subx/053new_segment.subx +++ b/subx/053new_segment.subx @@ -1,17 +1,17 @@ # Create a new segment (for data) using mmap(). == code -# instruction effective address operand displacement immediate -# op subop mod rm32 base index scale r32 -# 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 +# instruction effective address register displacement immediate +# . op subop mod rm32 base index scale r32 +# . 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) - # push args + # . . push args 68/push 0x1000/imm32 - # call + # . . call e8/call new-segment/disp32 - # discard args + # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP # store to *EAX @@ -23,7 +23,7 @@ cd/syscall 0x80/imm8 new-segment: # len : int -> address - # prolog + # . prolog 55/push-EBP 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP 53/push-EBX @@ -36,7 +36,7 @@ new-segment: # len : int -> address bb/copy-to-EBX mmap-new-segment/imm32 b8/copy-to-EAX 0x5a/imm32/mmap cd/syscall 0x80/imm8 - # epilog + # . epilog 5b/pop-to-EBX 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP 5d/pop-to-EBP @@ -59,4 +59,4 @@ mmap-new-segment: # type mmap_arg_struct # offset 00 00 00 00 # 0 since MAP_ANONYMOUS is specified -# vim:nowrap:textwidth=0 +# . . vim:nowrap:textwidth=0 |