; Simple example machine language program to read and print a line START a10 ; start address of the program, initialise PC to this AT a0 0000 0000 0000 0000 ; a0: memory cell where the character will be stored AT a10 ; store the following data items (instructions) into ; memory from a10 onwards 110101 0000 0000 10 ; a10: trap 2 (Get), read character 001 010 0000 0000 00 ; a11: store a0, store the character 000 111 0000 0010 10 ; a12: compare EOL (End-Of-Line character) 101001 0000 0011 10 ; a13: branch equal a16 110101 0000 0000 11 ; a14: trap 3 (Put), print character 101000 0000 0010 00 ; a15: jump to a10, jump to start of loop 110101 0000 0000 11 ; a16: trap 3 (Put), print EOL character 110101 0000 0000 01 ; a17: trap 1 (Halt), stop the program