beautypg.com

Abs8 (absolute value, 8 bit), Add16 (add, 16 bit), Add16s (add signed, 16 bit) – Echelon Neuron User Manual

Page 171

background image

_abs8 (Absolute Value, 8 Bit)

This function returns the absolute value of a signed integer.

Stack Transformation: (a -- |a|)
Location: Near
Registers Affected: None

Example:
This example returns the absolute value of -8.

push #@lb(-d’8) ; (-d’8)

call _abs8 ; (d’8)

_add16 (Add, 16 Bit)

This function adds two 16-bit unsigned integers.

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

Example:
This example adds 50 to 300.

pushd #d’300 ; (d’44, 1)

pushd #d’50 ; (d’50, 0, d’44, 1)

call _add16 ; (d’94, 1)

_add16s (Add Signed, 16 Bit)

This function adds two 16-bit signed integers.

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

Example:
This example adds 50 to 300.

pushd #d’300 ; (d’44, 1)

pushd #d’50 ; (d’50, 0, d’44, 1)

call _add16s ; (d’94, 1)

Neuron Assembly Language Reference

161