.include "lib/macros.xyw"
cmd file.path STW
output file.read STW
$0100 file.length STW
file.op.exec file.operation STB
output linux contains JSRw print-linux JCNw
output bsd contains JSRw print-bsd JCNw
output darwin contains JSRw print-macos JCNw
output mingw contains JSRw print-windows JCNw
output windows contains JSRw print-windows JCNw
unknown puts JSRw NL
.label halt
HLT
.label print-windows
windows puts JSRw NL
halt JMPw
.label print-linux
linux puts JSRw NL
halt JMPw
.label print-bsd
bsd puts JSRw NL
halt JMPw
.label print-macos
macos puts JSRw NL
halt JMPw
.include "lib/puts.xyw"
.include "lib/contains.xyw"
.label output
.reserve $0100
.label cmd
.string "uname -s"
.label linux
.string "Linux"
.label bsd
.string "BSD"
.label darwin
.string "Darwin"
.label mingw
.string "MinGW"
.label windows
.string "Windows"
.label macos
.string "macOS"
.label unknown
.string "Unknown"