about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--069allocate.subx11
-rw-r--r--070---hex.subx4
-rw-r--r--071---subx-params.subx16
-rwxr-xr-xapps/assortbin44323 -> 44323 bytes
-rwxr-xr-xapps/bracesbin43717 -> 43717 bytes
-rwxr-xr-xapps/callsbin49078 -> 49078 bytes
-rwxr-xr-xapps/crenshaw2-1bin38067 -> 38083 bytes
-rw-r--r--apps/crenshaw2-1.subx4
-rwxr-xr-xapps/crenshaw2-1bbin38626 -> 38642 bytes
-rw-r--r--apps/crenshaw2-1b.subx4
-rwxr-xr-xapps/dquotesbin49512 -> 49512 bytes
-rwxr-xr-xapps/factorialbin37079 -> 37095 bytes
-rw-r--r--apps/factorial.subx4
-rwxr-xr-xapps/handlebin37972 -> 37988 bytes
-rw-r--r--apps/handle.subx4
-rwxr-xr-xapps/hexbin19492 -> 19496 bytes
-rwxr-xr-xapps/packbin56994 -> 56994 bytes
-rw-r--r--apps/pack.subx4
-rwxr-xr-xapps/sigilsbin57016 -> 57016 bytes
-rw-r--r--apps/subx-common.subx20
-rwxr-xr-xapps/surveybin53596 -> 53596 bytes
-rwxr-xr-xapps/testsbin43140 -> 43140 bytes
22 files changed, 36 insertions, 35 deletions
diff --git a/069allocate.subx b/069allocate.subx
index f7063d2e..af3a7885 100644
--- a/069allocate.subx
+++ b/069allocate.subx
@@ -16,14 +16,19 @@
 # very same 'allocate' helper. They just need a new allocation descriptor for
 # their book-keeping.
 
-# A default allocation descriptor for programs to use.
 == data
+
+# A default allocation descriptor for programs to use.
 Heap:
   # curr
   0/imm32
   # limit
   0/imm32
 
+# a reasonable default
+Heap-size:
+  0x200000/imm32/2MB
+
 == code
 #   instruction                     effective address                                                   register    displacement    immediate
 # . op          subop               mod             rm32          base        index         scale       r32
