; Simple example machine language program to print a word ; (stored in memory from a50 onwards) using indexed addressing ; mode ; ; Peter Christen, 4 April 2003 START a10 ; Start address of the program, initialise PC to this AT a10 ; Store the following data items (instructions) ; into memory from a10 onwards 110001 0 000 000 000 ; a10: setXR #0 011 001 0 000 101 000 ; a11 load mem[a50+XR] 110101 0 000 000 011 ; a12 trap 3 110010 0 000 000 001 ; a13 incXR #1 000 001 0 000 010 111 ; a14 load #27 (octal) 1110101 000 000 000 ; a15 compXR 101010 0 000 001 001 ; a16 bne a11 110101 0 000 000 001 ; a17: trap 1 (halt) AT a50 ; Store characters here (22 characters, last in ; a76) 000 000 0 001 000 011 ; a50: 'C' 000 000 0 001 001 111 ; a51: 'O' 000 000 0 001 001 101 ; a52: 'M' 000 000 0 001 010 000 ; a53: 'P' 000 000 0 000 110 010 ; a54: '2' 000 000 0 000 110 011 ; a55: '3' 000 000 0 000 110 000 ; a56: '0' 000 000 0 000 110 000 ; a57: '0' 000 000 0 000 111 010 ; a60: ':' 000 000 0 001 100 000 ; a61: ' ' 000 000 0 001 010 000 ; a62: 'P' 000 000 0 001 000 101 ; a63: 'E' 000 000 0 001 000 001 ; a64: 'A' 000 000 0 001 001 110 ; a65: 'N' 000 000 0 001 010 101 ; a66: 'U' 000 000 0 001 010 100 ; a67: 'T' 000 000 0 000 100 000 ; a70: ' ' 000 000 0 001 010 010 ; a71: 'R' 000 000 0 001 010 101 ; a72: 'U' 000 000 0 001 001 100 ; a73: 'L' 000 000 0 001 000 101 ; a74: 'E' 000 000 0 001 010 011 ; a75: 'S' 000 000 0 000 100 001 ; a76: '!'