Download ABEL-HDL Reference Manual
Transcript
@Setsize — Set Indexing
@Setsize — Set Indexing
Syntax
@SETSIZE [expression];
Purpose
The @Setsize directive generates a number corresponding to the number of
elements in the expression, which must be a set. This directive is useful for
set indexing operations.
Example
@SETSIZE [a,b,c]
generates the number 3.
For set indexing, you can use the @setsize directive in macros in the
following manner:
high macro (s) {?S[@SETSIZE(?S);-1..@SETSIZE(?S);/2-1]};
The high macro returns the upper half of a set of any size (the high 4 bits of an
8-bit set, for example).
✍
NOTE
The terminating semicolons are required.
See Also ___________________________________________________________
“Set Indexing” in Chapter 1, Language Structure”
ABEL-HDL Reference Manual
196