; ; rta_tst0_squares.rta ; ==================== ; ; Computation of the squares 1 to 200. ; _name Squares _dim f 200 ; declare an array with 200 elements pause Computation~of~200~squares~... clr q 0 ; offset q zero cls ; clear the internal text output area prints \Squares\\ ; write into it the headline. The "\" are Newlines loop: mov r0 q ; offset power r0 2 ; The square computation put f q r0 ; put z into array (=base address) f, element (=offset) q inc q ; increment the offset cmple q 200 loop ; if q le 200 next loop clr q ; reset the offset loop2: get a f q ; get a from array f, offset q printn q 3 0 ; output of index q (3 digits) prints ~ ; output of a space printn a 5 0 ; output of the square (5 digits) prints \ ; newline output add q 1 ; next index cmple q 200 loop2 ; if q less equal 200 next number output save rta_squares pause Computation~complete.~Result~is~written~in~file~rta_squares.txt exit _end