diff --git a/doc/hello-midas.md b/doc/hello-midas.md index 5e5860b2..1400c36f 100644 --- a/doc/hello-midas.md +++ b/doc/hello-midas.md @@ -37,3 +37,5 @@ Step by step guide on how to create a hello world in MIDAS. 6. Run the program. :hello + +The sample program can be found in the HELLO directory. diff --git a/src/hello/hello.mid b/src/hello/hello.mid new file mode 100644 index 00000000..9ffd6403 --- /dev/null +++ b/src/hello/hello.mid @@ -0,0 +1,17 @@ +title hello + +a==1 ;Define two accumulators, +b==2 ;A and B. +ch==1 ;Output channel number. + +start: .open ch,[.uao,,'tty] ;Open channel to TTY, for ASCII output. + .lose + move a,[440700,,hello] ;Load A with byte pointer to string. +loop: ildb b,a ;Load B from string. + jumpe b,[.logout 2,] ;End on zero byte. + .iot ch,b ;Print byte. + jrst loop + +hello: asciz /hello world/ + +end start ;Specify entry point.