STMicroelectronics. STxP70-4 assembler. User manual Rev A. October

Similar documents
AN2667 Application note

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

STEVAL-SPBT4ATV3. USB dongle for the Bluetooth class 1 SPBT2632C1A.AT2 module. Features. Description

STEVAL-PCC010V1. ST802RT1A Ethernet PHY demonstration board with STM32F107 controller add-on board. Features. Description

AN2676 Application note

AN4113 Application note

AN626 Application note

AN2143 Application note

AN2672 Application note

AN3996 Application Note

STM3210B-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

OSPlus USB Extension. OSPlus USB 2.0 extension. Description. Features. Application. TCP/IP stack NexGenOS NexGenIP VFS. FAT Ext2 LVM Device layer

UM1572 User manual. STEVAL-IPE020V1: ST energy meter application based on the Android platform. Introduction

AN3354 Application note

AN3965 Application note

AN2470 Application note TS4871 low voltage audio power amplifier Evaluation board user guidelines Features Description

STM32-SK/KEIL STR91X-SK/KEI, STR7-SK/KEIL

AN2855 Application note

EV-VNQ5E050AK VNQ5E050AK evaluation board

AN3279 Application Note

STM32-SK/RAIS,STR91X-SK/RAI,STR7-SK/RAIS STM32-D/RAIS,STR9-D/RAIS,STR7-D/RAIS

STM3220G-SK/KEI. Keil starter kit for STM32F2 series microcontrollers (STM32F207IG MCU) Features. Description

STTS V memory module temperature sensor. Features

AN2825 Application Note

STEVAL-IHM028V1. 2 kw 3-phase motor control demonstration board featuring the IGBT intelligent power module STGIPS20K60. Features.

UM0401 User manual. User manual for eight bit port expander STMPE801 demonstration board. Introduction

AN2240 Application note

SOT23-6L ESDALCL6-2SC6

AN2557 Application note

STM8 I 2 C optimized examples

EVAL6235PD. L6235 three-phase brushless DC motor driver demonstration board. Features. Description

UM0693 User manual. 1 Introduction. STM8L101-EVAL demonstration firmware

AN2261 APPLICATION NOTE

AN2474 Application note

STICE CF/Stice_Connect AD/Stice_Connect AS/Stice_Connect

AN2734 Application note S-Touch design procedure Introduction

AN2361 Application note

Obsolete Product(s) - Obsolete Product(s)

UM1488 User manual. STPMC1 evaluation software. Introduction

UM0792 User manual. Demonstration firmware for the DMX-512 communication protocol transmitter based on the STM32F103Zx.

EMIF01-SMIC01F2 IPAD. Single line EMI filter including ESD protection. Main application. Description. Benefits. Pin configuration (Bump side view)

UM1084 User manual. CR95HF development software user guide. Introduction. Reference documents

AN2737 Application note Basic in-application programming example using the STM8 I 2 C and SPI peripherals Introduction

AN3154 Application note

STLC2500D. Bluetooth V2.1 "Lisbon" + EDR. Features. Description

Main components USB charging controller with integrated power switch

AN2673 Application note

AN3980 Application note

ST19WR08 Dual Contactless Smartcard MCU With RF UART, IART & 8 Kbytes EEPROM Features Contactless specific features

AN3250 Application note

STM32 embedded target for MATLAB and Simulink release 3.1. Summary for STM32 embedded target for MATLAB and Simulink release 3.1:

STA bit single chip baseband controller for GPS and telematic applications. Features

Description SPC564A-DISP. March 2014 DocID Rev 3 1/5

Getting started with DfuSe USB device firmware upgrade STMicroelectronics extension


ST19NP18-TPM-I2C Trusted Platform Module (TPM) with I²C Interface Features

AN4464 Application note

AN2408 Application note

SMP75. Trisil for telecom equipment protection. Features. Description. Applications. Benefits

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS

ST33F1M. Smartcard MCU with 32-bit ARM SecurCore SC300 CPU and 1.25 Mbytes high-density Flash memory. Features. Hardware features.

EMIF02-SPK02F2. 2-line IPAD, EMI filter and ESD protection. Features. Application. Description. Complies with the following standards

AN2594 Application note

EMIF02-MIC01F2 2-line IPAD, EMI filter including ESD protection Features Application Description Complies with the standards:

RN0046 Release note. 1 Introduction. SimpleMAC library for STM32W108xx kits. About this release note

Main components 1 A, high efficiency adjustable single inductor dual mode buckboost DC-DC converter

AN2592 Application note

