home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / at-inc-bin.lha / os-include / exec / initializers.i < prev    next >
Text File  |  1993-10-15  |  1KB  |  71 lines

  1.     IFND    EXEC_INITIALIZERS_I
  2. EXEC_INITIALIZERS_I    SET    1
  3. **
  4. **    $VER: initializers.i 39.0 (15.10.91)
  5. **    Includes Release 40.15
  6. **
  7. **    Macros for creating InitStruct() tables
  8. **
  9. **    (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13. INITBYTE    MACRO    ; &offset,&value
  14.         IFLE    (\1)-255    ;If offset <=255
  15.         DC.B    $a0,\1        ;use byte offset
  16.         DC.B    \2,0
  17.         MEXIT            ;exit early
  18.         ENDC
  19.         DC.B    $e0,0
  20.         DC.W    \1
  21.         DC.B    \2,0
  22.         ENDM
  23.  
  24. INITWORD    MACRO    ; &offset,&value
  25.         IFLE    (\1)-255    ;If offset <=255
  26.         DC.B    $90,\1        ;use byte offset
  27.         DC.W    \2
  28.         MEXIT            ;exit early
  29.         ENDC
  30.         DC.B    $d0,0
  31.         DC.W    \1
  32.         DC.W    \2
  33.         ENDM
  34.  
  35. INITLONG    MACRO    ; &offset,&value
  36.         IFLE    (\1)-255    ;If offset <=255
  37.         DC.B    $80,\1        ;use byte offset
  38.         DC.L    \2
  39.         MEXIT            ;exit early
  40.         ENDC
  41.         DC.B    $c0,0
  42.         DC.W    \1
  43.         DC.L    \2
  44.         ENDM
  45.  
  46. ;size=source size 0=long, 1=word, 2=byte, 3=illegal.
  47. ;offset=offset from memory base to put data
  48. ;value=unused
  49. ;count=number of source items to copy, minus one
  50. ;follow this macro with the proper sized data (dc.b,dc.w,dc.l,etc.)
  51. INITSTRUCT    MACRO    ; &size,&offset,&value,&count
  52.         DS.W    0
  53.         IFC    '\4',''
  54. COUNT\@    SET    0
  55.         ENDC
  56.         IFNC    '\4',''
  57. COUNT\@    SET    \4
  58.         ENDC
  59. CMD\@        SET    (((\1)<<4)!COUNT\@)
  60.         IFLE    (\2)-255    ;byte offset large enough?
  61.         DC.B    (CMD\@)!$80
  62.         DC.B    \2
  63.         MEXIT
  64.         ENDC
  65.         DC.B    CMD\@!$0C0    ;byte too small, use 24-bit offset.
  66.         DC.B    (((\2)>>16)&$0FF)
  67.         DC.W    ((\2)&$0FFFF)
  68.         ENDM
  69.  
  70.     ENDC    ; EXEC_INITIALIZERS_I
  71.