all repos — xyw @ b771a21192b4387bcb521e35af7578e1ee937dc1

A minimal virtual machine and assembler for terminals.

Nearly working (character prints only in certain cases).
h3rald h3rald@h3rald.com
Wed, 03 Dec 2025 18:14:16 +0100
commit

b771a21192b4387bcb521e35af7578e1ee937dc1

parent

364f21b11c14e3b2e7349144bbfb69949fe64358

2 files changed, 14 insertions(+), 3 deletions(-)

jump to
M devices/console.cdevices/console.c

@@ -23,7 +23,7 @@ (void)error;

switch (addr) { case XYW_CONSOLE_OUTPUT: - putchar(val); + fputc(val, stdout); fflush(stdout); break; case XYW_CONSOLE_ERROR:
M xywasm.cxywasm.c

@@ -754,9 +754,20 @@ else

{ if (!ctx->sp || *ctx->sp == '\0') { - break; + if (token_length > 0) + { + // Force token finalization on string end + c = '\n'; + } + else + { + break; + } + } + else + { + c = *ctx->sp++; } - c = *ctx->sp++; } // Handle character if (c == '\n')