•  Back 
  •  GEMDOS Function Reference 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  %About 
  •  Show info about hypertext 
  •  View a new file 
Topic       : The ATARI Compendium
Author      : Scott Sanders / JAY Software
Version     : 1.25 (20/6/2003)
Subject     : Documentation
Nodes       : 1117
Index Size  : 32614
HCP-Version : 6
Compiled on : Atari
@charset    : UTF-8
@lang       : en
@default    : 
@help       : %About
@options    : +g -i -t4 +y +z
@width      : 100
View Ref-FileSupexec()
Super()                                                              GEMDOS

Syntax

VOIDP Super( stack )
VOIDP stack;

Function      Super() allows you to interrogate or alter the state of the
              680x0.

Opcode        32 (0x20)

Availability  All GEMDOS versions.

Parameters    stack defines the meaning of the call as follows:

              Name         stack      Meaning

              SUP_SET      (VOIDP)0   The processor is placed in
                                      supervisor mode and the old
                                      supervisor stack is returned.

              SUP_INQUIRE  (VOIDP)1   This interrogates the current mode
                                      of the processor. If the processor
                                      is in user mode a SUP_USER (0) is
                                      returned, otherwise a SUP_SUPER (1)
                                      is returned.

              -            >1         The processor is placed in user mode
                                      and the supervisor stack is reset to
                                      stack.

Binding       pea      stack
              move.w   #$20,-(sp)
              trap     #1
              addq.l   #6,sp

Return Value  Super() returns a different value based on the stack
              parameter. The various return values are explained above.

Caveats       You should never call the AES in supervisor mode. In
              addition, supervisor mode should be entered and left in the
              same stack context (same 'C' function) or stack corruption
              can result.

Comments      To execute portion of a program in supervisor mode you
              normally call Super() with a parameter of 0 and save the
              return value. When ready to return to user mode you call
              Super() again with the saved return value as a parameter.
              Supervisor mode should be used sparingly under MiNT as no
              task switching can occur.

See Also      Supexec()