X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=stdio.asm;h=1773da2d3b76c9e98cdf5d3aa74872fd2f90fc19;hb=bf8a7c713298730826f02c4ece9f4735fcee2e4b;hp=f94b0cca194c707463e267dabecac247a7fb772f;hpb=ce86ed5b6ba71fe9f33774a41429e5f96e991be6;p=rrq%2Frrqforth.git diff --git a/stdio.asm b/stdio.asm index f94b0cc..1773da2 100644 --- a/stdio.asm +++ b/stdio.asm @@ -164,3 +164,44 @@ 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 + + WORD p_nl,'NL',dovalue + ;; ( -- c ) + ;; Pushes a newline character on the stack + dq 10 + + WORD p_sp,'SP',dovalue + ;; ( -- c ) + ;; Pushes a space character on the stack + dq 10 +