This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
qdosmsq:traps:trap_1:acjb [2009/01/14 14:21]
qdosmsq:traps:trap_1:acjb [2013/06/03 15:04] (current)
george.gwilt D3 corrupted too? and clarification of the job's registers A4-7.
Line 1: Line 1:
 +====== MT_ACTIV/SMS_ACJB ======
 +Activate a newly created job.
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$0A|D0.L|Error code.|
 +|D1.L|Id of the job to be activated.|D1.L|Preserved.|
 +|D2.B|Job's priority. See notes below.|D2.L|Undefined. See notes below.|
 +|D3.W|Timeout.|D3.L|Undefined. See notes below.|
 +|A0.L|Unused. |A0.L|Base address of activated job.|
 +|A3.L|Unused. |A3.L|Preserved if D3.W is zero, corrupted otherwise.|
 +===== Errors =====
 +|ERR_NJ|Invalid job id.|
 +|ERR_NC|Not complete (Job is already active).|
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * If the timeout in D3.W is zero, then this equates to EXEC or EX and the job doing the activation will continue to run. Otherwise, it will wait for the activated to complete before continuing. Dickens indicates that D3.W should be 0 or -1. Pennell refers to the value as 0 or <>0. Best to assume 0 or -1. 
 +  * A3.L is corrupted if the timeout was not zero on entry.
 +  * The priority passed in D2.B is documented as being in the range 0 to 127, however, it appears that values from 0 to 255 can be used.
 +  * Dickens states that D2 and D3 are preserved and Pennell says corrupted. Best to assume the worst and consider them corrupted.
 +  * This trap always exits via the job scheduler, so it is not atomic.
 +  * When the job is created by MT_CJOB, all registers except A4 to A7 are zero. A6 points to the start of code, ie to just after the end of the $68 byte header block. (A6,A4) points to the start of the data area and (A6,A5) points to just after the end of the data area. A7 is set to A6 + A5 -4. Before calling MT_ACTIV it is possible for a programmer to alter the contents of any of these registers. For example the SuperBASIC commands EX and EW can set channel IDs and a parameter string on the stack. Their code achieves this by altering the contents of the stack and also the value of A7 as stored in the job's header, before calling MT_ACTIV.
 +===== Example =====
 +The following shows the use of this call :
 +        moveq   #mt_activ,d0    ; Trap code
 +        moveq   #<job_id>,d1    ; <job_id> is a known job id
 +        moveq   #32,d2          ; Standard default priority is 32
 +        moveq   #0,d3           ; Basically, EXEC the other job. Then
 +                                ; continue executing from here.
 +        trap    #1              ; Activate the job
  • qdosmsq/traps/trap_1/acjb.txt
  • Last modified: 2013/06/03 15:04
  • by george.gwilt