Post Reply 
CAS program corrupts itself
08-10-2014, 01:30 PM (This post was last modified: 08-10-2014 05:01 PM by Joe Horn.)
Post: #1
CAS program corrupts itself
The following CAS program seems to corrupt itself when run. If you attempt the following, be sure to backup your Prime first, for you will almost certainly lose everything.

On the hardware Prime, rev 6030, create this CAS program called SAVAGE:

Code:
(x)->BEGIN
 LOCAL A,B;
  A:=1;
  FOR B FROM 1 TO 2499 DO
  A:=tan(atan(e^(ln(√(A*A)))))+1;
  PRINT(A);
  END;
  RETURN(A);
END;

In CAS, in exact mode, type SAVAGE(0) Enter. You will see the counter march down the screen, slowing down as expected. After a few seconds, press On to abort the run. One of the following will probably be observed:

(1) The program's FOR line will have been changed to this:

FOR B FROM 1 TO 4999 STEP "Stopped by user interruption. Error: Bad Argument Value" DO

or (2) the FOR line will have been changed to this

FOR B FROM 1 DOWNTO 4999 DO

or (3) editing the program (to see its contents) will warmstart, or Prime will simply refuse to let you edit it.

Since memory is being corrupted, the above are probably not the only possible symptoms. A complete recovery from a backup is recommended to undo the corruption.

The emulator (rec 6031) acts slightly differently with this program. I can't wrap my head around what's happening there.

EDIT: After experimenting, it seems that pressing On to interrupt any FOR loop in a CAS program corrupts the FOR statement.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
CAS program corrupts itself - Joe Horn - 08-10-2014 01:30 PM
RE: CAS program corrupts itself - parisse - 08-11-2014, 07:07 AM
RE: CAS program corrupts itself - Joe Horn - 08-11-2014, 04:54 PM
RE: CAS program corrupts itself - Joe Horn - 10-06-2015, 06:05 AM



User(s) browsing this thread: 1 Guest(s)