Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubX in SubX: computing addresses for labels #34

Merged
merged 172 commits into from
Jul 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
172 commits
Select commit Hold shift + click to select a range
2a72df4
initial skeleton for survey.subx
akkartik May 18, 2019
90fd6a6
.
akkartik May 19, 2019
d3d452e
.
akkartik May 20, 2019
886097a
.
akkartik May 25, 2019
7c06e10
.
akkartik May 25, 2019
0b2d2d9
new primitive for tests: check-string-equal
akkartik May 25, 2019
6c03f2e
new primitive: array-equal?
akkartik May 25, 2019
bd31dbe
.
akkartik May 25, 2019
5610284
new primitive: parse-array-of-ints
akkartik May 26, 2019
cb3d96b
new primitive: check-array-equal
akkartik May 26, 2019
7c575de
.
akkartik May 26, 2019
965dd1b
.
akkartik May 27, 2019
43f1c41
start fleshing out trace support some more
akkartik Jun 6, 2019
d9c4825
added tests for compute-width
charles-l Jun 8, 2019
0d0af0a
implement compute-width
charles-l Jun 8, 2019
21cb677
.
akkartik Jun 8, 2019
627b35b
.
akkartik Jun 8, 2019
3527296
Fix stale `initialize-trace-stream`
akkartik Jun 8, 2019
35dd69f
.
akkartik Jun 8, 2019
c437318
snapshot of trace primitives
akkartik Jun 8, 2019
53f5c71
fix stale docs
akkartik Jun 8, 2019
eb75af0
.
akkartik Jun 8, 2019
2879505
.
akkartik Jun 8, 2019
6928eb9
.
akkartik Jun 9, 2019
f47066a
.
akkartik Jun 12, 2019
5ac0786
new Vim convenience macro
akkartik Jun 12, 2019
fa66b0a
only open the trace if test fails
akkartik Jun 12, 2019
fc95aaf
fork vimrc for Mu and SubX
akkartik Jun 12, 2019
edac54a
rerun most recent test if cursor not in a test
akkartik Jun 12, 2019
bf569a9
.
akkartik Jun 12, 2019
66bce43
.
akkartik Jun 12, 2019
ab107e1
.
akkartik Jun 12, 2019
55ea211
flesh out survey tests
akkartik Jun 12, 2019
acdd7a7
.
akkartik Jun 13, 2019
b5f8041
pseudocode skeletons for all functions
akkartik Jun 13, 2019
fbb92d8
implement skip-next-line
charles-l Jun 15, 2019
1efabd2
implement next-line-matches?
charles-l Jun 15, 2019
07ef071
fix bug in skip-next-line
charles-l Jun 16, 2019
e9860d2
.
akkartik Jun 17, 2019
01b6cfe
support `CFLAGS=-g ./run_one_test.sh ...`
akkartik Jun 17, 2019
382029b
bugfix to opcode 8f; it requires subops
akkartik Jun 17, 2019
8effbb4
move test data to bottom of file
akkartik Jun 17, 2019
21299a3
fix two hangs in trace-scan
akkartik Jun 17, 2019
ff30b00
.
akkartik Jun 17, 2019
f3d3c4e
.
akkartik Jun 17, 2019
3b2d621
.
akkartik Jun 17, 2019
5be5fcd
fix layout and some comments
akkartik Jun 17, 2019
a7e21db
.
akkartik Jun 28, 2019
33ba3de
.
akkartik Jun 28, 2019
397f7c4
.
akkartik Jun 29, 2019
8e9fde4
initial draft of solution for 'compute-addresses'
akkartik Jun 29, 2019
aa09f29
.
akkartik Jun 29, 2019
0721fb5
Implement is-label?
charles-l Jun 29, 2019
676a80b
add test data
charles-l Jun 29, 2019
b41c2c7
.
akkartik Jun 29, 2019
5df043b
.
akkartik Jun 29, 2019
89a7cac
.
akkartik Jun 29, 2019
0fab3de
.
akkartik Jun 30, 2019
5a91762
.
akkartik Jun 30, 2019
7a276d6
.
akkartik Jun 30, 2019
eada7e3
.
akkartik Jun 30, 2019
954133e
.
akkartik Jun 30, 2019
51c311d
unsigned comparison for addresses in more places
akkartik Jul 1, 2019
4d0a047
.
akkartik Jul 1, 2019
120a740
some primitives for emitting traces
akkartik Jul 2, 2019
065b82a
.
akkartik Jul 2, 2019
0e51077
.
akkartik Jul 2, 2019
22cea31
.
akkartik Jul 2, 2019
13be43d
.
akkartik Jul 2, 2019
1c576e9
error in pseudocode for compute-offsets
akkartik Jul 2, 2019
dc84843
.
akkartik Jul 2, 2019
9d5ba2d
.
akkartik Jul 2, 2019
7895d0a
.
akkartik Jul 2, 2019
34cf8a7
subx/survey: now computing label addresses
akkartik Jul 2, 2019
87ef858
updates to survey - part of compute-offsets implemented
charles-l Jul 4, 2019
98096ca
add is-label block
charles-l Jul 4, 2019
d818fdd
add todo for section thats not quite complete
charles-l Jul 4, 2019
85cc81a
.
akkartik Jul 4, 2019
76aec0e
.
akkartik Jul 4, 2019
06abba2
Merge branch 'master' into survey
akkartik Jul 4, 2019
c015791
.
akkartik Jul 4, 2019
f80a025
implement segment section in compute-offsets
charles-l Jul 4, 2019
9ac5834
more progress in compute-offset
charles-l Jul 5, 2019
b950602
cleanup in compute-offset and fix bug in compute-width
charles-l Jul 7, 2019
764b572
move phase 3 out of helpers
akkartik Jul 7, 2019
633c289
.
akkartik Jul 7, 2019
fb8474a
new failing test: emit-segments
akkartik Jul 7, 2019
c17643b
remove segfaults in survey.subx
charles-l Jul 7, 2019
c0a9043
made first compute-offset test pass
charles-l Jul 8, 2019
c38b36e
move `is-label?` to `subx-common`
akkartik Jul 8, 2019
23bc365
.
akkartik Jul 8, 2019
195d62f
build `num-bytes`
akkartik Jul 8, 2019
6a9d56f
.
akkartik Jul 8, 2019
7ba3337
.
akkartik Jul 8, 2019
761833a
.
akkartik Jul 8, 2019
58b60a6
.
akkartik Jul 8, 2019
7af8f4e
preserve truthiness of non-booleans
akkartik Jul 8, 2019
597ce7a
.
akkartik Jul 8, 2019
fc07ee4
.
akkartik Jul 8, 2019
e5cffe3
.
akkartik Jul 8, 2019
925fc49
.
akkartik Jul 8, 2019
de3d481
pull a couple more functions into subx-common
akkartik Jul 8, 2019
01b4530
colocate compute-offsets with its globals
akkartik Jul 8, 2019
b5da792
.
akkartik Jul 8, 2019
fe77a29
.
akkartik Jul 8, 2019
476049a
.
akkartik Jul 9, 2019
c01f78f
update library docs
akkartik Jul 9, 2019
7761194
switch to global Heap
akkartik Jul 9, 2019
b8b9225
keep labels definitions on a separate line
akkartik Jul 9, 2019
acc83b6
there's a variant of get-or-insert for slices
akkartik Jul 9, 2019
dc7066c
there's a variant of compute-width for slices
akkartik Jul 9, 2019
eb4b45d
.
akkartik Jul 9, 2019
ba93234
move 'segment-start' to a global variable as well
akkartik Jul 9, 2019
d6c6aeb
.
akkartik Jul 9, 2019
ca32bfb
.
akkartik Jul 9, 2019
7a752f8
this looks like a bug
akkartik Jul 9, 2019
f6ea256
preserve truthiness of non-booleans
akkartik Jul 9, 2019
5821a0f
clean up after a few calls
akkartik Jul 9, 2019
b14457a
.
akkartik Jul 9, 2019
c7564b7
.
akkartik Jul 9, 2019
4a73902
.
akkartik Jul 10, 2019
7bc9240
.
akkartik Jul 10, 2019
4a96b65
.
akkartik Jul 10, 2019
58d03e4
bug: null address messing up instruction decode
akkartik Jul 10, 2019
20a5277
done with emit-segments
akkartik Jul 10, 2019
48aabc8
mostly done with emit-output
akkartik Jul 10, 2019
57714dd
.
akkartik Jul 10, 2019
7e9cdf3
.
akkartik Jul 10, 2019
84aa2fa
.
akkartik Jul 10, 2019
1e4f110
.
akkartik Jul 10, 2019
3f097f3
finally tracked down binary character in traces
akkartik Jul 10, 2019
c6ec8fa
zero out new rows returned by get-or-insert
akkartik Jul 10, 2019
304bce5
start distinguishing table lookups from inserts
akkartik Jul 10, 2019
c5f7d9d
.
akkartik Jul 10, 2019
4ae08e0
.
akkartik Jul 10, 2019
551112f
.
akkartik Jul 10, 2019
538f24c
.
akkartik Jul 10, 2019
c2725b6
made test 2 pass
charles-l Jul 12, 2019
2805308
updated test so 'x' is relative to file-offset not segment offset
charles-l Jul 12, 2019
3a3e7a9
move discard instruction to correct spot
charles-l Jul 12, 2019
f57a458
.
akkartik Jul 12, 2019
be995e2
revert compute-offsets to segment-relative offsets
akkartik Jul 12, 2019
554bd09
label offset computation still has a bug
akkartik Jul 12, 2019
bbfa2ac
.
akkartik Jul 12, 2019
98994d5
the problem: curr-segment-name is stale
akkartik Jul 12, 2019
2c45de0
.
akkartik Jul 12, 2019
7fed723
.
akkartik Jul 12, 2019
a0c877f
one failure remaining in test-compute-offsets
akkartik Jul 12, 2019
022075e
.
akkartik Jul 12, 2019
0be794d
.
akkartik Jul 12, 2019
38a314d
rearrange compute-offsets cases
akkartik Jul 12, 2019
e150e6e
the pseudocode is pretty long, so add an outline
akkartik Jul 12, 2019
f0eb631
compute-offsets test now passing
akkartik Jul 12, 2019
2870525
.
akkartik Jul 12, 2019
066e01f
.
akkartik Jul 12, 2019
94f2de6
.
akkartik Jul 12, 2019
8ba17d8
.
akkartik Jul 13, 2019
fb935ea
fixed one bug, hit another
akkartik Jul 13, 2019
f518bd9
.
akkartik Jul 13, 2019
a259389
fixed second bug, hit third
akkartik Jul 13, 2019
4c81119
.
akkartik Jul 13, 2019
195a0d7
fixed third bug, hit fourth
akkartik Jul 13, 2019
50ac5ca
fixed fourth bug, hit fifth
akkartik Jul 13, 2019
d30c716
.
akkartik Jul 13, 2019
58c643c
fixed fifth bug, hit sixth
akkartik Jul 13, 2019
62bb910
.
akkartik Jul 13, 2019
c6f91e1
`test-convert-computes-addresses` bugfix six
akkartik Jul 14, 2019
17fb42c
grow the output stream; test now completes
akkartik Jul 14, 2019
2773d5a
survey.subx now passing all tests
akkartik Jul 14, 2019
e63ec16
.
akkartik Jul 14, 2019
ae30c46
add subx/apps/survey to CI
akkartik Jul 14, 2019
7f23be0
.
akkartik Jul 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
.
Clean up.
  • Loading branch information
