dolina.util

Utility functions to convert DM

Members

Functions

fromBCD
ushort fromBCD(ushort bcd)

Converts BCD value into decimal format

peekDM
T peekDM(ushort[] words)

Takes an array of DM ushort and converts the first T.sizeof / 2 DM to T. The array is **not** consumed.

peekDM
T peekDM(ushort[] words, size_t index)

Takes an array of DM (ushort) and converts the first T.sizeof / 2 DM to T starting from index *index*.

pop
T pop(ref R input)

Takes an input range of DM (ushort) and converts the first T.sizeof / 2 DM's to T. The array is consumed.

toBCD
ushort toBCD(ushort dec)

Converts ushort value into BDC format

toBytes
ubyte[] toBytes(T[] input)

Converts an array of type T into an ubyte array.

toDM
ushort[] toDM(ubyte[] bytes)

Converts an array of bytes into DM (ushort) array.

write
void write(ref R output, T n)

Writes numeric type *T* into a output range of *ushort*.

Manifest constants

BYTES_PER_DM
enum BYTES_PER_DM;

Bytes per each DM.

Meta