home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / useful / os-include / utility / pack.i < prev    next >
Text File  |  1992-09-24  |  3KB  |  75 lines

  1.     IFND    UTILITY_PACK_I
  2. UTILITY_PACK_I    EQU    1
  3. **
  4. **    $VER: pack.i 39.3 (04.09.92)
  5. **    Includes Release 39.108
  6. **
  7. **    Control attributes for Pack/UnpackStructureTags()
  8. **
  9. **    (C) Copyright 1992 Commodore-Amiga Inc.
  10. **    All Rights Reserved
  11. **
  12. *******************************************************************************
  13. *
  14. * PackStructureTags() and UnpackStructureTags(), two very important routines
  15. * for 3.0...
  16. *
  17. *******************************************************************************
  18. *
  19.     include    "exec/types.i"
  20.     include    "exec/macros.i"
  21.     include    "utility/tagitem.i"
  22. *
  23. *******************************************************************************
  24. *
  25. * PackTable definition:
  26. *
  27. * The PackTable is a simple array of LONGWORDS that are then evaluated
  28. * by PackStructureTags and UnpackStructureTags.
  29. *
  30. * The table contains compressed information such as the tag offset from
  31. * the base tag.  The tag offset has a limited range so the base tag is
  32. * defined in the first longword.
  33. *
  34. * After the first longword, the fields look as follows:
  35. *
  36. *    +--------- 1 = signed, 0 = unsigned (for bits, 1=inverted boolean)
  37. *    |
  38. *    |  +------ 00 = Pack/Unpack, 10 = Pack, 01 = Unpack, 11 = special
  39. *    | / \
  40. *    | | |  +-- 00 = Byte, 01 = Word, 10 = Long, 11 = Bit
  41. *    | | | / \
  42. *    | | | | | /----- For bit operations: 1 = TAG_EXISTS is TRUE
  43. *    | | | | | |
  44. *    | | | | | | /-------------------- Tag offset from base tag value
  45. *    | | | | | | |              \
  46. *    m n n o o p q q q q q q q q q q r r r s s s s s s s s s s s s s
  47. *                    \   | |              |
  48. *    Bit offset (for bit operations) ----/ |              |
  49. *                          \               |
  50. *    Offset into data structure -----------------------------------/
  51. *
  52. * A -1 longword signifies that the next longword will be a new base tag
  53. *
  54. * A 0 longword signifies that it is the end of the pack table.
  55. *
  56. * What this implies is that there are only 13-bits of address offset
  57. * and 10 bits for tag offsets from the base tag.  For most uses this
  58. * should be enough, but when this is not, either multiple pack tables
  59. * or a pack table with extra base tags would be able to do the trick.
  60. * The goal here was to make the tables small and yet flexible enough to
  61. * handle most cases.
  62. *
  63.     BITDEF    PST,SIGNED,31
  64.     BITDEF    PST,UNPACK,30    ; Note that these are active low...
  65.     BITDEF    PST,PACK,29    ; Note that these are active low...
  66.     BITDEF    PST,EXISTS,26    ; Tag exists bit true flag hack...
  67. *
  68. *******************************************************************************
  69. *
  70.     ; Macros will go here...
  71. *
  72. *******************************************************************************
  73. *
  74.     ENDC
  75.