Next: , Previous: , Up: Array instructions   [Contents][Index]


17.1.19.2 Instruction ains

Synopsys:

ains

Insert a new element VAL, with bit-offset BOFF, at the end of the array ARR, making it grow.

If IDX is less than the current size of the array, the value is stored in the referred argument.

If IDX is equal or bigger than the current size of the array, the same element is replicated in the previous elements.

Examples:

a = [a1, a2, a3]

[a1, a2, a3] BOFF 2 VAL ains -> INVAL exception [a1, a2, a3] BOFF 3 VAL ains -> [a1, a2, a3, VAL] [a1, a2, a3] BOFF 5 VAL ains -> [a1, a2, a3, VAL, VAL, VAL]

Stack: ( ARR IDX VAL -- ARR )

Exceptions: PVM_E_INVAL