about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-12-05 22:34:59 -0800
committerKartik Agaram <vc@akkartik.com>2018-12-05 22:34:59 -0800
commit27ef047ae54d26283fad0593d5a8ff8f8a213901 (patch)
tree26b8e44197026273a3028965f7008c83eba735d7 /subx
parent79328f9ad6f3118fd86c1f99f672d2807917d848 (diff)
downloadmu-27ef047ae54d26283fad0593d5a8ff8f8a213901.tar.gz
4842
Diffstat (limited to 'subx')
-rw-r--r--subx/059read-byte.subx3
-rw-r--r--subx/062write-byte.subx3
-rw-r--r--subx/065error-byte.subx20
3 files changed, 21 insertions, 5 deletions
diff --git a/subx/059read-byte.subx b/subx/059read-byte.subx
index ea16c928..3c0d0a76 100644
--- a/subx/059read-byte.subx
+++ b/subx/059read-byte.subx
@@ -11,7 +11,6 @@
 
 # The buffered file for standard input. Also illustrates the layout for
 # buffered-file.
-
 Stdin:
     # file descriptor or (address stream)
     00 00 00 00  # 0 = standard input
@@ -25,7 +24,7 @@ Stdin:
     00 00 00 00 00 00 00 00  # 8 bytes
 
 # TODO: 8 bytes is too small. We'll need to grow the buffer for efficiency. But
-# I don't want to type 1024 bytes here.
+# I don't want to type in 1024 bytes here.
 
 == code
 #   instruction                     effective address                                                   register    displacement    immediate
diff --git a/subx/062write-byte.subx b/subx/062write-byte.subx
index bfb8bcc3..e4c71681 100644
--- a/subx/062write-byte.subx
+++ b/subx/062write-byte.subx
@@ -7,7 +7,6 @@
 == data
 
 # The buffered file for standard output.
-
 Stdout:
     # file descriptor or (address stream)
     01 00 00 00  # 1 = standard output
@@ -21,7 +20,7 @@ Stdout:
     00 00 00 00 00 00 00 00  # 8 bytes
 
 # TODO: 8 bytes is too small. We'll need to grow the buffer for efficiency. But
-# I don't want to type 1024 bytes here.
+# I don't want to type in 1024 bytes here.
 
 == code
 #   instruction                     effective address                                                   register    displacement    immediate
diff --git a/subx/065error-byte.subx b/subx/065error-byte.subx
index 82cfd21e..dd14df4c 100644
--- a/subx/065error-byte.subx
+++ b/subx/065error-byte.subx
@@ -16,7 +16,7 @@
 #?     # . error-byte(ed, Stdout, msg, 34)
 #?     68/push  0x34/imm32
 #?     68/push  "abc"/imm32
-#?     68/push  Stdout/imm32
+#?     68/push  Stderr/imm32
 #?     50/push-EAX
 #?     e8/call  error-byte/disp32
     # automatic test
@@ -91,4 +91,22 @@ $error-byte:dead-end:
     5d/pop-to-EBP
     c3/return
 
+== data
+
+# The buffered file for standard error.
+Stderr:
+    # file descriptor or (address stream)
+    02 00 00 00  # 1 = standard error
+    # current write index
+    00 00 00 00
+    # current read index
+    00 00 00 00
+    # length (8)
+    08 00 00 00
+    # data
+    00 00 00 00 00 00 00 00  # 8 bytes
+
+# TODO: 8 bytes is too small. We'll need to grow the buffer for efficiency. But
+# I don't want to type in 1024 bytes here.
+
 # . . vim:nowrap:textwidth=0