Echelon Neuron User Manual
Neuron assembly language reference guide
Table of contents
Document Outline
- Welcome
- Audience
- Related Documentation
- Table of Contents
- Introduction
- Neuron Assembler Tools
- Assembler Files
- General Neuron Assembly Syntax
- Assembler Directives
- Interfacing with Neuron C Programs
- Neuron Architecture
- Hardware Resources for Assembly Programs
- Addressing Modes
- Overview of Stack-Oriented Programming
- Designing a Neuron Assembly Function
- Interrupt Tasks with Assembly Code
- Documenting Changes to the Stack
- Integrating the Program
- Assembling the Program
- Linking the Program
- Debugging the Program
- Overview
- Naming Conventions
- Function Parameters
- Calling Conventions
- Data Representation
- Calling a Neuron C Function from Assembly Code
- Overview of the Checksum Example
- Implementing the Checksum Function
- Including the Assembly Function in a Neuron C Application
- Overview of the Assembly Language Instructions
- ADC (Add with Carry)
- ADD (Add)
- ADD_R (Add and Return)
- ALLOC (Allocate)
- AND (And)
- AND_R (And and Return)
- BR (Branch)
- BRC (Branch If Carry)
- BRF (Branch Far)
- BRNC (Branch If Not Carry)
- BRNEQ (Branch If Not Equal)
- BRNZ (Branch If Not Zero)
- BRZ (Branch If Zero)
- CALL (Call Near)
- CALLF (Call Far)
- CALLR (Call Relative)
- DBRNZ (Decrement and Branch If Not Zero)
- DEALLOC (Deallocate and Return)
- DEC (Decrement)
- DIV (Divide)
- DROP (Drop from Stack)
- DROP_R (Drop from Stack and Return)
- INC (Increment)
- MUL (Multiply)
- NOP (No Operation)
- NOT (Not)
- OR (Or)
- OR_R (Or and Return)
- POP (Pop from Stack)
- POPD (Pop Pointer Direct)
- POPPUSH (Pop from Data Stack and Push onto Return Stack)
- PUSH (Push onto Stack)
- PUSHD (Push Pointer Direct)
- PUSHPOP (Pop from Return Stack and Push onto Data Stack)
- PUSHS (Push Short)
- RET (Return from Call)
- ROLC (Rotate Left through Carry)
- RORC (Rotate Right through Carry)
- SBC (Subtract with Carry)
- SBR (Short Branch)
- SBRNZ (Short Branch If Not Zero)
- SBRZ (Short Branch If Zero)
- SHL (Shift Left)
- SHLA (Shift Left Arithmetically)
- SHR (Shift Right)
- SHRA (Shift Right Arithmetically)
- SUB (Subtract)
- XCH (Exchange)
- XOR (Exclusive Or)
- XOR_R (Exclusive Or and Return)
- Overview of the Assembler Directives
- APEXP (Application Symbol Export)
- DATA.B (Reserve Initialized Memory)
- ELSE (Conditional Assembly)
- END (Assembly Control)
- ENDIF (Conditional Assembly)
- EQU (Equate Symbol)
- ERROR (Conditional Assembly)
- EXPORT (Export Symbol)
- IF (Conditional Assembly)
- IFDEF (Conditional Assembly)
- IFNDEF (Conditional Assembly)
- IMPORT (Import External Symbol)
- INCLUDE (Assembly Control)
- LIBRARY (Include Library)
- LIST (Listing Control)
- NOLIST (Listing Control)
- ORG (Segment Control)
- PAGE (Listing Control)
- RADIX (Default Radix)
- RES (Reserve Uninitialized Memory)
- RESOURCE (Resource Control)
- SEG (Segment Control)
- SUBHEAD (Listing Control)
- Overview of the Functions
- _abs16 (Absolute Value, 16 Bit)
- _abs8 (Absolute Value, 8 Bit)
- _add16 (Add, 16 Bit)
- _add16s (Add Signed, 16 Bit)
- _add_8_16f (Add Fast, 8 Bit to 16 Bit)
- _adds_8_16 (Add Signed, 8 Bit to 16 Bit)
- _alloc (Allocate Stack Space)
- _and16 (And, 16 Bit)
- _dealloc (Deallocate Stack Space and Return)
- _dec16 (Decrement, 16 Bit)
- _div16 (Divide, 16 Bit)
- _div16s (Divide Signed, 16 Bit)
- _div8 (Divide, 8 Bit)
- _div8s (Divide Signed, 8 Bit)
- _drop_n (Drop N Bytes from Stack)
- _drop_n_preserve_1 (Drop N Bytes from Stack and Preserve NEXT)
- _drop_n_preserve_2 (Drop N Bytes from Stack and Preserve NEXT and NEXT+1)
- _drop_n_return_1 (Drop N Bytes from Stack, Preserve NEXT, and Return)
- _drop_n_return_2 (Drop N Bytes from Stack, Preserve NEXT and NEXT+1, and Return)
- _equal16 (Equality Test, 16 Bit)
- _equal8 (Equality Test, 8 Bit)
- _gequ16s (Greater Than or Equal Signed, 16 Bit)
- _gequ8 (Greater Than or Equal, 8 Bit)
- _gequ8s (Greater Than or Equal Signed, 8 Bit)
- _get_sp (Get Stack Pointer)
- _inc16 (Increment, 16 Bit)
- io_iaccess (Acquire Semaphore)
- io_iaccess_wait (Acquire Semaphore and Wait)
- io_irelease (Release Semaphore)
- _l_shift16 (Left Shift, 16 Bit)
- _l_shift16s (Left Shift Signed, 16 Bit)
- _l_shift8 (Left Shift, 8 Bit)
- _l_shift8s (Left Shift Signed, 8 Bit)
- _l_shift8_
(Left Shift by , 8 Bit) - _ldP0_fetchl (Load P0 from Fetched Location)
- _less16 (Less Than, 16 Bit)
- _less16s (Less Than Signed, 16 Bit)
- _less8 (Less Than, 8 Bit)
- _less8s (Less Than Signed, 8 Bit)
- _log16 (Logical Value, 16 Bit)
- _log8 (Logical Value, 8 Bit)
- _lognot16 (Negated Logical Value, 16 Bit)
- _lognot8 (Negated Logical Value, 8 Bit)
- _lshift16_add16 (Left Shift and Add, 16 Bit)
- _lshift8_add16 (Left Shift and Add, Converts 8 Bits to 16 Bits)
- _lshift8by1_add16 (Left Shift By 1 and Add, Converts 8 Bits to 16 Bits)
- _lshift8by2_add16 (Left Shift By 2 and Add, Converts 8 Bits to 16 Bits)
- _max16 (Maximum Value, 16 Bit)
- _max16s (Maximum Signed Value, 16 Bit)
- _max8 (Maximum Value, 8 Bit)
- _max8s (Maximum Signed Value, 8 Bit)
- _memcpy (Copy Memory)
- _memcpy1 (Copy Memory from Offset)
- _memset (Set Memory)
- _memset1 (Set Memory at P0)
- _min16 (Minimum Value, 16 Bit)
- _min16s (Minimum Signed Value, 16 Bit)
- _min8 (minimum Value, 8 Bit)
- _min8s (Minimum Signed Value, 8 Bit)
- _minus16s (Negative Signed Value, 16 Bit)
- _mod8 (Modulo, 8 Bit)
- _mod8s (Modulo Signed, 8 Bit)
- _mul16 (Multiply, 16 Bit)
- _mul16s (Multiply Signed, 16 Bit)
- _mul8 (Multiply, 8 Bit)
- _mul8s (Multiply Signed, 8 Bit)
- _mul_8_16 (Multiply, 8 Bit to 16 Bit)
- _muls_8_16 (Multiply Signed, 8 Bit to 16 Bit)
- _mul8l (Multiply, 8 Bit with 16 Bit Result)
- _mul8ls (Multiply Signed, 8 Bit with 16 Bit Result)
- _not16 (Not, 16 Bit)
- _or16 (Or, 16 Bit)
- _pop (Pop from TOS and Push to Offset)
- _pop1 (Pop from TOS and Push Short to Offset)
- _popd (Pop from TOS and NEXT, Push to Offset, 16 Bit)
- _popd1 (Pop from TOS and NEXT, Push Short to Offset, 16 Bit)
- _push (Push from Offset to TOS)
- _push1 (Push Short from Offset to TOS)
- _push4 (Copy Top 4 Bytes of Stack, Push toStack)
- _pushd (Push from Offset to TOS and NEXT, 16 Bit)
- _pushd1 (Push Short from Offset to TOS and NEXT, 16 Bit)
- _r_shift16 (Right Shift, 16 Bit)
- _r_shift16s (Right Shift Signed, 16 Bit)
- _r_shift8 (Right Shift, 8 Bit)
- _r_shift8_
(Right Shift , 8 Bit) - _r_shift8s (Right Shift Signed, 8 Bit)
- _register_call (Call Function from Register)
- _sign_extend16 (Convert 8 Bit to 16 Bit, Preserve Sign)
- _sub16 (Subtract, 16 Bit)
- _sub16s (Subtract Signed, 16 Bit)
- _xor16 (Exclusive OR, 16 Bit)
- Instructions by Mnemonic
- Instructions by Opcode
- Keywords