akkartik committed Jul 14, 2019
commit 7f23be0107af59f37a948151eefe9c4d39ddf96e
Binary file modified subx/apps/survey
Binary file not shown.
264 changes: 132 additions & 132 deletions subx/apps/survey.subx
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ convert: # in : (address buffered-file), out : (address buffered-file) -> <void
68/push 0/imm32/read
68/push 0/imm32/write
89/copy 3/mod/direct 2/rm32/EDX . . . 4/r32/ESP . . # copy ESP to EDX
# write(2/stderr, "compute-offsets\n") {{{
# . . push args
68/push "compute-offsets\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
# }}}
#? # write(2/stderr, "compute-offsets\n") {{{
#? # . . push args
#? 68/push "compute-offsets\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
#? # }}}
# compute-offsets(in, segments, labels)
# . . push args
52/push-EDX
Expand All @@ -153,15 +153,15 @@ convert: # in : (address buffered-file), out : (address buffered-file) -> <void
e8/call compute-offsets/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP
# write(2/stderr, "compute-addresses\n") {{{
# . . push args
68/push "compute-addresses\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
# }}}
#? # write(2/stderr, "compute-addresses\n") {{{
#? # . . push args
#? 68/push "compute-addresses\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
#? # }}}
# compute-addresses(segments, labels)
# . . push args
52/push-EDX
Expand All @@ -177,15 +177,15 @@ convert: # in : (address buffered-file), out : (address buffered-file) -> <void
e8/call rewind-stream/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
# write(2/stderr, "emit-output\n") {{{
# . . push args
68/push "emit-output\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
# }}}
#? # write(2/stderr, "emit-output\n") {{{
#? # . . push args
#? 68/push "emit-output\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
#? # }}}
#? # dump *Trace-stream {{{
#? # . write(2/stderr, "^")
#? # . . push args
Expand Down Expand Up @@ -1639,15 +1639,15 @@ emit-output: # in : (address buffered-file), out : (address buffered-file), seg
# . prolog
55/push-EBP
89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP
# write(2/stderr, "emit-headers\n") {{{
# . . push args
68/push "emit-headers\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
# }}}
#? # write(2/stderr, "emit-headers\n") {{{
#? # . . push args
#? 68/push "emit-headers\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
#? # }}}
# emit-headers(out, segments, labels)
# . . push args
ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x14/disp8 . # push *(EBP+20)
Expand All @@ -1657,15 +1657,15 @@ emit-output: # in : (address buffered-file), out : (address buffered-file), seg
e8/call emit-headers/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 0xc/imm32 # add to ESP
# write(2/stderr, "emit-segments\n") {{{
# . . push args
68/push "emit-segments\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
# }}}
#? # write(2/stderr, "emit-segments\n") {{{
#? # . . push args
#? 68/push "emit-segments\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
#? # }}}
# emit-segments(in, out, segments, labels)
# . . push args
ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x14/disp8 . # push *(EBP+20)
Expand Down Expand Up @@ -2455,15 +2455,15 @@ emit-headers: # out : (address buffered-file), segments : (address stream {stri
# . save registers
50/push-EAX
51/push-ECX
# write(2/stderr, "emit-elf-header\n") {{{
# . . push args
68/push "emit-elf-header\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
# }}}
#? # write(2/stderr, "emit-elf-header\n") {{{
#? # . . push args
#? 68/push "emit-elf-header\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
#? # }}}
# emit-elf-header(out, segments, labels)
# . . push args
ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 . # push *(EBP+16)
Expand All @@ -2485,84 +2485,84 @@ $emit-headers:loop:
# if (curr-segment >= max) break
39/compare 3/mod/direct 0/rm32/EAX . . . 1/r32/ECX . . # compare EAX with ECX
0f 83/jump-if-greater-or-equal-unsigned $emit-headers:end/disp32
# dump curr-segment->name {{{
# . write(2/stderr, "about to emit ph entry: segment->name: ")
# . . push args
68/push "about to emit ph entry: segment->name: "/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
# . clear-stream(Stderr+4)
# . . save EAX
50/push-EAX
# . . push args
b8/copy-to-EAX Stderr/imm32
05/add-to-EAX 4/imm32
50/push-EAX
# . . call
e8/call clear-stream/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
# . . restore EAX
58/pop-to-EAX
# . print-int32-buffered(Stderr, &curr-segment)
# . . push args
50/push-EAX
68/push Stderr/imm32
# . . call
e8/call print-int32-buffered/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP
# . flush(Stderr)
# . . push args
68/push Stderr/imm32
# . . call
e8/call flush/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
# . 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
# . print-int32-buffered(Stderr, curr-segment->name)
# . . push args
ff 6/subop/push 0/mod/indirect 0/rm32/EAX . . . . . . # push *EAX
68/push Stderr/imm32
# . . call
e8/call print-int32-buffered/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP
# . flush(Stderr)
# . . push args
68/push Stderr/imm32
# . . call
e8/call flush/disp32
# . . discard args
81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/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
# }}}
# write(2/stderr, "emit-segment-header\n") {{{
# . . push args
68/push "emit-segment-header\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
# }}}
#? # dump curr-segment->name {{{
#? # . write(2/stderr, "about to emit ph entry: segment->name: ")
#? # . . push args
#? 68/push "about to emit ph entry: segment->name: "/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
#? # . clear-stream(Stderr+4)
#? # . . save EAX
#? 50/push-EAX
#? # . . push args
#? b8/copy-to-EAX Stderr/imm32
#? 05/add-to-EAX 4/imm32
#? 50/push-EAX
#? # . . call
#? e8/call clear-stream/disp32
#? # . . discard args
#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
#? # . . restore EAX
#? 58/pop-to-EAX
#? # . print-int32-buffered(Stderr, &curr-segment)
#? # . . push args
#? 50/push-EAX
#? 68/push Stderr/imm32
#? # . . call
#? e8/call print-int32-buffered/disp32
#? # . . discard args
#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP
#? # . flush(Stderr)
#? # . . push args
#? 68/push Stderr/imm32
#? # . . call
#? e8/call flush/disp32
#? # . . discard args
#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP
#? # . 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
#? # . print-int32-buffered(Stderr, curr-segment->name)
#? # . . push args
#? ff 6/subop/push 0/mod/indirect 0/rm32/EAX . . . . . . # push *EAX
#? 68/push Stderr/imm32
#? # . . call
#? e8/call print-int32-buffered/disp32
#? # . . discard args
#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP
#? # . flush(Stderr)
#? # . . push args
#? 68/push Stderr/imm32
#? # . . call
#? e8/call flush/disp32
#? # . . discard args
#? 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/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
#? # }}}
#? # write(2/stderr, "emit-segment-header\n") {{{
#? # . . push args
#? 68/push "emit-segment-header\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
#? # }}}
# emit-elf-program-header-entry(out, curr-segment)
# . . push args
50/push-EAX
Expand Down