English Amiga Board

Go Back   English Amiga Board > Support > support.Other

Thread Tools
Old 24 February 2020, 08:50   #1
Registered User
Join Date: Mar 2019
Location: Sweden
Posts: 29
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, 13:04   #2
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 2,981
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, 13:51   #3
Ex nihilo nihil

malko's Avatar
Join Date: Oct 2017
Location: CH
Posts: 3,780
From the doc :

[...] 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, 16:10   #4
Registered User
Join Date: Mar 2019
Location: Sweden
Posts: 29
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, 21:59   #5
Registered User
Join Date: Sep 2011
Location: Paris/France
Posts: 249
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 10:27
pure bit not set? amigalizard support.Apps 4 04 September 2005 06:47
Grab It !!!!! It Is Pure History plasmatron Amiga scene 3 15 March 2004 23:08
Best pure DOS emulators!! Bloodwych Retrogaming General Discussion 23 07 July 2003 21: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 14:14.

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