Difference between revisions of "MC-Basic:LOAD"

From SoftMC-Wiki
Jump to: navigation, search
m (Minor changes)
 
(5 intermediate revisions by 3 users not shown)
Line 4: Line 4:
  
 
|SYNTAX=
 
|SYNTAX=
Load <''filename''> {Priority = ''<priority level>''} {StackSize = ''<stacksize multiplier>''}
+
Load <''filename''> {Priority = ''<priority level>''} {StackSize = ''<stacksize multiplier>''} {with <''libraryName''>, <''libraryName''>,<''libraryName''>... }
  
 
|AVAILABILITY=
 
|AVAILABILITY=
Line 10: Line 10:
  
 
|DESCRIPTION=
 
|DESCRIPTION=
This command loads a programs and libraries from the Flash Disk into RAM, from where it may be exceuted. In the process, the program or library is checked for syntax errors. Syntax errors are written to the TRN.ERR file, which may be retrieved to see which errors occurred. Only programs without syntax errors may be executed. Programs are executed using the STARTTASK command. The Priority sets the ''<priority level>'' at which the task is run within the system. The highest priority is 1, which causes the task to be run after all realtime tasks have run. The lowest priority is 16. Tasks with the same priority level run using a round-robin procedure, which gives equal time to each task. A low priority task cannot interrupt a high priority task.
+
This command loads a programs and libraries from the flash memory into RAM, from where it may be executed. During the process, the program or library is checked for syntax errors. Syntax errors are written to the TRN.ERR file, which may be retrieved to see which errors occurred. Only programs without syntax errors may be executed. Programs are executed using the STARTTASK command. The Priority sets the ''<priority level>'' at which the task is run within the system. The highest priority is 1, which causes the task to be run after all realtime tasks have run. The lowest priority is 16. Tasks with the same priority level run using a round-robin procedure, which gives equal time to each task. A low priority task cannot interrupt a high priority task.
  
The StackSize optional parameter sets the size of local (Dim) variables’ stack. It’s value is a actually a floating point multiplier of an internal basic stack size.  This basic stack size is the lowest size allowed for local data stack (when size multiplier is 1), whereas the highest value depends on the amount of freememory available.
+
The StackSize optional parameter sets the size of local (Dim) variables’ stack. Its value is a actually a floating point multiplier of an internal basic stack size.  This basic stack size is the lowest size allowed for local data stack (when size multiplier is 1), whereas the highest value depends on the amount of free memory available.
 +
 
 +
From Version MULTIBUS 0.4.15.8, '''with''' functionality allows to load a task together with libraries which are automatically included in the loaded task.
 +
 +
When used in CONFIG.PRG, loading a library is equivalent to using [[MC-Basic:LOADGLOBAL|LOADGLOBAL]] for loading a global library.
  
 
{{Note|The command line operates at priority level 2. If a task is started at priority level 1, the command line is not operable until the task ends or until it releases the CPU.}}
 
{{Note|The command line operates at priority level 2. If a task is started at priority level 1, the command line is not operable until the task ends or until it releases the CPU.}}
Line 21: Line 25:
  
 
''<stacksize multiplier>'': Double
 
''<stacksize multiplier>'': Double
 +
 +
<''libraryName''>: File specification, including file name and extension
 +
  
 
|RANGE=
 
|RANGE=
<''filename''>: The file must exist on the Flash Disk.<br>
+
<''filename''>: The file must exist in the flash memory.<br>
 +
<''libraryName''>: The file must exist in the flash memory.<br>
 
''<priority level>'': 1 to 16
 
''<priority level>'': 1 to 16
  
Line 37: Line 45:
  
 
|SCOPE=
 
|SCOPE=
Task or Terminal      for programs and IMPORTED ( local ) libraries
+
Task, library or Terminal      for programs and [[MC-Basic:IMPORT|IMPORTED]] ( local ) libraries
  
Configuration            for global libraries
+
Configuration             for global libraries
  
 
|LIMITATIONS=
 
|LIMITATIONS=
Line 46: Line 54:
 
|EXAMPLE=
 
|EXAMPLE=
 
Load MAKECUT.PRG
 
Load MAKECUT.PRG
 +
 +
Load myTask1.PRG with myLib1.lib
 +
 +
Load myTask.PRG with myLib1.lib, mylib2.lib, mylib3.lib
  
 
Load LIBRARY1.LIB
 
Load LIBRARY1.LIB
Line 51: Line 63:
 
|SEE ALSO=
 
|SEE ALSO=
 
* [[MC-Basic:CONTINUETASK|CONTINUETASK]]
 
* [[MC-Basic:CONTINUETASK|CONTINUETASK]]
 +
* [[MC-Basic:UNLOAD|UNLOAD]]
 
* [[MC-Basic:KILLTASK|KILLTASK]]
 
* [[MC-Basic:KILLTASK|KILLTASK]]
 
* [[MC-Basic:STARTTASK|STARTTASK]]
 
* [[MC-Basic:STARTTASK|STARTTASK]]
 
* [[MC-Basic:IMPORT|IMPORT]]
 
* [[MC-Basic:IMPORT|IMPORT]]
 +
* [[MC-Basic:LOADGLOBAL|LOADGLOBAL]]
  
 
[[Category:MC-Basic:Task Control|LOAD]]
 
[[Category:MC-Basic:Task Control|LOAD]]
 
}}
 
}}

Latest revision as of 03:38, 25 April 2022

This command loads a programs and libraries from the flash memory into RAM, from where it may be executed. During the process, the program or library is checked for syntax errors. Syntax errors are written to the TRN.ERR file, which may be retrieved to see which errors occurred. Only programs without syntax errors may be executed. Programs are executed using the STARTTASK command. The Priority sets the <priority level> at which the task is run within the system. The highest priority is 1, which causes the task to be run after all realtime tasks have run. The lowest priority is 16. Tasks with the same priority level run using a round-robin procedure, which gives equal time to each task. A low priority task cannot interrupt a high priority task.

The StackSize optional parameter sets the size of local (Dim) variables’ stack. Its value is a actually a floating point multiplier of an internal basic stack size.  This basic stack size is the lowest size allowed for local data stack (when size multiplier is 1), whereas the highest value depends on the amount of free memory available.

From Version MULTIBUS 0.4.15.8, with functionality allows to load a task together with libraries which are automatically included in the loaded task.

When used in CONFIG.PRG, loading a library is equivalent to using LOADGLOBAL for loading a global library.

NOTE-Info.svgNOTE
The command line operates at priority level 2. If a task is started at priority level 1, the command line is not operable until the task ends or until it releases the CPU.

Syntax

Load <filename> {Priority = <priority level>} {StackSize = <stacksize multiplier>} {with <libraryName>, <libraryName>,<libraryName>... }

Availability

All versions

Type

<filename>: File specification, including file name and extension.
<priority level>: Long

<stacksize multiplier>: Double

<libraryName>: File specification, including file name and extension

Range

<filename>: The file must exist in the flash memory.
<libraryName>: The file must exist in the flash memory.
<priority level>: 1 to 16

<stacksize multiplier>:1 to MaxDouble

Default

<priority level>: 16

<stacksize multiplier>:1

Scope

Task, library or Terminal      for programs and IMPORTED ( local ) libraries

Configuration             for global libraries

Limitations

The only limitation is free memory space. The largest block of free memory may be queried using the SYSTEM.MAXMEMBLOCK query.

Examples

Load MAKECUT.PRG

Load myTask1.PRG with myLib1.lib

Load myTask.PRG with myLib1.lib, mylib2.lib, mylib3.lib

Load LIBRARY1.LIB

See Also