From cf11109f96ba17c7c7a74a8fd3c31c985b8938d1 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Tue, 18 May 2021 18:21:22 +1000 Subject: [PATCH] adding TELL and EMIT --- stdio.asm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/stdio.asm b/stdio.asm index f94b0cc..7cf148d 100644 --- a/stdio.asm +++ b/stdio.asm @@ -164,3 +164,34 @@ p_read_word_nomore: pop rax popr rsi next + + WORD p_tell,'TELL',fasm + ;; ( chars* n -- ) + ;; Write n bytes from chars* to stdout + pushr rsi + pop rbx + pop rax + push 1 + push rax + push rbx + DOFORTH sys_write + pop rax + popr rsi + next + +p_emit_buffer: dq 0 + + WORD p_emit,'EMIT',fasm + ;; ( c -- ) + ;; Write byte to stdout + pushr rsi + pop rax + mov [p_emit_buffer],al + push 1 + push p_emit_buffer + push 1 + DOFORTH sys_write + pop rax + popr rsi + next + -- 2.39.2