Welcome, Guest. Please login or register.

Author Topic: What does PURE mean in startup assigns?  (Read 3034 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: What does PURE mean in startup assigns?
« on: March 03, 2007, 07:41:18 PM »
There is no PURE in assigns.

You probably mean PURE/S in resident command. This "forces" the command to be considered pure, even if the 'P' protection bit is not set.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: What does PURE mean in startup assigns?
« Reply #1 on: March 03, 2007, 08:18:08 PM »
Slight correction there: You don't need to AllocMem your variables for the program to be pure. You can also use stack (local variables). Pure apps can't use globals/static data.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: What does PURE mean in startup assigns?
« Reply #2 on: March 03, 2007, 08:40:39 PM »
Yeah static const is ok.

Anyway, as pointed out some compilers can do the magic for you even if you use globals. But in that case the compiler will have some magic code there in startup that allocates and duplicates any static data for each instance of the application.

Today - with fast HDDs - creating pure apps isn't really required.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: What does PURE mean in startup assigns?
« Reply #3 on: March 03, 2007, 10:16:07 PM »
Quote
To be more precise, any const data, be it static or not, is ok, as long as it's not put in the BSS section.

Well naturally. That "static const" was about the specific case when static is ok.

Quote
Pure executables are also about saving memory, as you don't have to load the TEXT part of the program more than once in memory, much like libraries.

True. However, residents also waste memory. If the particular program is not running, it still sits in the memory eating chunk of memory for nothing.

In fact, not many programs really run simultanously often enough to justify being resident in memory.

The most benefit from resident commands comes with slow media (floppies, cd-rom etc).
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: What does PURE mean in startup assigns?
« Reply #4 on: March 03, 2007, 10:29:14 PM »
The reason resident is used in startup-sequence is to speed up the booting (esp with floppies).

Not accessing the disk is the result, but the motivation wasn't reducing disk access to avoid media wearing. Naturally this might have been someone else's motivation for using residents...