About
Docs
Files
Support
Index

Essentials
AutoDocs
Library functions
Cooperate
Process mastering
Debug
Own debugging kit
FGE
Smart modeid pick
Loader
Shared lib. loader
Macros
Helper macros
Structs
All the structures
Logs
Library changelogs
Tools
Progs baked inside

MACROS
LP2IEEE()A
QBASEASSIGN()A
QBASEASSIGN2()A
QBASEDECL()A
QBASEDECL2()A
QBASEJUMPTAB()A
QBASELOCAL()A
QBASEPOINTER()A
QBASERESOLVE()A
QBASESLOTS()A
QDEV_HLP_ASMDIVU()A
QDEV_HLP_ASMMULU()A
QDEV_HLP_DELTAITER()A
QDEV_HLP_DELTASCAN()A
QDEV_HLP_DFUNC()A
QDEV_HLP_DIVUQUAD()A
QDEV_HLP_DSTOTV()A
QDEV_HLP_GETREG()A
QDEV_HLP_ISLISTEMPTY()A
QDEV_HLP_ITERATE()A
QDEV_HLP_MULUQUAD()A
QDEV_HLP_NOINTSEC()A
QDEV_HLP_NOSWITCH()A
QDEV_HLP_PROCDECL()A
QDEV_HLP_PROCEXIT()A
QDEV_HLP_REMOTE()A
QDEV_HLP_RESGLOB()A
QDEV_HLP_SETREG()A
QDEV_HLP_TASKDECL()A
QDEV_HLP_TVTODS()A
REGARG()A
REGVAR()A
__LOADA4()A
__SAVEA4()A
QDEVDEBUG()P
QDEVDEBUGIO()P
MFADD()I
MFCGE()I
MFCLE()I
MFCMP()I
MFDIV()I
MFFIX()I
MFFLT()I
MFMUL()I
MFSUB()I
MFVALUE()I
QDEV_HLP_ABS()I
QDEV_HLP_ADDTV()I
QDEV_HLP_ASMALIAS()I
QDEV_HLP_ASMENTRY()I
QDEV_HLP_BADDR()I
QDEV_HLP_BYTESPERROW()I
QDEV_HLP_EQUALIZEUC()I
QDEV_HLP_EQUALIZELC()I
QDEV_HLP_E_DIVULONG10()I
QDEV_HLP_FFPTOIEEE()I
QDEV_HLP_FLIP()I
QDEV_HLP_FNV32CSUM()I
QDEV_HLP_FNV32HASH()I
QDEV_HLP_IEEETOFFP()I
QDEV_HLP_LCOPYMEM()I
QDEV_HLP_LSHIFT64()I
QDEV_HLP_MAX()I
QDEV_HLP_MIN()I
QDEV_HLP_MKBADDR()I
QDEV_HLP_MKSTR()I
QDEV_HLP_MULU32X32()I
QDEV_HLP_N_DIVULONG10()I
QDEV_HLP_N_MULUXXX10()I
QDEV_HLP_NEG()I
QDEV_HLP_QUICKFILL()I
QDEV_HLP_SWAPQUAD()I
QDEV_HLP_POPCOUNT()I
QDEV_HLP_RASSIZE()I
QDEV_HLP_ROUNDPOW2()I
QDEV_HLP_RSHIFT64()I
QDEV_HLP_SUBTV()I
QDEV_HLP_SWAPLONG()I
QDEV_HLP_SWAPQUAD()I
QDEV_HLP_SWAPWORD()I



_
_
S
A
V
E
A
4
(
)

SOURCE: qdev_macros.txt 1.16 (12/09/2014) English

                                 AMIGA - PUBLIC
 ----------------------------------------------------------------------------

   NAME

      __SAVEA4() - Saves the contents of a CPU register A4 in
                   the variable given.



   SYNOPSIS

      __SAVEA4(val);

      __SAVEA4([LONG]);



   FUNCTION

      This macro allows to store the contents of A4  m68xxx CPU
      register in a variable for later use. This macro is only
      active when binary model requested in 'gcc' is '-resident'
      or '-resident32' and the define '-Dresident' was passed.



   INPUTS

      val - Var.(not its address!) that will keep the contents
            of the register.



   RETURNS

      No output.



   BASES

      None.



   NOTES

      Use this macro when compiling so called pure executables
      when the parent proc. spawns some children and they need
      to access parent's globals(prior to A4!).

      The macro will be a stub when binary model is just reloc
      so it can stay in the code independently of the setting.



   SEE ALSO

      __LOADA4()



   EXAMPLE

      #include <proto/exec.h>
      #include <exec/execbase.h>
      #include <proto/dos.h>
      #include <proto/alib.h>
      #include <qdev.h>

      struct mystruct
      {
        LONG  ms_a4;
        LONG  ms_sync;
        void *ms_tc;
      };

      void subtask(void)
      {
        struct ExecBase *SysBase = (*((struct ExecBase **) 4));
        struct mystruct *ms;

        Wait(SIGBREAKF_CTRL_C);

        if ((ms = SysBase->ThisTask->tc_UserData))
        {
          __LOADA4(ms->ms_a4);

          /*
           * Can now use all the bases parent did initilize.
          */
          ...

          Forbid();

          ms->ms_sync--;

          Signal(ms->ms_tc, SIGBREAKF_CTRL_C);
        }

        RemTask(SysBase->ThisTask);
      }

      int main(void)
      {
        struct Task *tc;
        struct mystruct ms;

        __SAVEA4(ms.ms_a4);

        ms.ms_sync = 0;

        ms.ms_tc = SysBase->ThisTask;

        if ((tc = CreateTask("subtask", 0, subtask, 4096)))
        {
          ms.ms_sync++;

          tc->tc_UserData = &ms;

          Signal(tc, SIGBREAKF_CTRL_C);
        }

        /*
         * Wait for the 'subtask()'s to be complete. This is
         * the best way when spawning multiple children.
        */
        while (ms.ms_sync)
        {
          Wait(SIGBREAKF_CTRL_C);
        }

        return 0;
      }



   BUGS

      None known.



 ----------------------------------------------------------------------------
    


No more fear cus pure HTML is here!
Copyright (C) 2013-2014 by Burnt Chip Dominators