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



Q
D
E
V
_
H
L
P
_
D
F
U
N
C
(
)

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

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

   NAME

      QDEV_HLP_DFUNC() - Creates driver function for actual
                         function.



   SYNOPSIS

      QDEV_HLP_DFUNC(r, at, dn, fn);

      QDEV_HLP_DFUNC(<registers>, <type>, <driver>, <func>);



   FUNCTION

      This macro makes it possible to generate a wrapper func
      that saves and restores particular registers so that it
      is safe to use high level code in restricted code. This
      macro defines the driver as global!



   INPUTS

      r   - Register names in m68k assembly notation that are
            ought to be saved and then restored. Regs can be
            grouped in ranges, passed alone and/or separated
            by slashes. For instance: d1-d4/d7/a1-a3/a6 .

      at  - Return type of the driver function. This gives a
            hint to compiler on how to treat driver function
            in your code.

      dn  - Driver function symbol.

      fn  - Actual function symbol. Code that will be called
            by the driver.



   RETURNS

      No output.



   BASES

      None.



   NOTES

      A group of QDEV_DFREGS_#? contains predefined registers
      for most problematic/used functions.



   SEE ALSO

   EXAMPLE

      /*
       * This routine is to utilise two registers, d0 and d1.
       * Output = d0, input = d1. Compiler will save them but
       * if you attempt direct assmebly pokes on other regs
       * then after it returns your program may fail.
      */
      LONG myroutine(REGARG(LONG in, d1))
      {
        /*
         * This is in no way an example on how to code! It is
         * a bad karma! Unfortunately some AmigaOS routines
         * are coded in a similar way... But lets go back to
         * the point. OK the d2 is now trashed and it was not
         * saved.
        */
        asm("\n\t move.l #0x0008,d2"
            "\n\t rol.l  #1,d2     "
            "\n\t and.l  d1,d2     ");

        return in;
      }

      /*
       * There is an easy way to fix this problem. We need to
       * introduce the driver for this routine by taking out
       * registers it uses. Registers a5(frame) and a7(stack)
       * must always be discarded.
      */
      QDEV_HLP_DFUNC
      (
        d2-d7/a0-a4/a6,
        LONG, drv_myroutine,
        myroutine
      );

      /*
       * Use preprocessor to redefine symbol so that there is
       * no need to edit whole code. Please keep in mind that
       * the driver function defines return type only so be
       * careful about arguments afterwards!
      */
      #define myroutine drv_myroutine

      int main(void)
      {
        printf("value = %ld\n", myroutine(64));

        return 0;
      }



   BUGS

      None known.



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


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