STM8L-PRIMER STM32-PRIMER STMPRIMER

AN2430 Application note

How to interpret the LPS331AP pressure and temperature readings. Main components mbar absolute barometer with digital output

AN4321 Application note

TN0132 Technical note

LD A very low drop adjustable positive voltage regulator. Description. Features

ST21NFCB. Near field communication controller. Features. RF communications. Hardware features. Communication interfaces. Electrical characteristics

AN2202 Application note

AN3001 Application note

L6460. SPI configurable stepper and DC multi motor driver. Features. Description

AN3362 Application note

TN0189 Technical note

STM8L-PRIMER STM32-PRIMER STMPRIMER

AN2781 Application note

AN3988 Application note

AN3140 Application note

AN3265 Application note

AN3099 Application note

Description. October Rev 4 1/10

AN4274 Application note

AN2768 Application note LIS331DL 3-axis digital MEMS accelerometer: translates finger taps into actions Introduction

AN3348 Application note

AN3991 Application note

EMIF03-SIM06F3. 3-line IPAD, EMI filter including ESD protection. Description. Features. Application. Complies with the following standards:

AN4440 Application note

ST10F271B/E, ST10F272B/E Errata sheet

ECMF02-3F3. Common mode filter with ESD protection. Features. Description. Applications. Complies with the following standard:

ST33F1M, ST33F1M0, ST33F896, ST33F768, ST33F640, ST33F512

STM8-SK/RAIS STM8-D/RAIS ST7-SK/RAIS ST7-D/RAIS

SMP30. Trisil for telecom equipment protection. Features. Applications. Description. Benefits

AN2061 APPLICATION NOTE

AN2860 Application note

Transcription:

STMicroelectronics STxP70-4 assembler User manual 8229631 Rev A October 2009 www.st.com

BLANK

User manual STxP70-4 assembler Introduction The STxP70-4 version of the assembler is based upon the GNU assembler gas. Most of the features of gas are also included in the STxP70-4 assembler. A number of modifications have been made, however, to support specific features of the STxP70 core. These modifications are described in this chapter. For more background information concerning gas, see the document Using as, published by the Free Software Foundation. For details about the STxP70-4 instruction set, see the STxP70-4 core and instruction set architecture reference manual (8154580) October 2009 8229631 Rev A 1/14 www.st.com

Contents STxP70-4 assembler Contents Introduction......................................................... 1 Preface............................................................. 3 Document identification and control.................................... 3 Documentation suite................................................ 3 Conventions used in this guide........................................ 4 1 Invoking the assembler from the command line.................. 5 2 Command line options....................................... 6 3 Assembler syntax for STxP70-4 core........................... 8 3.1 Register names............................................. 8 3.2 Bundle syntax............................................... 9 4 STxP70-4 encoding length conventions........................ 10 4.1 Using shortest instructions.................................... 10 5 STxP70-4 encoding length directives.......................... 11 6 Code relaxation............................................ 12 7 Revision history........................................... 13 2/14 8229631 Rev A

STxP70-4 assembler Preface Preface This document is part of the documentation suite detailed below. Comments on this or other manuals in the documentation suite should be made by contacting your local STMicroelectronics sales office or distributor. Document identification and control Each book in the documentation suite carries a unique ADCS identifier of the form: ADCS nnnnnnnx where, nnnnnnn is the document number, and x is the revision. Whenever making comments on a document, the complete identification ADCS nnnnnnnx should be quoted. Documentation suite STxP70 compiler user manual (ADCS 8027948) This manual describes the C compiler for STMicroelectronics STxP70 cores. STxP70 assembler user manual (ADCS 7828987) This manual describes the assembler for STMicroelectronics STxP70-3 cores. STxP70-4 assembler user manual (ADCS 8229631) This manual describes the assembler for STMicroelectronics STxP70-4 cores. STxP70 professional toolset user manual (ADCS 7833754) This document explains the toolset architecture and provides information about how to develop and debug applications running on STxP70 systems. STxP70 utilities reference manual (ADCS 8210925) This document provides, in a single volume, command line reference for each of the generic and STxP70-3 and STxP70-4 utilities provided with the STxP70 Toolset that are not documented elsewhere. For each utility, the manual provides the command line synopsis, a brief description of the utility, the complete list of options that are available, and its return value. Building STxP70 libraries application note (ADCS 8226669) This document explains how to produce a set of standard libraries for the STxP70 compilation tools optimized for the user s specific purposes. 8229631 Rev A 3/14

