beautypg.com

Echelon Neuron User Manual

Page 6

background image

Implicit ................................................................................................... 31

Pointer Direct......................................................................................... 31

Indirect Relative .................................................................................... 31

Indirect Indexed ..................................................................................... 32

DSP Relative .......................................................................................... 32

BP Relative ............................................................................................ 33

BP Indexed ............................................................................................. 33

Indirect ................................................................................................... 33

Relative .................................................................................................. 33

Writing a Neuron Assembly Utility Function .......................................... 35

Overview of Stack-Oriented Programming ................................................ 36

Designing a Neuron Assembly Function .................................................... 37

Interrupt Tasks with Assembly Code ......................................................... 39

Documenting Changes to the Stack ............................................................ 40

Stack-Effect Comments ......................................................................... 41

Multi-Byte Values ........................................................................... 41

Pointer Values ................................................................................. 41

Conditional Values .......................................................................... 41

Showing the Return Stack .............................................................. 42

Stack-Transformation Comments ........................................................ 42

Integrating the Program .............................................................................. 42

Assembling the Program ............................................................................. 43

Linking the Program .................................................................................... 44

Debugging the Program ............................................................................... 44

Interfacing with a Neuron C Application ................................................. 47

Overview ....................................................................................................... 48

Naming Conventions.................................................................................... 48

Function Parameters ................................................................................... 48

Calling Conventions ..................................................................................... 49

Data Representation .................................................................................... 51

Integers, Characters, and Strings ........................................................ 51

Multi-Byte Values .................................................................................. 51

Arrays ..................................................................................................... 52

Structures and Unions .......................................................................... 52

Bitfields .................................................................................................. 52

Calling a Neuron C Function from Assembly Code ................................... 52

Exploring an Example Function in Neuron Assembly .......................... 55

Overview of the Checksum Example .......................................................... 56

Implementing the Checksum Function ...................................................... 56

Including the Assembly Function in a Neuron C Application .................. 57

Neuron Assembly Language Instruction Statements ............................ 59

Overview of the Assembly Language Instructions .................................... 60

ADC (Add with Carry) ................................................................................. 64

ADD (Add) .................................................................................................... 65

ADD_R (Add and Return) ............................................................................ 66

ALLOC (Allocate) ......................................................................................... 67

AND (And) .................................................................................................... 68

AND_R (And and Return)............................................................................ 69

BR (Branch) .................................................................................................. 70

BRC (Branch If Carry) ................................................................................. 71

BRF (Branch Far) ........................................................................................ 72

vi