beautypg.com

Memset1 (set memory at p0), Min16 (minimum value, 16 bit), Min16s (minimum signed value, 16 bit) – Echelon Neuron User Manual

Page 191

background image


Example:
This example initializes four bytes at h’eff0 to 33.

pushs #d’4 ; (d’4)

push #d’33 ; (d’33, d’4)

pushd #h’eff0 ; (h’f0, h’ef, d’33, d’4)

call _memset ; ()

_memset1 (Set Memory at P0)

This function performs the equivalent of a memset() function for a non-zero

amount of data at P0. len cannot be 0.

Stack Transformation: (val, len -- )
Location: Near
Registers Affected: P0 must be “dst”

Example:
This example initializes four bytes at P0 to 33.

pushs #d’4 ; (d’4)

push #d’33 ; (d’33, d’4)

call _memset1 ; ()

_min16 (Minimum Value, 16 Bit)

This function computes the minimum of two unsigned 16-bit integers.

Stack Transformation: (a(2), b(2) -- min(a(2),b(2)))
Location: Near
Registers Affected: None

Example:
This example gets the minimum of 8 and 2.

pushd #d’2 ; (d’2, 0)

pushd #d’8 ; (d’8, 0, d’2, 0)

call _min16 ; (d’2, 0)

_min16s (Minimum Signed Value, 16 Bit)

This function computes the minimum of two signed 16-bit integers.

Stack Transformation: (a(2), b(2) -- min(a(2),b(2)))

Neuron Assembly Language Reference

181