Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

AN3350 Datasheet(PDF) 68 Page - STMicroelectronics

Part # AN3350
Description  eTPU compiler tools
PDF  185 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN3350 Datasheet(HTML) 68 Page - STMicroelectronics

Back Button AN3350 Datasheet HTML 64Page - STMicroelectronics AN3350 Datasheet HTML 65Page - STMicroelectronics AN3350 Datasheet HTML 66Page - STMicroelectronics AN3350 Datasheet HTML 67Page - STMicroelectronics AN3350 Datasheet HTML 68Page - STMicroelectronics AN3350 Datasheet HTML 69Page - STMicroelectronics AN3350 Datasheet HTML 70Page - STMicroelectronics AN3350 Datasheet HTML 71Page - STMicroelectronics AN3350 Datasheet HTML 72Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 68 / 185 page
background image
Working with the assembler
AN3350
68/185
Doc ID 018512 Rev 2
Circular definitions are allowed, but invocation of the macro will stop after one level of
expansion. For example, the following example code expands the next(10) only once to
next(10) + 1
.
#define next(a) next(a) + 1
next(10)
Note:
All macro definitions have a signature (name and parity). Therefore, the assembler does not
generate error messages for calls to macros with the same name that have a different
number of arguments; instead, the assembler silently ignores them (no expansion occurs).
Macro names are not assembly symbols. During assembly, the assembler does not assign
macros numeric values. When preprocessing is complete, all macros have been expanded,
and their corresponding names cease to exist.
10.5.3
Multi-line macros
A multi-line macro includes all code lines between a #macro and the closest following
#endm
directive. To invoke a multi-line macro, the macro name must be the first, or left-most,
token in the line of code (the name can be prefixed by a label and white space). Multi-line
macro arguments are similar to those for single line macros, except that the former are
defined and used without parentheses. Multi-line macros cannot be defined within macros of
the same type.
For example, the code in Example 6 defines a macro that, given a register (R), creates the
value 3 * R + 2 and stores that value in register a. A possible invocation of this macro is
do_it p
.
Example 6 Multi-line macro example
#macro do_it R
move a,R
add a,a,R
add a,a,R
addi a,2
#endm
Note:
The assembler does not perform type or semantic checking on the arguments.
Consequently the macro can be invoked, for example, with the argument a + 4, which
would result in the expansion of invalid code. Passing R1 as an argument results in the
calculation, with unexpected results, of 4 * a + 2.
Local labels inside a macro
When labels are defined or used inside a macro it follows that all macro invocations will use
that name. This may be problematic (and, in fact, invalid) as labels are not singly defined. To
declare and use labels local to macros, the label name should be prepended with \@. For
example, the following code causes the assembler to interpret the label next in the epilog
macro differently each time it is invoked:
#macro epilog
jmp.n zero,next\@



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com