Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

UM0144 Datasheet(PDF) 27 Page - STMicroelectronics

Part # UM0144
Description  ST7 Assembler Linker
PDF  92 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

UM0144 Datasheet(HTML) 27 Page - STMicroelectronics

Back Button UM0144 Datasheet HTML 23Page - STMicroelectronics UM0144 Datasheet HTML 24Page - STMicroelectronics UM0144 Datasheet HTML 25Page - STMicroelectronics UM0144 Datasheet HTML 26Page - STMicroelectronics UM0144 Datasheet HTML 27Page - STMicroelectronics UM0144 Datasheet HTML 28Page - STMicroelectronics UM0144 Datasheet HTML 29Page - STMicroelectronics UM0144 Datasheet HTML 30Page - STMicroelectronics UM0144 Datasheet HTML 31Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 27 / 92 page
background image
ST7 Assembler Linker
3 ST7 Assembler
UM0144
27/92
The true use of macros is in small snippets of code that you use repeatedly— perhaps with
different arguments—which can be formalized into a 'template' for the macros' definition.
3.5.1
Defining macros
Macros are defined using three directives: MACRO, MEND and LOCAL.
The format is:
<macro-name>MACRO
[parameter-1][, parameter-2 ...]
[LOCAL] <label-name>[, label-name ...]]
<body-of-macro>
MEND
For example:
The piece of code of the example might be called by:
add16 index,offset,index
which would add the following statements to the source code at that point:
ld A,index
adc A,offset
ld index.X,A
Note that the formal parameters given in the definition have been replaced by the actual
parameters given on the calling line. These new parameters may be expressions or strings
as well as label names or constants. Because they may be complex expressions, they are
bracketed when there is any extra numeric activity; this is to make sure they come out with the
precedence correctly parsed.
Macros do not need to have any parameters. You may leave the MACRO argument field blank
(and, in this case, give no parameters on the calling line).
There is one further problem: because a macro may be called several times in the same
module, any labels defined in the macro will be duplicated. The LOCAL directive gets around
this problem:
add16
MACRO first,second,result
ld A,first
adc A,second
ld result,A
MEND



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


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