Minor fixes to examples.
h3rald h3rald@h3rald.com
Wed, 11 Feb 2026 17:53:35 +0100
4 files changed,
20 insertions(+),
23 deletions(-)
M
examples/fileops.xyw
→
examples/fileops.xyw
@@ -1,25 +1,23 @@
.include "lib/macros.xyw" -; main program - -; write test.txt +; Write test.txt test.txt file.path STW contents_write file.write STW $0100 file.length STW file.op.write file.operation STB -; read test.txt +; Read test.txt contents_read file.read STW $0100 file.length STW file.op.read file.operation STB -; print read contents +; Print read contents contents_read puts JSRw -; delete test.txt +; Delete test.txt file.op.delete file.operation STB -; exit +; Exit $00 system.state STB .include "lib/puts.xyw"
M
examples/korobeiniki.xyw
→
examples/korobeiniki.xyw
@@ -1,32 +1,32 @@
-;;; Korobeiniki - Traditional Russian folk song -;;; Main melody - "Type A" (Tetris Theme) +; Korobeiniki - Traditional Russian folk song +; Main melody - "Type A" (Tetris Theme) .include "lib/macros.xyw" -; note duration macros +; Note duration macros .macro n2 $00C0 ; half note .macro n4 $0060 ; quarter note .macro n8 $0030 ; eighth note -; store address of start song in xw +; Store address of start song in xw start-song POPxw -; process <length> <pitch> pairs until end-song +; Process <length> <pitch> pairs until end-song ; a16 b16 -[xw]- .label play - ; set length + ; Set length LDWxw beeper.length STW - ; go to next word + ; Go to next word INCxw INCxw - ; set pitch + ; Set pitch LDWxw beeper.pitch STW - ; go to next word + ; Go to next word INCxw INCxw - ; set volume to play the note + ; Set volume to play the note $01 beeper.level STB - ; repeat unless we are at the end of the song + ; Repeat unless we are at the end of the song PSHxw end-song LTHw play JCNw - ; terminate + ; Terminate $00 system.state STB .label start-song
M
examples/on-error.xyw
→
examples/on-error.xyw
@@ -1,13 +1,13 @@
.include "lib/macros.xyw" -; register on error handler +; Register on error handler on_error system.on_error STW -; main program +; Main program $10 $00 DIV end JMPw -; on error handler +; on_error handler ; -- .label on_error system.error LDB $01 EQU on_error.div-by-zero.print JCNw
M
examples/print-stdin.xyw
→
examples/print-stdin.xyw
@@ -1,4 +1,3 @@
- .include "lib/macros.xyw" ; Set on_keypress event handler