home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / cbm / nduk-v40.lha / V40 / include / utility / pack.i < prev    next >
Text File  |  1993-10-15  |  2KB  |  75 lines

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