WikiPendium

(beta)

Super()

WikiPendium :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-52-14-85-76.us-east-2.compute.amazonaws.com

Super()


VOIDP Super( stack )

VOIDP stack;

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()

Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]