Div16 (divide, 16 bit), Div16s (divide signed, 16 bit), Bit) – Echelon Neuron User Manual
Page 174

Stack Transformation: (value(2) -- value(2)-1)
Location: Near
Registers Affected: None
Example:
This example decrements 300.
pushd #d’300 ; (44, 1)
call _dec16 ; (43, 1)
_div16 (Divide, 16 Bit)
This function divides two 16-bit integers to produce a 16-bit integer result. The
result of dividing by zero is zero and a software error is logged.
Stack Transformation: (a(2), b(2)-- a(2)/b(2))
Location: Near
Registers Affected: R0, R1, R2, P0, P3
Example:
This example divides 8 by 2.
pushd #d’2 ; (d’2, 0)
pushd #d’8 ; (d’8, 0, d’2, 0)
call _div16 ; (d’4, 0)
_div16s (Divide Signed, 16 Bit)
This function divides two signed 16-bit integers to produce a signed 16-bit integer
result. The result of dividing by zero is zero and a software error is logged.
Stack Transformation: (a(2), b(2) -- a(2)/b(2))
Location: Near
Registers Affected: R0, R1, R2, P0, P3
Example:
This example divides 8 by 2.
pushd #d’2 ; (d’2, 0)
pushd #d’8 ; (d’8, 0, d’2, 0)
call _div16s ; (d’4, 0)
164
System-Provided Functions