examples/cmdexec.xyw
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
.include "lib/macros.xyw" ; Set command to execute cmd file.path STW ; Capture output to buffer output file.read STW $0100 file.length STW ; Execute command file.op.exec file.operation STB ; Print captured output execution-label puts JSRw output puts JSRw ; Print: Result: <code>\n result puts JSRw file.result LDW putdw JSRw NL HLT .include "lib/putdw.xyw" .include "lib/puts.xyw" .label execution-label .string "Output: " .label result .string "Result: " .label cmd .string "uname -s" .label output |