Echelon Neuron User Manual Page 58

  • Download
  • Add to my manuals
  • Print
  • Page
    / 237
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 57
Overview
Typically, you use Neuron assembly language to create utilities that can be used
with an application that is written in Neuron C. The Neuron C program code
might call functions defined in Neuron assembly, or a Neuron assembly function
might call a Neuron C function or program.
This chapter describes the conventions that a Neuron assembly language
function must follow when interfacing with Neuron C functions, including data,
calling and naming conventions.
See the following sections for information about integrating, assembling, and
linking your assembly program with the Neuron C application: Integrating the
Program, Assembling the Program, and Linking the Program.
Naming Conventions
Within a Neuron assembly file, declare functions, variables, or any other linkable
item that interfaces with the Neuron C application, with a percent-sign prefix.
This declaration allows the symbol to become part of the Neuron C name space.
To make the symbol and its meaning available to the Neuron C application, you
must provide its C language ‘extern’ specification (for variables and constants) or
its prototype (for functions).
Within a Neuron C file, when you specify an external symbol, the Neuron C
compiler automatically assumes a percent-sign prefix.
Example:
The following example includes an assembly-coded function in a Neuron C
program:
#pragma include_assembly_file “checksum.ns”
extern unsigned Checksum(unsigned, const char*);
The compiler-generated calls to this function from the Neuron C application use
the name %Checksum. Thus, the assembly function must use the %Checksum
label with the APEXP directive:
%Checksum APEXP
... ; function body
ret ; return to caller
The Neuron C Compiler (and its companion tools, such as the Neuron Assembler
or Linker) cannot verify that the prototype (or extern specification that you
provide) actually matches the implementation in the assembly source file. It is
the programmer’s responsibility to ensure that the specification in Neuron C
matches the implementation in Neuron Assembly.
Function Parameters
Typically, an assembly language function is called with parameters. The
compiler pushes function arguments on the stack from right-to-left, so that the
last argument is in the TOS element of the stack. For example, for a function
with two arguments, such as Checksum(unsigned, const char*), the const char*
pointer is pushed first, and the unsigned argument is pushed into TOS.
48 Interfacing with a Neuron C Application
Page view 57
1 2 ... 53 54 55 56 57 58 59 60 61 62 63 ... 236 237

Comments to this Manuals

No comments

TEXET TN-507 manuály

Uživatelské manuály a uživatelské příručky pro GPS přijímač TEXET TN-507.
Poskytujeme 1 manuály pdf TEXET TN-507 ke stažení zdarma podle typů dokumentů: Uživatelský manuál






Další produkty a příručky pro GPS přijímač TEXET

Modely Typ Dokumentu
TN-701BT Uživatelský manuál   Инструкция по эксплуатации Texet TN-701BT, 46 stránky
TN-600 VOICE Uživatelský manuál   Инструкция по эксплуатации Texet TN-600 VOICE, 46 stránky
TN-811BT Uživatelský manuál   Инструкция по эксплуатации Texet TN-811BT, 42 stránky
TN-505 Atlas 5 Uživatelský manuál   Инструкция по эксплуатации Texet TN-505 Atlas 5, 30 stránky
TN-511HD DVR Uživatelský manuál   Инструкция по эксплуатации Texet TN-511HD DVR, 38 stránky
TN-711 Atlas 5 Uživatelský manuál   Инструкция по эксплуатации Texet TN-711 Atlas 5, 16 stránky
TN-733 Uživatelský manuál   Инструкция по эксплуатации Texet TN-733, 30 stránky
TN-522HD DVR Uživatelský manuál   Инструкция по эксплуатации Texet TN-522HD DVR, 42 stránky
TN-507 Atlas 5 Uživatelský manuál   Инструкция по эксплуатации Texet TN-507 Atlas 5, 30 stránky
TN-606 Uživatelský manuál   Инструкция по эксплуатации Texet TN-606, 50 stránky
TN-515DVR Uživatelský manuál   Инструкция по эксплуатации Texet TN-515DVR, 38 stránky