Preface STxP70-4 assembler Conventions used in this guide General notation The notation in this document uses the following conventions: sample code, keyboard input and file names, variables, code variables and code comments, equations and math, screens, windows, dialog boxes and tool names, instructions. Software notation Syntax definitions are presented in a modified Backus-Naur Form (BNF). Terminal strings of the language, that is those not built up by rules of the language, are printed in teletype font. For example, void. Nonterminal strings of the language, that is those built up by rules of the language, are printed in italic teletype font. For example, name. If a nonterminal string of the language starts with a nonitalicized part, it is equivalent to the same nonterminal string without that nonitalicized part. For example, vspace-name. Each phrase definition is built up using a double colon and an equals sign to separate the two sides ( ::= ). Alternatives are separated by vertical bars ( ). Optional sequences are enclosed in square brackets ( [ and ] ). Items which may be repeated appear in braces ( { and } ). 4/14 8229631 Rev A

STxP70-4 assembler Invoking the assembler from the command line 1 Invoking the assembler from the command line There are three ways to invoke the assembler for the STxP70-4 architecture from the command line. Use the stxp70cc compiler driver with the -c option. Every file with a.s suffix is processed by the assembler. stxp70cc -mcore=stxp70v4 -c <files> Use the stxp70-as command as follows: stxp70-as -mcore=stxp70v4 [<options>] <file> where <file> refers to the assembly file to be processed by stxp70-as. <options> are any of the standard GNU assembler options or any of the options described in Chapter 2: Command line options. Use the STxP70-v4 assembler (stxp70v4-as) directly: stxp70v4-as [<options>] <file> where <file> refers to the assembly file to be processed. <options> are any of the standard GNU assembler options or any of the options described in Chapter 2: Command line options. 8229631 Rev A 5/14

Command line options STxP70-4 assembler 2 Command line options The STxP70-4 assembler supports the following options in addition to standard GNU assembler ones: -donot-emit-all-relocs Deactivate the emission of all relocations. The emission of all relocations is required by the Binary Optimizer to work correctly. This option shall not be used at higher optimization levels than O1. By default, all relocations are emitted. -double=[32 64] Specify how double precision floating point values are handled. This is either IEEE-754 singled precision (-double=32) or IEEE-754 double precision (-double=64). This information is written to the object file as part of the ELF flag; this enables the linker to check conformity of floating point management over the whole application. -Mextension=ext_name[,...] List the extension to be used at assembly time. When this switch is specified, the assembler looks for the extension shared object containing the parser and encoder of the specified extension. -Mextension-info -Mextrcdir=<dir> -corecfg=<val> -corecfg1=<val> Display a list of the extensions activated at assembly time with their versioning and identifying special key. Specify the directory where the assembler must look for extension definitions. Specify the CORE_CFG value to be used and written in object file. CORE_CFG defines the STxP70 core configuration. This configuration contains information about the features implemented in the silicon. It therefore prevents the assembler from using certain instructions that are not valid for a specific configuration. Specify the CORE_CFG1 value to be used and writen in object file. CORE_CFG1 defines the STxP70 core configuration. This configuration contains information about the features implemented in the silicon. It therefore prevents the assembler from using certain instructions that are not valid for a specific configuration. 6/14 8229631 Rev A

STxP70-4 assembler Command line options -noconfiginobj -bundle Instruct the assembler not to emit the CORE_CFG and CORE_CFG1 values in the object file. This makes the object file compatible with any other STxP70 object file. This option should be used carefully as it deactivates certain link-time consistency checks of object files. In particular, this option must be used only when building library object files with minimal STxP70 core configuration. Activate bundling mode of STxP70-4 architecture. Using this option makes it mandatory for the assembly file to use the ;; separator between bundles. -norelaxation Deactivate the relaxation mode at assembler level. By default, the assembler always selects the shortest encoding length for instructions. If this feature is deactivated, the assembler using the longest available encoding length for each instruction, usually 48 bits. -force-encoding=[16 32 48] Enable the specified encoding at assembler level. When this option is set the assembler uses the specified encoding variant (16-, 32- or 48-bit) of each instruction. If the specified encoding variant does not exist, the assembler generates a syntax error. -v4-strict Enable strict assembly syntax. When this is used even in non-bundling mode, the ;; separator is required between every two instructions. Omitting the ;; separator will generate a syntax error. 8229631 Rev A 7/14