@@ -33,10 +38,10 @@ Heap:
 
 Entry:
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/070---hex.subx b/070---hex.subx
index 9092c6dd..ffe72d06 100644
--- a/070---hex.subx
+++ b/070---hex.subx
@@ -22,10 +22,10 @@ Entry:  # run tests if necessary, convert stdin if not
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/071---subx-params.subx b/071---subx-params.subx
new file mode 100644
index 00000000..aefb6639
--- /dev/null
+++ b/071---subx-params.subx
@@ -0,0 +1,16 @@
+# Normally we introduce names in the layers that need them, but we'll make an
+# exception to colocate various knobs for translating SubX programs using SubX.
+
+== data
+
+# largest segment that can be translated
+Segment-size:
+  0x80000/imm32/512KB
+
+# maximum size of input textual stream (spanning all segments)
+Input-size:
+  0x100000/imm32/1MB
+
+# number of labels we can translate to addresses
+Max-labels:
+  0x10000/imm32/4K-labels/64KB
diff --git a/apps/assort b/apps/assort
index ef57e4e3..bdd302c3 100755
--- a/apps/assort
+++ b/apps/assort
Binary files differdiff --git a/apps/braces b/apps/braces
index 36e33941..0c338864 100755
--- a/apps/braces
+++ b/apps/braces
Binary files differdiff --git a/apps/calls b/apps/calls
index 68c86663..04c8e297 100755
--- a/apps/calls
+++ b/apps/calls
Binary files differdiff --git a/apps/crenshaw2-1 b/apps/crenshaw2-1
index aefbe733..1a895801 100755
--- a/apps/crenshaw2-1
+++ b/apps/crenshaw2-1
Binary files differdiff --git a/apps/crenshaw2-1.subx b/apps/crenshaw2-1.subx
index 42d8571a..f78f03ae 100644
--- a/apps/crenshaw2-1.subx
+++ b/apps/crenshaw2-1.subx
@@ -35,10 +35,10 @@ Entry:  # run tests if necessary, call 'compile' if not
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/apps/crenshaw2-1b b/apps/crenshaw2-1b
index fcd81297..5a1e448f 100755
--- a/apps/crenshaw2-1b
+++ b/apps/crenshaw2-1b
Binary files differdiff --git a/apps/crenshaw2-1b.subx b/apps/crenshaw2-1b.subx
index 9679bdab..2956e396 100644
--- a/apps/crenshaw2-1b.subx
+++ b/apps/crenshaw2-1b.subx
@@ -35,10 +35,10 @@ Entry:  # run tests if necessary, call 'compile' if not
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/apps/dquotes b/apps/dquotes
index c682b312..096a032d 100755
--- a/apps/dquotes
+++ b/apps/dquotes
Binary files differdiff --git a/apps/factorial b/apps/factorial
index 3c8a8e46..2641faa9 100755
--- a/apps/factorial
+++ b/apps/factorial
Binary files differdiff --git a/apps/factorial.subx b/apps/factorial.subx
index 4701615b..ef2262ec 100644
--- a/apps/factorial.subx
+++ b/apps/factorial.subx
@@ -23,10 +23,10 @@ Entry:  # run tests if necessary, compute `factorial(5)` if not
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/apps/handle b/apps/handle
index f1e9f60a..21e66ccb 100755
--- a/apps/handle
+++ b/apps/handle
Binary files differdiff --git a/apps/handle.subx b/apps/handle.subx
index 36283c16..6ebf35b2 100644
--- a/apps/handle.subx
+++ b/apps/handle.subx
@@ -28,10 +28,10 @@
 
 Entry:
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/apps/hex b/apps/hex
index 4506f819..9dd432b7 100755
--- a/apps/hex
+++ b/apps/hex
Binary files differdiff --git a/apps/pack b/apps/pack
index 0926d466..f9907948 100755
--- a/apps/pack
+++ b/apps/pack
Binary files differdiff --git a/apps/pack.subx b/apps/pack.subx
index 4dda514b..69c37bd4 100644
--- a/apps/pack.subx
+++ b/apps/pack.subx
@@ -23,10 +23,10 @@ Entry:  # run tests if necessary, convert stdin if not
     89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
 
     # initialize heap
-    # . Heap = new-segment(64KB)
+    # . Heap = new-segment(Heap-size)
     # . . push args
     68/push  Heap/imm32
-    68/push  0x10000/imm32/64KB
+    68/push  Heap-size/imm32
     # . . call
     e8/call  new-segment/disp32
     # . . discard args
diff --git a/apps/sigils b/apps/sigils
index 6c54e194..fff9e7cd 100755
--- a/apps/sigils
+++ b/apps/sigils
Binary files differdiff --git a/apps/subx-common.subx b/apps/subx-common.subx
index cc3b12af..829ed277 100644
--- a/apps/subx-common.subx
+++ b/apps/subx-common.subx
@@ -1,23 +1,3 @@
-# return shared by phases of the SubX translator
-
-== data
-
-# maximum memory available for allocation
-Heap-size:
-  0x200000/imm32/2MB
-
-# maximum size of a single segment
-Segment-size:
-  0x80000/imm32/512KB
-
-# maximum size of input textual stream (spanning all segments)
-Input-size:
-  0x100000/imm32/1MB
-
-# maximum size of the 'labels' table in survey.subx
-Max-labels:
-  0x10000/imm32/4K-labels/64KB
-
 == code
 #   instruction                     effective address                                                   register    displacement    immediate
 # . op          subop               mod             rm32          base        index         scale       r32
diff --git a/apps/survey b/apps/survey
index 81a4623c..cc94c6ca 100755
--- a/apps/survey
+++ b/apps/survey
Binary files differdiff --git a/apps/tests b/apps/tests
index 22968ff7..cb6f4a7f 100755
--- a/apps/tests
+++ b/apps/tests
Binary files differ