beautypg.com

Mod8 (modulo, 8 bit), Mod8s (modulo signed, 8 bit), Mul16 (multiply, 16 bit) – Echelon Neuron User Manual

Page 193

background image

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

Example:
This example negates 2.

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

call _minus16s ; (-d’2, -d’1)

_mod8 (Modulo, 8 Bit)

This function performs a modulo operation on two unsigned integers to produce

an integer result.

Stack Transformation: (a, b -- a%b)
Location: Near
Registers Affected: R0, R1, R2

Example:
This example performs 8 modulo 2.

pushs #d’2 ; (d’2)

push #d’8 ; (d’8, d’2)

call _mod8 ; (d’0)

_mod8s (Modulo Signed, 8 Bit)

This function performs a modulo operation on two signed integers to produce a

signed integer result.

Stack Transformation: (a, b -- a%b)
Location: Near
Registers Affected: R0, R1, R2

Example:
This example performs 8 modulo 2.

pushs #d’2 ; (d’2)

push #d’8 ; (d’8, d’2)

call _mod8s ; (d’0)

_mul16 (Multiply, 16 Bit)

This function multiplies two 16-bit integers to produce a 16-bit result.

Neuron Assembly Language Reference

183