all repos — xyw @ 9b18c49f3ddc04f94cc5eba2c3e153753d51c05e

A minimal virtual machine and assembler for terminals.

Updated on-error example.
h3rald h3rald@h3rald.com
Mon, 09 Feb 2026 13:19:28 +0100
commit

9b18c49f3ddc04f94cc5eba2c3e153753d51c05e

parent

83a2c0774130fbde2cedb16c372779670c928c0c

2 files changed, 5 insertions(+), 4 deletions(-)

jump to
M examples/on-error.xywexamples/on-error.xyw

@@ -15,13 +15,14 @@ $00 system.error STB

RTS .label on_error.div-by-zero.print div-by-zero-error puts JSRw - $03 system.error STB + $00 system.error STB RTS .include "lib/puts.xyw" .label div-by-zero-error -.string "Error: Division by zero.\n" + .string "Error: Division by zero.\n" .label unknown-error -.string "Error: Unknown error.\n" + .string "Error: Unknown error.\n" + .label end
M test.shtest.sh

@@ -5,7 +5,7 @@ ### Test cases

TEST_CASES=( "run_test helloworld.xyw assert_output_equals \$'Hello, World!\\n'" "run_test d6.xyw assert_output_in_range 1 6" - "run_test on-error.xyw assert_output_equals \$'Error: Division by zero.\\nError: Unknown error.\\n'" + "run_test on-error.xyw assert_output_equals \$'Error: Division by zero.\\n'" "run_test print-args.xyw test1 test2 -- assert_output_equals \$'print-args.xim, test1, test2\\n'" "run_test factorial8.xyw assert_output_equals \$'120\\n'" "run_test factorial16.xyw assert_output_equals \$'5040\\n'"