November 2009 Doc ID 11392 Rev 4 1/89 UM0144User ManualST Assembler-LinkerIntroductionThis manual describes using the ST Assembler-Linker to develop a
Introduction ST Assembler-Linker10/89 Doc ID 11392 Rev 4For assistance on all ST microcontroller subjects, or for help developing applications that us
ST Assembler-Linker Getting startedDoc ID 11392 Rev 4 11/892 Getting startedInstalling the ST Assembler-LinkerThe ST Assembler-Linker is delivered as
ST7 and STM8 addressing modes ST Assembler-Linker12/89 Doc ID 11392 Rev 43 ST7 and STM8 addressing modes3.1 Overview of ST7 and STM8 addressing mode
ST Assembler-Linker ST7 and STM8 addressing modesDoc ID 11392 Rev 4 13/89www.st.com. This chapter only gives a brief explanation of the main addressin
ST7 and STM8 addressing modes ST Assembler-Linker14/89 Doc ID 11392 Rev 4addressing mode, while STM8 instructionaccepts both modespush memory ; STM8 a
ST Assembler-Linker ST7 and STM8 addressing modesDoc ID 11392 Rev 4 15/89An indirect addressing mode means that the data byte(s) required to do the op
ST7 and STM8 addressing modes ST Assembler-Linker16/89 Doc ID 11392 Rev 43.7 Indexed modesThe ST7 supports the following types of indexed mode:● index
ST Assembler-Linker ST7 and STM8 addressing modesDoc ID 11392 Rev 4 17/89nopld A,#lab12.h; load A with $00ld A,#lab12.l; load A with $12In the STM8, s
ST assembler ST Assembler-Linker18/89 Doc ID 11392 Rev 44 ST assembler4.1 OverviewThe ST assembler program is a cross-assembler, meaning that it produ
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 19/89For example:Figure 2. Assembler source code format exampleThe next sections describe the main
Contents ST Assembler-Linker2/89 Doc ID 11392 Rev 4Contents1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ST assembler ST Assembler-Linker20/89 Doc ID 11392 Rev 4The suffix is not used when the label is referred to. Using of any suffixes other than .b, .w
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 21/894.3.4 Label scopeOften, in multi-module programs, a piece of code needs to refer to a label th
ST assembler ST Assembler-Linker22/89 Doc ID 11392 Rev 44.3.5 OpcodesThe Opcode field may serve three different purposes. It may contain:● The opcode
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 23/89 String constantsString constants are strings of ASCII characters surrounded by double
ST assembler ST Assembler-Linker24/89 Doc ID 11392 Rev 4 Table 6. Level 1 operatorsOperation Result, level #1-a negated aa a
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 25/89 Operator names longer than one character must be followed by a space character. For e
ST assembler ST Assembler-Linker26/89 Doc ID 11392 Rev 44.4 Segmentation4.4.1 Segments explainedSegments are very important. You have to understand se
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 27/894.4.2 ParametersPossible arguments are:● Name● Align● Combine● cod parameter, output file cont
ST assembler ST Assembler-Linker28/89 Doc ID 11392 Rev 4CombineThe <combine> argument tells the assembler and linker how to treat the segment. T
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 29/89cod parameter, output file controlThe last field of a SEGMENT directive controls where the lin
ST Assembler-Linker ContentsDoc ID 11392 Rev 4 3/894.4 Segmentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ST assembler ST Assembler-Linker30/89 Doc ID 11392 Rev 44.5 MacrosMacros are assembly-time subroutines.When you call an execution-time subroutine you
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 31/89There is one further problem: because a macro may be called several times in the same module,
ST assembler ST Assembler-Linker32/89 Doc ID 11392 Rev 44.6 Conditional assembly #IF, #ELSE and #ENDIF directivesConditional assembly is used to choo
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 33/894.7 Running the assembler4.7.1 Command lineThe assembler needs the following arguments:ASM &l
ST assembler ST Assembler-Linker34/89 Doc ID 11392 Rev 4SYM optionLI optionOBJ option-D <1> <2> #define <1> <2> (see page 36)-
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 35/89FI optionNote: Instead of using ASM -fi, it is advised to use the list file post processor ABS
ST assembler ST Assembler-Linker36/89 Doc ID 11392 Rev 4D optionNote: If you specify multiple -D switches, they should always be separated by a space.
ST Assembler-Linker ST assemblerDoc ID 11392 Rev 4 37/89M optionPA optionNP optionDescription: Tells the ST assembler to output a rule suitable for m
Linker ST Assembler-Linker38/89 Doc ID 11392 Rev 45 Linker5.1 What the linker doesAfter having separately assembled all the component modules in your
ST Assembler-Linker LinkerDoc ID 11392 Rev 4 39/89Some examples:Linking together the modules game.obj, scores.obj, key.obj, game1.obj, game2.obj and g
Contents ST Assembler-Linker4/89 Doc ID 11392 Rev 46.2.8 GP binary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Linker ST Assembler-Linker40/89 Doc ID 11392 Rev 45.4 Linking in detail5.4.1 PUBLICs and EXTERNsAll labels declared external in the modules being li
ST Assembler-Linker LinkerDoc ID 11392 Rev 4 41/89For example:grafix segment byte at: 100-027F 'RAM1'cursor_buf ds.b 64 ; buffer for map und
Linker ST Assembler-Linker42/89 Doc ID 11392 Rev 45.5 The linker in more detail5.5.1 The composition of the .OBJ filesThe .OBJ files produced by the
ST Assembler-Linker LinkerDoc ID 11392 Rev 4 43/89Class list:The external label list only includes labels that were declared PUBLIC: labels used inter
OBSEND ST Assembler-Linker44/89 Doc ID 11392 Rev 46 OBSEND6.1 What OBSEND does for youAfter your program has been assembled and linked to form a .COD
ST Assembler-Linker OBSENDDoc ID 11392 Rev 4 45/896.2.4 Straight binary format<format>= <none>This is the simplest of the formats. It is
OBSEND ST Assembler-Linker46/89 Doc ID 11392 Rev 4The next two characters are the record type for this line: 00 is a data line, and 01 signals EOF. Th
ST Assembler-Linker OBSENDDoc ID 11392 Rev 4 47/89S113001AFF120094FF130094D08AFF390094FF1250S20801C004FFC0000073<format>= xThe extended S-record
ABSLIST ST Assembler-Linker48/89 Doc ID 11392 Rev 47 ABSLIST7.1 OverviewAs the list file with absolute addresses generated by the assembler from the s
ST Assembler-Linker ABSLISTDoc ID 11392 Rev 4 49/897.2 Invoking the list file post processorHere is the full command syntax of the list file post pro
ST Assembler-Linker List of tablesDoc ID 11392 Rev 4 5/89List of tablesTable 1. Description of installed files . . . . . . . . . . . . . . . . . . .
ABSLIST ST Assembler-Linker50/89 Doc ID 11392 Rev 47.3 Limitations1. There is one main limitation. The update of the relative address is based on the
ST Assembler-Linker LibrarianDoc ID 11392 Rev 4 51/898 Librarian8.1 OverviewIf you do a lot of work on similar boards especially those with the same p
Librarian ST Assembler-Linker52/89 Doc ID 11392 Rev 4 8.3 Adding modules to a libraryTyping for example: +user1\board would look for a file,
ST Assembler-Linker LibrarianDoc ID 11392 Rev 4 53/898.5 Copying modules from a libraryTo make a copy of a .OBJ module located in a library back to y
Definitions ST Assembler-Linker54/89 Doc ID 11392 Rev 49 Definitions Table 18. Acronyms and terms used in this documentName DefinitionApplicat
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 55/89Appendix A Assembler directivesA.1 IntroductionEach directive is described in a table
Assembler directives ST Assembler-Linker56/89 Doc ID 11392 Rev 4A.2 Directives Table 20. .BELLPurpose Ring bell on console.F
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 57/89 Table 23. CEQUPurpose Equate pre-existing label to
Assembler directives ST Assembler-Linker58/89 Doc ID 11392 Rev 4 ExampleDC.B 1,2,3 ; generates 01,02,03DC.B “HELLO” ; genera
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 59/89 DescriptionThe benefits of using labels in assembler level programmi
List of tables ST Assembler-Linker6/89 Doc ID 11392 Rev 4Table 49. #INCLUDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assembler directives ST Assembler-Linker60/89 Doc ID 11392 Rev 4 DescriptionThis directive is used to 'space out' label definitions.
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 61/89 Table 33. ENDPurpose End of source code.Format ENDDescripti
Assembler directives ST Assembler-Linker62/89 Doc ID 11392 Rev 4 Table 36. #ELSEPurpose Conditional ELSE.F
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 63/89 Table 39. FCSPurpose Form constant string.Format F
Assembler directives ST Assembler-Linker64/89 Doc ID 11392 Rev 4 DescriptionSometimes it is necessary to have different versions of a
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 65/89 Table 45. #IFBPurpose Conditional on argument being blank.F
Assembler directives ST Assembler-Linker66/89 Doc ID 11392 Rev 4 Table 48. #IFLABPurpose Conditional on argument being a la
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 67/89 ExampleINTELld X,0FFFFhSee also MOTOROLA, TEXAS, Z
Assembler directives ST Assembler-Linker68/89 Doc ID 11392 Rev 4 Examplesegment byte at 8000-C000 'EPROM1'#LOAD “table.bin”
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 69/89 Table 57. LONGSPurpose Default new label length long.Format
ST Assembler-Linker List of figuresDoc ID 11392 Rev 4 7/89List of figuresFigure 1. Schematic overview of the assembler toolset. . . . . . . . . . . .
Assembler directives ST Assembler-Linker70/89 Doc ID 11392 Rev 4 Examplecmp16 MACRO first,second,resultLOCAL trylowld A,firs
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 71/89 DescriptionStrings named in the first argument of
Assembler directives ST Assembler-Linker72/89 Doc ID 11392 Rev 4 DescriptionThis directive marks out given labels defined du
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 73/89 Examplebyte no alignment; can start on any byte boundariesword align
Assembler directives ST Assembler-Linker74/89 Doc ID 11392 Rev 4 Table 72. STRINGPurpose Define a byte-level string
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 75/89 DescriptionThe Motorola style:>AB Hexadecimal~17 Octal?1
Assembler directives ST Assembler-Linker76/89 Doc ID 11392 Rev 4 DescriptionThis directive forces the word(s) in its argumen
ST Assembler-Linker Assembler directivesDoc ID 11392 Rev 4 77/89DescriptionThe Motorola style:%AB Hexadecimal%(8)17 Octal%(2)100 Binary17 Decimal (def
Error messages ST Assembler-Linker78/89 Doc ID 11392 Rev 4Appendix B Error messagesB.1 Format of error messagesThere are two classes of error trappe
ST Assembler-Linker Error messagesDoc ID 11392 Rev 4 79/89B.3 Assembler errorsTable 82. Assembler errorsError Definition1 Empty file: The assembler co
Introduction ST Assembler-Linker8/89 Doc ID 11392 Rev 41 Introduction1.1 ST7 and STM8 incompatibilitiesThe new ST7/STM8 assembler development toolcha
Error messages ST Assembler-Linker80/89 Doc ID 11392 Rev 426Illegal external suffix: Only the suffixes .b, .B, .w, .W, .l, .L are legal after an exter
ST Assembler-Linker Error messagesDoc ID 11392 Rev 4 81/8951Phase inconsistency (P1=X,P2=Y) 'label': Reports that the named label was alloca
Error messages ST Assembler-Linker82/89 Doc ID 11392 Rev 467 Improper characters: Unusual characters have been spotted in the source file, of value &g
ST Assembler-Linker Error messagesDoc ID 11392 Rev 4 83/89B.4 Linking errors 101 Label defined as NEAR and INTERRUPT102 Label defined as FAR a
Revision history ST Assembler-Linker84/89 Doc ID 11392 Rev 4Revision history Table 84. Document revision historyDate Revision Changes01-Jul-20
Index ST Assembler-Linker85/89 Doc ID 11392 Rev 4IndexSymbols.asm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18.cod . . . . .
ST Assembler-Linker IndexDoc ID 11392 Rev 4 86/89%OUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71.CTRL . . . . . . . . . . . . . .
Index ST Assembler-Linker87/89 Doc ID 11392 Rev 4no closing single quote . . . . . . . . . . . . . . . . .81no info on start address of class ’class’
ST Assembler-Linker IndexDoc ID 11392 Rev 4 88/89f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45g . . . . . . . . . . . . .
ST Assembler-LinkerDoc ID 11392 Rev 4 89/89 Please Read Carefully:Information in this document is provided solely in connection with ST produ
ST Assembler-Linker IntroductionDoc ID 11392 Rev 4 9/89Generally, the instruction sets are similar, with the following notable differences:● The STM8
Commentaires sur ces manuels