Assembler syntax for STxP70-4 core STxP70-4 assembler 3 Assembler syntax for STxP70-4 core Block comments are delimited by /* and */. End of line comments may be introduced with either # or //. Instructions consist of an optional leading guard, followed by whitespace, then an opcode or macro name followed by whitespace and an optional comma-separated list of operands: [guard] opcode macro_name [operand{,operand}] guard opcode macro_name operand This takes the form Gn? where n is the number of a guard register in the range 0 to 7. Guard registers 0 to 6 contain a boolean value; this value determines if the instruction should be executed or not. If an instruction is prefixed by G7, then it is always executed. If a guard is not given, then the assembler assumes G7 as default. An STxP70 instruction mnemonic. The name of a previously defined multi-line macro. One of the following: register name memory reference expression (a combination of operators, constants and identifiers) If the instruction accepts more than one operand, they are separated by commas. All instructions must be separated by a newline or semicolon. 3.1 Register names General purpose registers are named R0 to R31. Loop registers are named L0 and L1. The STxP70 architecture is configurable. The following specific configurations directly affect the accessible registers: 16 register configuration The STxP70 core only manages R0 to R15. The remaining registers are not accessible. No hardware loop configuration L0 and L1 are not accessible. As a special feature, SP is also supported as a synonym for R15, and GP is supported as a synonym for R13. Additional registers may be added by user-defined extensions. 8/14 8229631 Rev A

STxP70-4 assembler Assembler syntax for STxP70-4 core 3.2 Bundle syntax In addition to the STxP70 core assembler syntax, the STxP70-4 architecture introduces bundling capabilities. Bundling allows two variable length instructions to be bundled together and executed in parallel. In the assembler source code, bundles are separated by double semi-colons ;;. This separator must be specified either on a line by itself or at the end of a line. The following examples show usage of the ;; separator: Example 1 g7? addu R0, R1, R2 g7? move R3, R4 ;; Example 2 g7? addu R0, R1, R2 g7? move R3, R4 ;; Example 3 g7? addu R0, R1, R2 ; g7? move R3, R4 ;; 8229631 Rev A 9/14

STxP70-4 encoding length conventions STxP70-4 assembler 4 STxP70-4 encoding length conventions See the STxP70-4 core and instruction set architecture reference manual (8154580) for a complete list of instructions and descriptions of their semantics. By default, the STxP70-4 assembler looks for the shortest instruction. However, it is possible to control the encoding length used. 4.1 Using shortest instructions The STxP70-4 instruction set provides 16-, 32- and 48-bit versions of some of the most commonly used opcodes. These instructions can significantly reduce code size. Where possible, the assembler automatically translates instructions into the equivalent shortest valid instruction. This translation can be disabled by using specific directives (see Chapter 5: STxP70-4 encoding length directives), or by using the -force-encoding or -norelaxation command-line options (see Chapter 2: Command line options on page 6). STMicroelectronics recommend not to attempt to force the shortest instructions explicitly through directives. The assembler automatically selects the shortest valid instructions wherever possible. 10/14 8229631 Rev A

STxP70-4 assembler STxP70-4 encoding length directives 5 STxP70-4 encoding length directives By default, the STxP70-4 assembler always tries to encode the shortest version of an instruction in order to save code size. This is also known as relaxation at assembler level (see Chapter 6: Code relaxation). However, when it is essential to select a particular version of an instruction, three directives are provided:.is16.is32.is48 Force the assembler to select 16-bit encoding version for following instruction. For example:.is16 g7? addu R0, R0, R2 Force the assembler to select 32-bit encoding version for following instruction. For example:.is32 g1? addu R0, R1, R2 Force the assembler to select 48-bit encoding version for following instruction. For example:.is48 g6? addu R0, R1, R2 Note: If the requested size variant is not available, the assembler will choose the shortest one. These directives apply to instructions only. They do not apply to built-in macros or user-defined macros. 8229631 Rev A 11/14

Code relaxation STxP70-4 assembler 6 Code relaxation When an instruction operand is unknown at assembly time, the assembler selects the largest possible encoding for the particular instruction (usually the 48-bit encoding). Then, at the linking stage, it is the responsibility of the linker, to select the shortest version of the instruction. This process is known as code relaxation. Relaxation is typically performed for branch instructions because the distance of the branch target is unknown at assembly-time. This is also the case for data address reference, because data location is also unknown at assembly time. 12/14 8229631 Rev A

STxP70-4 assembler Revision history 7 Revision history Table 1. Document revision history Date Revision Changes 26-Oct-2009 A Initial release. 8229631 Rev A 13/14

STxP70-4 assembler Please Read Carefully: Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to ST s terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein. UNLESS OTHERWISE SET FORTH IN ST S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER S OWN RISK. Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST. ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners. 2009 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com 14/14 8229631 Rev A