qdosmsq:traps:trap_1:xtop

-/SMS_XTOP

This trap performs an external operation.

Call ParametersReturn Parameters
D0.B$25D0.LPreserved

No errors are returned by this trap.

  • No registers are used.
  • The code following Trap #1 is executed as if it were part of a system call. At entry the registers are changed so that A6 points to the system variables and A5 points to the stack frame which contains D7.L and the previous values of A5 and A6. The code is executed in supervisor mode and must end with RTS, at which point a return is made to the address on the stack.

The example below shows the use of this trap call to obtain the value of PROGD$.

It is assumed that A6 points to the dataspace and that progd is the offset of the long word to hold the value of PROGD$.

info    moveq   #$25,d0         ; SMS_XTOP
        trap    #1              ; Set registers and go to supervisor mode
        bsr     get_progd       ; "later" is put on the stack     
later   ...                     ; Program continues in user mode

get_progd:
        move.l  sv_prog(a6),8+progd(a5)
        rts                     ; Registers are restored and return to "later". 
  • qdosmsq/traps/trap_1/xtop.txt
  • Last modified: 2009/01/19 14:38
  • by george.gwilt