all repos — xyw @ b4405494fd2f54383c8bcc2357b0e6b6e0b34d02

A minimal virtual machine and assembler for terminals.

examples/print-stdin.xyw

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
.include "devices.xyw" 

; Set on_keypress event handler
print-key terminal.on_keypress STW
; End program
end JMPw

; on_keypress event handler
.label print-key
    ; Print typed character
    terminal.input LDB terminal.output STB
    ; Print new line
    $0A terminal.output STB
    BRK

.label end