beautypg.com

Div8 (divide, 8 bit), Div8s (divide signed, 8 bit), Drop_n (drop n bytes from stack) – Echelon Neuron User Manual

Page 175: D _div8s (divide signed, 8 bit)

background image

_div8 (Divide, 8 Bit)

This function divides two integers to produce an integer result. The result of

dividing by zero is zero and a software error is logged.

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

Example:
This example divides 9 by 2.

pushs #d’2 ; (d’2)

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

call _div8 ; (d’4)

_div8s (Divide Signed, 8 Bit)

This function divides two signed integers to produce a signed integer result. The

result of dividing by zero is zero and a software error is logged.

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

Example:
This example divides 8 by 2.

pushs #d’2 ; (d’2)

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

call _div8s ; (d’4)

_drop_n (Drop N Bytes from Stack)

This function drops N bytes from the stack and returns to the calling function.

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

Example:
This example drops 3 bytes from the stack.

pushs #d’3 ; (d’3, a, b, c)

Neuron Assembly Language Reference

165