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

Link to this comparison view

qdosmsq:traps:trap_1:injb [2008/06/25 12:31] (current)
norman created
Line 1: Line 1:
 +====== MT_INF/SMS_INJB ======
 +Get information for an existing job.
 +^Call Parameters^^Return Parameters^^
 +|D0.B|$02|D0.L|Error code.|
 +|D1.L|Id of job to get information for.|D1.L|Id of next job in tree.|
 +|D2.L|Id of job at top of the tree.|D2.L|Parent job's id for the job we enquired upon.|
 +|D3.L|Unused.|D3.L|Lowest byte = job's priority, highest 3 bytes = $FF if job suspended, else zero.|
 +|A0.L|Unused.|A0.L|Base address (JB_END) of the job.| 
 +===== Errors =====
 +|ERR_NJ|Invalid job id.|
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * This call can be used to scan the entire job tree, by calling it in a loop with D1.L = D2.L = zero, then on each subsequent call, setting D1.L to the value just returned in D1.L. Eventually, D1.L will be returned as zero which indicates end of the tree. 
 +  * If, on entry, D1.L = D2.L <> zero, then only that sub-tree will be scanned, not the entire tree.  
 +===== Example =====
 +The following shows the use of this call to scan the entire job tree :
 +start   moveq   #0,d1             ; Zero = SuperBasic.
 +        move.l  d1,d2             ; Job at top of tree also = SuperBasic.
 +loop    moveq   #mt_jinf,d0       ; Trap code.
 +        trap    #1                ; Fetch job information, sets D1.L = next job in tree.
 +        tst.l   d0                ; Check for errors.
 +        bne.s   <Error handler>   ; Oops, an error occurred.
 +        tsl.l   d1                ; Are we done yet?
 +        beq.s   done              ; Yes, no more jobs.
 +        :
 +        <Do stuff here with info returned, but preserve D1.L and D2.L>
 +        :
 +        bra.s   loop              ; Using D1 and D2's values from the trap, go and do next job.
 +done    :
 +        :
  • qdosmsq/traps/trap_1/injb.txt
  • Last modified: 2008/06/25 12:31
  • by norman