diff options
-rwxr-xr-x | apps/survey_baremetal | bin | 56701 -> 56298 bytes | |||
-rw-r--r-- | apps/survey_baremetal.subx | 185 |
2 files changed, 0 insertions, 185 deletions
diff --git a/apps/survey_baremetal b/apps/survey_baremetal index 67808f49..6a9257c6 100755 --- a/apps/survey_baremetal +++ b/apps/survey_baremetal Binary files differdiff --git a/apps/survey_baremetal.subx b/apps/survey_baremetal.subx index 69b9790d..8a764347 100644 --- a/apps/survey_baremetal.subx +++ b/apps/survey_baremetal.subx @@ -3327,84 +3327,6 @@ $emit-elf-program-header-entry:end: # - some helpers for tests -stream-add4: # in: (addr stream byte), key: addr, val1: addr, val2: addr, val3: addr - # . prologue - 55/push-ebp - 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # . save registers - 50/push-eax - 51/push-ecx - 52/push-edx - 56/push-esi - # esi = in - 8b/copy 1/mod/*+disp8 5/rm32/ebp . . . 6/r32/esi 8/disp8 . # copy *(ebp+8) to esi - # curr/eax = &in->data[in->write] - # . eax = in->write - 8b/copy 0/mod/indirect 6/rm32/esi . . . 0/r32/eax . . # copy *esi to eax - # . eax = esi+eax+12 - 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 0/index/eax . 0/r32/eax 0xc/disp8 . # copy esi+eax+12 to eax - # max/edx = &in->data[in->size] - # . edx = in->size - 8b/copy 1/mod/*+disp8 6/rm32/esi . . . 2/r32/edx 8/disp8 . # copy *(esi+8) to edx - # . edx = esi+edx+12 - 8d/copy-address 1/mod/*+disp8 4/rm32/sib 6/base/esi 2/index/edx . 2/r32/edx 0xc/disp8 . # copy esi+edx+12 to edx - # if (curr >= max) abort - 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-addr>= $stream-add4:abort/disp8 - # *curr = key - 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0xc/disp8 . # copy *(ebp+12) to ecx - 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax - # curr += 4 - 05/add-to-eax 4/imm32 - # if (curr >= max) abort - 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-addr>= $stream-add4:abort/disp8 - # *curr = val1 - 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x10/disp8 . # copy *(ebp+16) to ecx - 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax - # curr += 4 - 05/add-to-eax 4/imm32 - # if (curr >= max) abort - 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-addr>= $stream-add4:abort/disp8 - # *curr = val2 - 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x14/disp8 . # copy *(ebp+20) to ecx - 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax - # curr += 4 - 05/add-to-eax 4/imm32 - # if (curr >= max) abort - 39/compare 3/mod/direct 0/rm32/eax . . . 2/r32/edx . . # compare eax with edx - 73/jump-if-addr>= $stream-add4:abort/disp8 - # *curr = val3 - 8b/copy 1/mod/*+disp8 5/rm32/ebp . . 1/r32/ecx 0x18/disp8 . # copy *(ebp+24) to ecx - 89/copy 0/mod/indirect 0/rm32/eax . . . 1/r32/ecx . . # copy ecx to *eax - # in->write += 16 - 81 0/subop/add 0/mod/indirect 6/rm32/esi . . . . . 0x10/imm32 # add to *esi -$stream-add4:end: - # . restore registers - 5e/pop-to-esi - 5a/pop-to-edx - 59/pop-to-ecx - 58/pop-to-eax - # . epilogue - 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp - 5d/pop-to-ebp - c3/return - -$stream-add4:abort: - # . _write(2/stderr, error) - # . . push args - 68/push "overflow in stream-add4\n"/imm32 - 68/push 2/imm32/stderr - # . . call - e8/call _write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # . syscall(exit, 1) - bb/copy-to-ebx 1/imm32 - e8/call syscall_exit/disp32 - # never gets here - stream-add5: # in: (addr stream byte), key: handle, val1: addr, val2: addr, val3: addr # . prologue 55/push-ebp @@ -3700,113 +3622,6 @@ test-trace-sssns: 5d/pop-to-ebp c3/return -trace-snsns: # s1: (addr array byte), n2: int, s3: (addr array byte), n4: int, s5: (addr array byte) - # . prologue - 55/push-ebp - 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # write(*Trace-stream, s1) - # . . push args - ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 8/disp8 . # push *(ebp+8) - ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream - # . . call - e8/call write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # write-int32-hex(*Trace-stream, n2) - # . . push args - ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0xc/disp8 . # push *(ebp+12) - ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream - # . . call - e8/call write-int32-hex/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # write(*Trace-stream, s3) - # . . push args - ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x10/disp8 . # push *(ebp+16) - ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream - # . . call - e8/call write/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # write-int32-hex(*Trace-stream, n4) - # . . push args - ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x14/disp8 . # push *(ebp+20) - ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream - # . . call - e8/call write-int32-hex/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # trace(s5) # implicitly adds a newline and finalizes the trace line - # . . push args - ff 6/subop/push 1/mod/*+disp8 5/rm32/ebp . . . . 0x18/disp8 . # push *(ebp+24) - # . . call - e8/call trace/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 4/imm32 # add to esp -$trace-snsns:end: - # . epilogue - 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp - 5d/pop-to-ebp - c3/return - -test-trace-snsns: - # . prologue - 55/push-ebp - 89/copy 3/mod/direct 5/rm32/ebp . . . 4/r32/esp . . # copy esp to ebp - # setup - # . *Trace-stream->write = 0 - 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 0/r32/eax Trace-stream/disp32 # copy *Trace-stream to eax - c7 0/subop/copy 0/mod/direct 0/rm32/eax . . . . . 0/imm32 # clear *eax - # trace-snsns("A " 2 " c " 3 " e") - # . . push args - 68/push " e"/imm32 - 68/push 3/imm32 - 68/push " c "/imm32 - 68/push 2/imm32 - 68/push "A "/imm32 - # . . call - e8/call trace-snsns/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 0x14/imm32 # add to esp -#? # dump *Trace-stream {{{ -#? # . write(2/stderr, "^") -#? # . . push args -#? 68/push "^"/imm32 -#? 68/push 2/imm32/stderr -#? # . . call -#? e8/call write/disp32 -#? # . . discard args -#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -#? # . write-stream(2/stderr, *Trace-stream) -#? # . . push args -#? ff 6/subop/push 0/mod/indirect 5/rm32/.disp32 . . . Trace-stream/disp32 # push *Trace-stream -#? 68/push 2/imm32/stderr -#? # . . call -#? e8/call write-stream/disp32 -#? # . . discard args -#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -#? # . write(2/stderr, "$\n") -#? # . . push args -#? 68/push "$\n"/imm32 -#? 68/push 2/imm32/stderr -#? # . . call -#? e8/call write/disp32 -#? # . . discard args -#? 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp -#? # }}} - # check-trace-contains("Abc 0x00000003 e") - # . . push args - 68/push "F - test-trace-snsns"/imm32 - 68/push "A 0x00000002 c 0x00000003 e"/imm32 - # . . call - e8/call check-trace-contains/disp32 - # . . discard args - 81 0/subop/add 3/mod/direct 4/rm32/esp . . . . . 8/imm32 # add to esp - # . epilogue - 89/copy 3/mod/direct 4/rm32/esp . . . 5/r32/ebp . . # copy ebp to esp - 5d/pop-to-ebp - c3/return - trace-slsls: # s1: (addr array byte), l2: (addr slice), s3: (addr array byte), l4: (addr slice), s5: (addr array byte) # . prologue 55/push-ebp |