Changes

Jump to: navigation, search

Caruh

2,767 bytes added, 14:37, 1 November 2023
/* Entries in Caruh */
* The 'RFMSA' function is called at address &0013 using command 'CALL &0013'. 'RFMSA' is used to reserve a part of the shared screen for a Task. This means the view that can be seen after Caruh has started. The task is then allowed to write in this area.
== III.2. Memory allocation of the Caruh application in the central RAM ==
The central RAM (main memory &7FC0) is occupied as follows from &4000 to &7FFF.
There are three RAM sections that are used for Task management:
 
* Task variables: these are contained in the first element of the task table or in the upper RAM
 
* Task table: this table contains one element for each task from 1-255
 
* VRAM table: this table defines which task uses which part of the screen
 
==== Task variables ====
The Task variables are used by Caruh to manage the individual tasks, they show what's currently going on.
 
* &4000 (TASK_AKT): This byte points to the number of the current task that is currently active.
 
* &4001 (TASK_NUM): This byte contains the number of all existing tasks.
 
* &4002 (DIS_A_T): This byte contains the number of the first task in the Task bar in the lower line on screen. This means the left Task at the bottom line
 
* &400C/D (TA_ESEL): These 16 bits contain the I/O E-RAM select when a new task is loaded into the E-RAM of the computer.
 
* &400E/F (TA_OSEV): These 16 bits contain a pointer to one of the XRAM_?? variables when a new task is loaded into the E-RAM
 
* &4010: The first element of task #1 (16 bytes) starts at this address. In Caruh's source code this would be 'TT_START + T_T_E_L'. Whereby TT_START (= &4000) + T_T_E_L (= &0010) results in &4010!
 
* &7FE4-&7FFF: This area is required for Caruh itself (as task #1)!
 
In the upper RAM, two more bytes are used by Caruh!
They are used for communication between Caruh and the Tasks:
 
* &BE02 (CCON2): Central communication byte between Caruh and the Tasks
 
'''Structure of memory address &BE02 (CCON2)'''
 
Bit 0: = 0 -> All tasks are in the background (this is the normal state). In this case Caruh works as Foreground Task
 
Bit 0: = 1 -> A task is active in the foreground, i.e. takes over the screen, keyboard query, etc. This bit is switched on by the Task itself as soon as it has actively taken control of the complete screen etc. This bit MUST also be cleared by the Task itself as soon as it returns control of the screen (and keyboard) to Caruh. When you press the ESC key, the Task must return the control of screen and keyboard to Caruh. To do this, clear bit 0 at &BE02!
 
Bit 1: -> reserved
 
Bit 2: -> reserved
 
Bit 3: -> reserved
 
Bit 4: -> reserved
 
Bit 5: -> reserved
 
Bit 6: -> reserved
 
Bit 7: = 0 -> Caruh does not print on screen right now -> Tasks run as usual
 
Bit 7: = 1 -> Caruh prints text on the screen. For example it displays menus, provides selectors for files or options and so on. -> Tasks shall NOT use the screen as long as this bit is set!
 
* &BE03 (TTNS3): Temporary buffer for a Task number memory at &BE03. Stores the number of a task (2-255) for subroutines
1,988
edits