Changes

Jump to: navigation, search

Caruh

3,560 bytes added, 15:00, 1 November 2023
/* The Task Table */
Caruh occupies the top four lines and the bottom line of the screen for his own menu system and the lower Task Bar.
= IV. Structure of a Task =
The entry / start / load address of each task is always at address &4000
The file length may not exceed 16 KB (including a potential header!)
 
Each task occupies a 16 KB block (E-RAM block) from &4000 to &7EFF
The first 512 KB of expansion memory are currently being used for this.
However, the full 4 MB E-RAM should soon be used (-> Update2025)
 
== Structure of any Task within its 16 KB block ==
* &4000-&7EFF: Program area -> Application length maximum 15.75 KB
* &7F00-&7FF7: Stack (each Task has its own Stack). Contains 124 elements
* &7FF8-&7FF9: (TCON8 and TCON9) 16 Action and Configuration bits. Please have a look at the following section :-)
* &7FFA-&7FFB: (TER16) 16 bit E-RAM selection of the Task (&7FC4-&78FF)
* &7FFC: (TAPRI) Value that is copied from the parttime/priority variable of the Task Table (if the priority is changed). (So how many 1/300 seconds is waited before the task is called.) It is the priority byte
* &7FFD: (TNUME) Number of this Task &01-&FF (255 Tasks are possible). The tasks are dynamic! (Variable name in Caruh: TNUME)
* &7FFE-&7FFF: (TSPSE) Buffer for the stack pointer SP of this Task. When switching Tasks, the register SP is also backed up
-> The program to be loaded (without header) is a maximum of &3F00 bytes long
-> The program to be loaded (with header) is a maximum of &3F80 bytes long
 
When a Task is started for the first time, its stack pointer SP is set to &7FF8. This is how the first 16-bit stack element is written to addresses &7FF6 and &7FF7. This is usually the return address when switching Tasks
 
=== The action and configuration bits ===
Memory locations &7FF8 / &7FF9 of each task contain 16 Action and Configuration bits. In addition there are Reaction bits that are set by the task:
 
==== Memory address &7FF8 (TCON8) ====
* Bits marked with a '=' are set by the task and
* Bits marked with a '-' are set by Caruh
* Bits marked with a '*' are manipulated by both Caruh and the task itself.
 
See separate sections.
 
 
Bit 0: = 0 -> Task is in the Background (this is the regular state)
 
Bit 0: = 1 -> Task is active in the Foreground, i.e. takes over the screen, keyboard query etc. This bit is switched on by Caruh. It is / can be cleared by the task. (Foreground bit)
 
 
Bit 1: = 0 -> Task cannot become a Foreground Task
 
Bit 1: = 1 -> Task can be switched as a Foreground Task. This bit must be set by the Task itself! (Switch bit)
 
 
Bit 2: -> reserved
 
 
Bit 3: = 0 -> Regular function -> Task continues to work normally ...
 
Bit 3: = 1 -> Setting this bit determines the Task to be deleted! This bit is set by the Task itself! (Kill bit)
 
 
Bit 4: = 0 -> The Task cannot be saved or does not have to be specially prepared for it using 'Save Bit 7'.
 
Bit 4: = 1 -> This Task can be saved and should be prepared using bit 7. This bit is set by the Task itself! (Storable bit)
 
 
Bit 5: = 0 -> The Task has not yet been saved.
 
Bit 5: = 1 -> The Task was saved after the save bit was set. This bit 5 is set by the Caruh system after saving. (Hold bit 6 was previously set by the task itself). This bit 5 must be reset by the task itself if the task is to be saved several times. (Secured bit)
 
 
Bit 6: = 0 -> Task is still in progress -> do not save right now! Wait!
 
Bit 6: = 1 -> Task can now be saved by the system at any time! This bit must be set by the Task itself! (Hold bit)
 
 
Bit 7: = 0 -> Regular sequence. Task is running...
 
Bit 7: = 1 -> The system asks the Task to prepare for its saving. It is then restarted again at address &4000. (Save bit)
1,988
edits