From 89bcb56717c86af44ce64f6e432d79836ae23a96 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 10 Jan 2019 17:13:47 -0800 Subject: 4918 --- subx/059read-byte.subx | 2 +- subx/062write-byte.subx | 2 +- subx/064write-buffered.subx | 2 +- subx/068read-line.subx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'subx') diff --git a/subx/059read-byte.subx b/subx/059read-byte.subx index fc583809..c62b035e 100644 --- a/subx/059read-byte.subx +++ b/subx/059read-byte.subx @@ -64,7 +64,7 @@ read-byte: # f : (address buffered-file) -> byte-or-eof/EAX e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . f->read must now be 0; update ECX + # . f->read must now be 0; update its cache at ECX 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . . # clear ECX # . EAX = read(f->fd, stream = f+4) # . . push args diff --git a/subx/062write-byte.subx b/subx/062write-byte.subx index 30e2b425..9c9b50a6 100644 --- a/subx/062write-byte.subx +++ b/subx/062write-byte.subx @@ -64,7 +64,7 @@ write-byte: # f : (address buffered-file), n : int -> e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . clear ECX (cached f->write) + # . f->write must now be 0; update its cache at ECX 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . . # clear ECX $write-byte:to-stream: # write to stream diff --git a/subx/064write-buffered.subx b/subx/064write-buffered.subx index 3c3c7276..9ae08b21 100644 --- a/subx/064write-buffered.subx +++ b/subx/064write-buffered.subx @@ -81,7 +81,7 @@ $write-buffered:loop: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . clear EBX (cached f->write) + # . f->write must now be 0; update its cache at EBX 31/xor 3/mod/direct 3/rm32/EBX . . . 3/r32/EBX . . # clear EBX $write-buffered:to-stream: # write to stream diff --git a/subx/068read-line.subx b/subx/068read-line.subx index b73958f5..961fc521 100644 --- a/subx/068read-line.subx +++ b/subx/068read-line.subx @@ -55,7 +55,7 @@ $read-line:loop: e8/call clear-stream/disp32 # . . discard args 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 4/imm32 # add to ESP - # . f->read must now be 0; update ECX + # . f->read must now be 0; update its cache at ECX 31/xor 3/mod/direct 1/rm32/ECX . . . 1/r32/ECX . . # clear ECX # . EAX = read(f->fd, stream = f+4) # . . push args -- cgit 1.4.1-2-gfad0