about summary refs log tree commit diff stats
path: root/subx/examples
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2019-02-15 17:20:57 -0800
committerKartik Agaram <vc@akkartik.com>2019-02-15 17:20:57 -0800
commit9b16f190492f26e065f13f19e51c4e2180a21143 (patch)
tree7f29f176beba335f42a8ecab60f049bcf880db8c /subx/examples
parent5522bc9ec5ee5074ac5b573b66cbec8cd93ccae5 (diff)
downloadmu-9b16f190492f26e065f13f19e51c4e2180a21143.tar.gz
4973
Support immediate operands in the data segment in all the ways we support
them in the code segment.
Diffstat (limited to 'subx/examples')
-rw-r--r--subx/examples/ex11.subx2
-rw-r--r--subx/examples/ex12.subx12
-rw-r--r--subx/examples/ex4.subx2
-rw-r--r--subx/examples/ex6.subx2
-rw-r--r--subx/examples/ex7.subx7
5 files changed, 13 insertions, 12 deletions
diff --git a/subx/examples/ex11.subx b/subx/examples/ex11.subx
index bb3c8e23..071a855b 100644
--- a/subx/examples/ex11.subx
+++ b/subx/examples/ex11.subx
@@ -343,7 +343,7 @@ write-stderr:  # s : (address array byte) -> <void>
 
 Newline:
     # size
-    01 00 00 00
+    1/imm32
     # data
     0a/newline
 
diff --git a/subx/examples/ex12.subx b/subx/examples/ex12.subx
index 9cf5e14a..4518aecc 100644
--- a/subx/examples/ex12.subx
+++ b/subx/examples/ex12.subx
@@ -29,16 +29,16 @@
 # various constants used here were found in the Linux sources (search for file mman-common.h)
 Mmap-new-segment:  # type mmap_arg_struct
     # addr
-    00 00 00 00  # null
+    0/imm32
     # len
-    00 01 00 00  # 0x1000
+    0x100/imm32
     # protection flags
-    03 00 00 00  # PROT_READ | PROT_WRITE
+    3/imm32  # PROT_READ | PROT_WRITE
     # sharing flags
-    22 00 00 00  # MAP_PRIVATE | MAP_ANONYMOUS
+    0x22/imm32  # MAP_PRIVATE | MAP_ANONYMOUS
     # fd
-    ff ff ff ff  # -1 since MAP_ANONYMOUS is specified
+    -1/imm32  # since MAP_ANONYMOUS is specified
     # offset
-    00 00 00 00  # 0 since MAP_ANONYMOUS is specified
+    0/imm32  # since MAP_ANONYMOUS is specified
 
 # . . vim:nowrap:textwidth=0
diff --git a/subx/examples/ex4.subx b/subx/examples/ex4.subx
index 3060ae3f..b18a5da0 100644
--- a/subx/examples/ex4.subx
+++ b/subx/examples/ex4.subx
@@ -35,6 +35,6 @@ cd/syscall  0x80/imm8
 == data
 
 X:
-    00 00 00 00  # space for read() to write to
+    0/imm32  # space for read() to write to
 
 # . . vim:nowrap:textwidth=0
diff --git a/subx/examples/ex6.subx b/subx/examples/ex6.subx
index dece5b13..3375fb43 100644
--- a/subx/examples/ex6.subx
+++ b/subx/examples/ex6.subx
@@ -28,7 +28,7 @@
 == data
 
 Size:  # size of string
-    0e 00 00 00  # 14
+    0x0e/imm32  # 14
 X:  # string to print
     48 65 6c 6c 6f 2c 20 77 6f 72 6c 64 21 0a       00
 #   H  e  l  l  o  ,  ␣  w  o  r  l  d  !  newline  null
diff --git a/subx/examples/ex7.subx b/subx/examples/ex7.subx
index 47b51734..c6dd3423 100644
--- a/subx/examples/ex7.subx
+++ b/subx/examples/ex7.subx
@@ -94,12 +94,13 @@
 == data
 
 Stream:
-    00 00 00 00
+    0/imm32
 A:
-    61 00 00 00
+    61/imm32/A
 B:
-    00 00 00 00
+    0/imm32
 Filename:
     2e 66 6f 6f 00 00 00 00
+#   .  f  o  o  null
 
 # . . vim:nowrap:textwidth=0