TERRA Datentechnik,     Technical Support Sheet
==========================================================================

TB-920221.1/AKG
TZ-920331.1/Bj 
TZ-920804.1/Bj -> fixed
4.0
RTSPrio.ASM

Related files: Supportdisk:  BUGS\RTS4-01.ZIP
               Mailbox    :  SIG M2V4: RTS4-01.ZIP


Subject: Priority procedures crash due to bad BP
------------------------------------------------

Related modules: RTSDevice
                 Devices
                 RS232Code
		 RS232Int		 


Monitor Entry/Exit Procedures SYSTEM_Set/ResetPriority Destroy BP
-----------------------------------------------------------------

The local variable (pointer to process descriptor) used in
"SYSTEM_Set/ResetPriority" is at BP - 4 (not BP - 2)!
This problem causes any program that uses priorities to
crash in an arbitrary way because the implicitly called monitor
entry procedure "SYSTEM_SetPriority" destroys the caller's BP
saved on the stack and pops an arbitrary value into BP upon
return! (in fact, it is the value of SS)

On the Supportdisk and in the TERRA Mailbox you can find corrected 
versions the RTS library files. Simply replace the original .LIB's 
with the corrected ones from TERRA. 
Note: The new .LIB's are collected in the archive RTS4-01.ZIP.
 
In the meantime you can follow the steps below to correct the
bug by yourself:
Programs needed: Microsoft Macro Assembler 5.1 (MASM) or higher 
	         Microsoft Library Manager (included with MASM)
	         
1. Change the faulty code:
   Replace in the file SRC\RTSPrio.ASM all "BP-2" with "BP-4".
   There are 6 replacements to be made.
   
2. Assemble the corrected file:
   MASM /ML /DRealRTS RTSPrio.ASM;
   This will produce the a new object file "RTSPrio.OBJ" - 551 Bytes.
   
3. Replace the old object with the new one in the RTS-Libraries:
   LIB M2RTS.LIB -+RTSPrio.OBJ;
   LIB M2RTSW.LIB -+RTSPrio.OBJ;
   LIB MCRTS.LIB -+RTSPrio.OBJ;
   LIB CMRTS.LUB -+RTSPrio.OBJ;
   This will replace the old RTSPrio.OBJ in the library with the 
   new one.

                                  * * *