From 27ef047ae54d26283fad0593d5a8ff8f8a213901 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Wed, 5 Dec 2018 22:34:59 -0800 Subject: 4842 --- subx/059read-byte.subx | 3 +-- subx/062write-byte.subx | 3 +-- subx/065error-byte.subx | 20 +++++++++++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) (limited to 'subx') 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 -- cgit 1.4.1-2-gfad0