qdosmsq:traps:trap_1:injb

MT_INF/SMS_INJB

Get information for an existing job.

Call ParametersReturn Parameters
D0.B$02D0.LError code.
D1.LId of job to get information for.D1.LId of next job in tree.
D2.LId of job at top of the tree.D2.LParent job's id for the job we enquired upon.
D3.LUnused.D3.LLowest byte = job's priority, highest 3 bytes = $FF if job suspended, else zero.
A0.LUnused.A0.LBase address (JB_END) of the job.
A1.LUnused.A1.LCorrupted.
ERR_NJInvalid job id.
  • 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.

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