English Amiga Board


Go Back   English Amiga Board > Support > support.Other

 
 
Thread Tools
Old 24 February 2020, 07:50   #1
brian_p
Registered User
 
Join Date: Mar 2019
Location: Sweden
Posts: 31
How to tell if a program is PURE?

Is there a way to check if a program is "pure" if the P protection bit hasn't been set?
brian_p is offline  
Old 24 February 2020, 12:04   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Just try it and see if it works. I don't know if there is a program or better way to check it.
daxb is offline  
Old 24 February 2020, 12:51   #3
malko
Ex nihilo nihil
 
malko's Avatar
 
Join Date: Oct 2017
Location: CH
Posts: 4,856
From the doc :

Quote:
[...] The PURE option forces RESIDENT to load commands which are not marked as pure (i.e., they do not have their pure bit set), and can be used experimentally to test the pureness of other commands and programs.

Use the PURE option with caution. Remember that in order for a command to be made RESlDENT, it must be both re-entrant and re-executable. Although it is unlikely, some of your prog-rams may be pure enough to be fully re-entrant and usable by more than one process at the same time. Other programs may not be fully re-entrant but may be pure enough to be re-executable. Such commands can be made RESIDENT, but you must be extremely careful to use the command in only one process at a time. [...]
malko is offline  
Old 24 February 2020, 15:10   #4
brian_p
Registered User
 
Join Date: Mar 2019
Location: Sweden
Posts: 31
@malko
I've read that snippet several times and others like it but it doesn't tell me how I confirm if a program is in fact PURE or not. As I read it programs can act like they are PURE when they aren't and I need to be careful with forcing them to be RESIDENT but without any indicators of what to be careful about and/or look out for.

Example1: DOpus4 can run several sessions of itself but if you start one while another is running it start with a question if you want to start a new session or not. Would this count as PURE, I don't think so but I don't know for sure.

It's not as easy as just "checking for differences".
Example2: The command DIR is PURE, if I run it twice but delete files in the background the two DIR operations will have different output... might not be the best example but again, I don't know what to look for.

So if someone would please tell me HOW to test this and WHAT to look for I'd appriciate it.
brian_p is offline  
Old 24 February 2020, 20:59   #5
thellier
Registered User
 
Join Date: Sep 2011
Location: Paris/France
Posts: 274
I have read about pure and compilation a long time ago so dont remenber well
the idea is that if a program is runned several times it must stay the same as if it was runned for the first time.
So I suppose that the main thing that this program MUST avoid is to have global variables that change when runned
So global variables must just contain "quasi constant" like os-version ( that dont change with program running) but NOT things that change like a result or a window size
Of course only disassembling and understanding the code may allow to found that :-/
thellier is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
External windows program communicating with program running inside WinUAE xxxxx support.WinUAE 10 19 February 2013 09:27
pure bit not set? amigalizard support.Apps 4 04 September 2005 05:47
Grab It !!!!! It Is Pure History plasmatron Amiga scene 3 15 March 2004 22:08
Best pure DOS emulators!! Bloodwych Retrogaming General Discussion 23 07 July 2003 20:56

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:10.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09125 seconds with 15 queries