_BCDPTR - create a BCD pointer.

Usage:

B:
   newptr = _bcdptr(oldptr, offset);
C:
   void *_bcdptr(void *oldptr,int offset);

Where:

oldptr
is a BCD pointer created by a previous call to _BCDPTR, or else a regular B array pointer.
offset
is a positive or negative offset in 6 bit characters from 'oldptr'.
newptr
is another BCD pointer. This points to the BCD character that is the given offset (number of BCD characters) from the BCD character indicated by "oldptr".

Description:

_BCDPTR creates BCD pointer. This is a special type of pointer guaranteed to point to a BCD character. For example,

new = _bcdptr(old,-1)

returns a pointer to the BCD character immediately preceding the one indicated by "old". "old" can be a pointer to a word boundary, or to another BCD character.

BCD pointers can only be used in a limited set of operations: comparisons for equality/inequality and assignments. The BCD string indicated by a BCD pointer can be printed with the "%_s" placeholder of "printf" and related routines.

See Also:

expl b lib bcdasc

expl b lib ascbcd

expl b lib printf

Copyright © 1996, Thinkage Ltd.