COPYVISI START
  LAD GR1,0
LOOP LD GR2,AA,GR1
   JZE FIN
         ST GR2,BB,GR1
	LAD GR1,1,GR1
  JUMP LOOP
FIN	ST GR2,BB,GR1
	RET
BB 	DS 	10
AA 	DC 	'CASL2 cmd',0
;CC DC -1
  END
; This program copies a string "CASL2 cmd" at the location AA,
; including the null terminator (zero),
; to the memory location specified by BB.
;----------------
; Click on "Run Auto" button (green downward triangle button),
; and you will see COMET2 store the character data one by one
; into the location BB of the memory.
; ----------------
; You can rewrite the source code after COMET2 finishes execution.
; However, editing is not allowed while execution is paused.
;------------------------
; If you double-click any line in the source code,
; the corresponding memory address will be highlighted.
; Single-clicking a memory address does the same in reverse.
; This feature becomes available after successful assembly (compilation).
; It continues to work fine even while COMET2 is running,
; without affecting the program's execution.
;---------
; As shown above, you can see a clear one-to-one correspondence
; between the source code and the memory contents.
;------------
; If you activate the Roll Back function while execution is paused,
; you can freely move the clock backward or forward as many times
; as you like.
;----------
; This is a fascinating feature. In general, modern computers cannot
; run backward in time, and COMET2 is no exception.
; Yet, in CASL2 Visible Inside, the COMET2 emulator  behaves
; as if it were a reversible machine.
;-------------------------------
; To start Roll Back, select "Tools" --> "Roll Back"
; from the main menu, or press the "Roll Back in Time" button
; in the upper-right corner of this window.
;--------
; You can watch the characters copied to BB
; disappear one by one as the clock moves backward.
;--------------
; The function to move the clock backward/forward is available
; only when COMET2 is paused during step-by-step execution.
; It does not work during high-speed execution of COMET2.
;-------------------------------------
; Please also try "pn3000.txt" in the "SRC" folder,
; which calculates the first 3,000 prime numbers.
;--------------------------------------------------------
