Implemented .reserve directive.
h3rald h3rald@h3rald.com
Mon, 03 Aug 2026 16:05:20 +0200
5 files changed,
45 insertions(+),
7 deletions(-)
M
CHANGELOG.md
→
CHANGELOG.md
@@ -1,5 +1,13 @@
## Changelog +### v350-5 — 2026-08-03 + +#### New Features + +- Implemented support for creating symlinks via file device. +- Implemented support for synchronous command execution with optional output capture via file device. +- Implemented new `.reserve` directive to reserve bytes. + ### v330-0 — 2026-07-31 #### Fixes
M
examples/cmdexec.xyw
→
examples/cmdexec.xyw
@@ -8,20 +8,21 @@ $0100 file.length STW
; Execute command file.op.exec file.operation STB ; Print captured output -execution-label puts JSRw +output-prefix puts JSRw output puts JSRw ; Print: Result: <code>\n -result puts JSRw +result-prefix puts JSRw file.result LDW putdw JSRw NL HLT .include "lib/putdw.xyw" .include "lib/puts.xyw" -.label execution-label +.label output +.reserve $0100 +.label output-prefix .string "Output: " -.label result +.label result-prefix .string "Result: " .label cmd -.string "uname -s" -.label output+.string "uname -s"
M
xyw-vscode/syntaxes/xyw.tmLanguage.json
→
xyw-vscode/syntaxes/xyw.tmLanguage.json
@@ -38,7 +38,7 @@ "directives": {
"patterns": [ { "name": "keyword.control.directive.xyw", - "match": "\\.(include|label|macro|string|byte)\\b" + "match": "\\.(include|label|macro|string|byte|reserve)\\b" } ] },
M
xywasm.c
→
xywasm.c
@@ -703,6 +703,30 @@ store_byte(0);
return validate_single_directive_argument(ctx, r); } +static int process_directive_reserve(xyw_context *ctx) +{ + xyw_token_terminator r = next_token(ctx); + if (r == TOKEN_END_INVALID) + { + return -1; + } + if (token_length == 0 || token[0] != '$') + { + token_error("Expected a hex number ($XX or $XXXX) after .reserve"); + return -1; + } + if (process_number(ctx) != 0) + { + return -1; + } + XYW_DBG("Directive:\t.reserve %s [%u bytes]\n", token, token_value); + for (unsigned int i = 0; i < token_value; i++) + { + store_byte(0); + } + return validate_single_directive_argument(ctx, r); +} + static int process_directive_byte(xyw_context *ctx) { xyw_token_terminator r;@@ -868,6 +892,10 @@ }
else if (token_length == 5 && strcmpn(token, ".byte", 5) == 0) { r = process_directive_byte(ctx); + } + else if (token_length == 8 && strcmpn(token, ".reserve", 8) == 0) + { + r = process_directive_reserve(ctx); } else if (token_length == 6 && strcmpn(token, ".macro", 6) == 0) {