added CLEAR-STREAM
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 19 May 2021 07:46:12 +0000 (17:46 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Wed, 19 May 2021 07:46:12 +0000 (17:46 +1000)
stdio.asm

index 1773da2d3b76c9e98cdf5d3aa74872fd2f90fc19..5767d8b8258be3c1b11fd92d67832ce6245cbfa6 100644 (file)
--- a/stdio.asm
+++ b/stdio.asm
@@ -70,6 +70,14 @@ p_stream_MEM:
        push rax
        jmp exit
 
+       WORD p_clear_stream,'CLEAR-STREAM',fasm
+       ;; ( stream -- )
+       ;; Clear buffer of input stream
+       pop rax
+       mov rbx,qword [rax+16]  ; copy fill
+       mov qword [rax+24],rbx  ; into current
+       next
+       
 ;;; ========================================
 ;;; Stream reading
 ;;; READ-STREAM-CHAR ( stream -- ch )