Zilog ZUSBOPTS Uživatelský manuál Strana 270

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 520
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 269
Directives UM017105-0511
242
Zilog Developer Studio II – ZNEO™
User Manual
Once applied to label tname, the individual structure elements are applied to tname to pro-
duce the desired offsets using tname as the structure base. For example, the label
tname.name_2 is created and assigned the value tname + stag.name_2. If there are
any alignment requirements with the structure, the
.TAG directive attaches the required
alignment to the label. The optional count on the
.TAG directive is meaningful only inside
a structure definition and implies an array of the
.TAG structure.
Keeping the space allocation separate allows you to place the .TAG declarations that assign
structure to a label in the header file in a similar fashion to the
.STRUCT and XREF direc-
tives. You can then include the header file in multiple source files wherever the label is
used. Make sure to perform the space allocation for the label in only one source file.
Examples of the
.TAG directive are as follows:
DATE .STRUCT
MONTH DS 1
DAY DS 1
YEAR DS 2
DSIZE .ENDSTRUCT DATE
NAMELEN EQU 30
EMPLOYEE .STRUCT
NAME DS NAMELEN
SOCIAL DS 10
START .TAG DATE
SALARY DS 1
ESIZE .ENDSTRUCT EMPLOYEE
NEWYEARS .TAG DATE
NEWYEARS DS DSIZE
The .TAG directive in the last example above creates the symbols NEWYEARS.MONTH,
NEWYEARS.DAY, and NEWYEARS.YEAR. The space for NEWYEARS is allocated by the DS
directive.
.UNION Directive
The .UNION directive is similar to the .STRUCT directive, except that the offset is reset to
zero on each label. A
.UNION directive cannot have an offset or parent union. The key-
word to terminate a
.UNION definition is .ENDSTRUCT.
Note:
Zobrazit stránku 269
1 2 ... 265 266 267 268 269 270 271 272 273 274 275 ... 519 520

Komentáře k této Příručce

Žádné komentáře