MSC100ABIRM Motorola / Freescale Semiconductor, MSC100ABIRM Datasheet

no-image

MSC100ABIRM

Manufacturer Part Number
MSC100ABIRM
Description
SC100 Application Binary Interface Reference Manual
Manufacturer
Motorola / Freescale Semiconductor
Datasheet
MNSC100ABI/D
Rev. 1.8, 4/2000
SC100 Application Binary Interface Reference Manual

Related parts for MSC100ABIRM

MSC100ABIRM Summary of contents

Page 1

SC100 Application Binary Interface Reference Manual MNSC100ABI/D Rev. 1.8, 4/2000 ...

Page 2

...

Page 3

SC100 Application Binary Interface MNSC100ABI/D Rev. 1.8, 4/2000 Reference Manual ...

Page 4

This document contains information on a new product. Specifications and information herein are subject to change without notice. © Copyright Lucent Technologies Inc., 2000. All rights reserved. © Copyright Motorola Inc., 2000. All rights reserved. LICENSOR is defined as either ...

Page 5

Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 6

Function Argument and Return Type Checking 3-5 3.6.1 Signature Symbols . . . . ...

Page 7

Object File Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 8

SC100 Application Binary Interface Preliminary (April 2000) ...

Page 9

Mapping of C Fundamental Data Types to SC100 2-2 2-2 Mapping of C Fractional Types to SC100 ...

Page 10

Group F23 Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 11

Fundamental Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 12

SC100 Application Binary Interface Preliminary (April 2000) ...

Page 13

Structure Determined by Underlying Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 2-2 1-Byte Field Offset . ...

Page 14

SC100 Application Binary Interface Preliminary (April 2000) ...

Page 15

This manual defines the SC100 Application Binary Interface (ABI). The ABI is a set of interface standards that writers of compilers, assemblers, and debugging tools must use when creating tools for the SC100 architecture. These standards cover run-time aspects as ...

Page 16

Introduction 1.3 Revision History The following updates were made to release of this manual: • Added four new directives: SECFLAGS, SECTYPE, SIZE, and TYPE • Removed the modulo storage directives: BSM and DSM • Noted those directives that are not ...

Page 17

Conformance Levels The ABI interface standards define two levels of conformance: Level 0 Features that are classified as Level 0 are mandatory. Features described in this document are classified as Level 0, unless specifically stated otherwise. Level 1 Features ...

Page 18

Introduction 1-4 SC100 Application Binary Interface Preliminary (April 2000) ...

Page 19

Underlying Processor Primitives For a complete description of the SC100 architecture, refer to the SC140 DSP Core Reference Manual. 2.2 Fundamental Data Types The SC100 architecture supports the fundamental data types shown in Figure 2-1.The mapping between these data ...

Page 20

Low-Level Binary Interface Table 2-1. Mapping of C Fundamental Data Types to SC100 Type (mem) char unsigned char short unsigned short int unsigned long unsigned long float double long double (24-bit mantissa) pointer Table 2-2. Mapping of C Fractional Types ...

Page 21

Compound Data Type Arrays, structures, unions and bit fields have different alignment characteristics, as described in the following sections. 2.2.1.1 Arrays Arrays have the same alignment restriction as their individual elements. 2.2.1.2 Structures and Unions Members of unions and ...

Page 22

Low-Level Binary Interface Fields within structures and unions begin on the next possible suitably-aligned boundary for their data type. For non-bit fields, this is a suitable byte alignment. Bit fields begin at the next available bit offset with the following ...

Page 23

The following registers will be saved by the callee, if actually used: d6-d7,r6-r7. The compiler should assume that the current settings of the following operating control bits are correct: • Saturation mode • Round mode • Scale bits Setting these ...

Page 24

Low-Level Binary Interface Table 2-3. Register Usage in the Stack-Based Calling Convention (Continued) Register r7 Optional frame pointer n0–n3 m0–m3 2.3.3 Optimized Calling Sequences A stackless convention may be used when calling functions that are not re-entrant, if this technique ...

Page 25

For return variables that do not fit in registers, the caller must reserve stack space. This return buffer area is typically located with the local variables. This space is typically allocated only in functions that make calls returning structures. Beyond ...

Page 26

Low-Level Binary Interface 2.3.7 Dynamic Memory Allocation Dynamic allocations are implemented using a heap structure managed by the standard library functions malloc() and free(). The heap shall be allocated statically by the linker. In typical configurations, the stack is allocated ...

Page 27

High-Level Languages Issues 3.1 C Preprocessor Predefines All C/C++ language compilers must have predefined macros as in Table 3-1, in addition to the predefined macros required by the C and C++ language standards. Macro __SC100__ 3.2 C In-Line Assembly Syntax ...

Page 28

High-Level Languages Issues 3.4 Fractional Arithmetic Support The compiler must support the intrinsic functions listed in Table 3-2. Table 3-2. Required Intrinsics for Fractional Types Intrinsic Function int add(int,int) int sub(int,int) int mult(int,int) int div_s(int,int) int add_r(int,int) int sub_r(int,int) int ...

Page 29

Table 3-2. Required Intrinsics for Fractional Types (Continued) Intrinsic Function int extract_h(long) int extract_l(long) long L_deposit_h(int) long L_deposit_l(int) long L_abs(long) long L_negate(long) int norm_l(long) long L_shl(long,int) long L_shr(long,int) long L_shr_r(long,int) long L_sat(long) 3.4.1 Optional Prefix In supporting the intrinsic functions ...

Page 30

High-Level Languages Issues To ensure the ability to link code produced by different compilers into a single executable required that names of compiler support library functions match those listed in Table 3-3 and Table 3-4. Routines in support ...

Page 31

Integer Routines The integer routines listed in Table 3-4 should comply with the ABI calling conventions. The routines have no side effects. Function Prototype int __div16(short a, short b); int __udiv16(unsigned short a, unsigned short b); int __div32(long a, ...

Page 32

High-Level Languages Issues Table 3-6 explains the possible values for Code i scalar type (e.g. char, short, int) of size <= 32 bits, passed in register l scalar type of size = 64 bits, passed in register p Pointer, passed ...

Page 33

SC100 ELF Object File Format 4.1 Formats The executable and linking format (ELF) is used for representing the binary application to the system. For a complete description of ELF, see the ELF–Executable and Linking Format specification (the ELF spec). This ...

Page 34

SC100 ELF Object File Format Linking View Elf Header Optional Program Hdr Sections ... Section Header Table 4.3.1 The ELF Header The ELF header structure is shown in Example 4-1. This structure is defined by the ELF spec, and definitions ...

Page 35

Sections Sections are the main components of the ELF file. Section headers define all the information about a section. A section header is defined in Example 4-3. Section Header Defined typedef struct Elf32_Word sh_name; Elf32_Word sh_type; Elf32_Word sh_flags; Elf32_Addr ...

Page 36

SC100 ELF Object File Format Table 4-1. SC100 ELF Sections (Continued) Name Type .note NOTE .line PROGBITS .rel.line REL .debug_macro PROGBITS .debug_info PROGBITS .debug_abbrev PROGBITS .debug_line PROGBITS .debug_aranges PROGBITS .debug_pubname PROGBITS .hash HASH 1. Processor-specific section type. 4.3.3 Reserved Names ...

Page 37

Relocation Each section which contains relocatable data has a corresponding relocation section of SHT_REL. The sh_info field of the relocation section defines a section header index of the section to which the relocation applies. The sh_link field of the ...

Page 38

SC100 ELF Object File Format The final field in the sequence, described in Example 4-6, is the value field. The value field, after it is evaluated, determines the contents of the memory location. The other fields of the relocation may ...

Page 39

Sym Function Category: generic Argument: <index> Description: This function simply returns the symbol table value of the symbol at <index>. Returns: value of symbol 4.3.4.2.4 Size Function Category: generic Argument: <num_bytes> Description This function sets the size of the ...

Page 40

SC100 ELF Object File Format 4.3.4.2.8 Memcheck Function Category: SC100-specific Arguments: value, <memid> Description: This function verifies certain memory constraints of the symbol value. <memid> may be 0 (no memory constraints (target memory location must be located in ...

Page 41

Constants Integer constants are valid in relocations. Integer constants are recognized as a sequence of the following characters: Decimal integer [0-9] Hexadecimal integer 0x[0-f] Octal integer 0[0-7] Binary integer 0b[0-1] String literals are valid in relocations. String literals are ...

Page 42

SC100 ELF Object File Format 4.3.4.7 Relocation Forms Device-specific forms describe how a memory location should be patched by the linker. Forms are a combination of functions, operators, and constants which completely describe how a memory location’s value will be ...

Page 43

Group Name F3 Arguments value, (s|u), <len>, <align> Member F3W1 Description Encoding function for word 1 of the instruction Definition “(value & mask(13,15))>>8” Member F3W2 Description Encoding function for word 2 of the instruction Definition “value & mask(0,12)” Applicable Instruction(s) ...

Page 44

SC100 ELF Object File Format Group Name F5 Arguments value, (s|u), <len>, <align> Member F5W1O1 Description Encoding function for word 1 operand 1 of the instruction Definition “(~value & mask(14,15))>>11” Member F5W1O2 Description Encoding function for word 1 operand 2 ...

Page 45

Table 4-9. Group F6 Forms (Continued) Member F6W3O1 Description Encoding function for word 3 operand 1 of the instruction Definition “value & mask(0,13)” Applicable Instruction(s) Group Name F7 Arguments value, (s|u), <len>, <align> Member F7W1 Description Encoding function for word ...

Page 46

SC100 ELF Object File Format Group Name F9 Arguments value, (s|u), <len>, <align> Member F9W2O2 Description Encoding function for word 2 operand 2 of the instruction Definition “value & mask(0,5)” Member F9W2O1 Description Encoding function for word 2 operand 1 ...

Page 47

Group Name F11 Arguments value, (s|u), <len>, <align> Member F11W1 Description Encoding function for word 1 of the instruction Definition “(value & mask(30,31))>>27 | (value & mask(13,15))>>8” Member F11W2 Description Encoding function for word 2 of the instruction Definition “value ...

Page 48

SC100 ELF Object File Format Group Name F12 Arguments value, (s|u), <len>, <align> Member F12W1 Description Encoding function for word 1 of the instruction Definition “(value & mask(30,31))>>27 | (value & mask(13,15))>>8” Applicable Instruction(s) Group Name F13 Arguments value, (s|u), ...

Page 49

Group Name F14 Arguments value, (s|u), <len>, <align> Member F14W1 Description Encoding function for word 1 of the instruction Definition Member F14W2 Description Encoding function for word 2 of the instruction Definition Applicable Instruction(s) SC100 Application Binary Interface Table 4-17. ...

Page 50

SC100 ELF Object File Format Table 4-17. Group F14 Forms (Continued) F14 Applicable Instructions (Continued) Group Name F15 Arguments value, (s|u), <len>, <align> Member F15W1 Description Encoding function for word 1 of the instruction Definition Applicable Instruction(s) 4-18 ‘414 BMTSTS ...

Page 51

Group Name F16 Arguments value, (s|u), <len>, <align> Member F16W1O1 Description Encoding function for word 1 operand 1of the instruction Definition “(value & mask(13,15))>>8” Member F16W1O2 Description Encoding function for word 1 operand 2 of the instruction Definition “pack(value,s|u,len,align) & ...

Page 52

SC100 ELF Object File Format Group Name F18 Arguments value, (s|u), <len>, <align> Member F18W1O1 Description Encoding function for word 1 operand 1 of the instruction Definition “(~value & mask(13,15))>>8” Member F18W1O2 Description Encoding function for word 1 operand 2 ...

Page 53

Group Name F19 Arguments value, (s|u), <len>, <align> Member F19W1 Description Encoding function for word 1 of the instruction Definition “(pack(value,s|u,len,align)&mask(19,19)>>8) | (pack(value,s|u,len,align)&mask(16,18)>>16) | (pack(value,s|u,len,align)&mask(12,14)>>7)” Member F19W2 Description Encoding function for word 2 of the instruction Definition “(pack(value,s|u,len,align)&mask(15,15)>>8) | (pack(value,s|u,len,align)&mask(0,11)<<1) ...

Page 54

SC100 ELF Object File Format Group Name F21 Arguments value, (s|u), <len>, <align> Member F21W1 Description Encoding function for word 1 of the instruction Definition Applicable Instruction(s) Group Name F22 Arguments value, (s|u), <len>, <align> Member F22W1 Description Encoding function ...

Page 55

Group Name F23 Arguments value, (s|u), <len>, <align> Member F23W1 Description Encoding function for word 1 of the instruction Definition Applicable Instruction(s) 4.3.5 NOTE Section The note section is optional and contains object file vendor identification and application-specific object file ...

Page 56

SC100 ELF Object File Format Object file comments generated by the user through an assembler directive are placed in the note section. This is typically for users to identify their object code. The same string termination and padding restrictions apply ...

Page 57

This chapter describes the different behavior of the SC140 instructions in the Big-Endian and Little-Endian memory system modes. • Little-Endian: “A computer architecture in which, within a given multi-byte numeric representation, bytes at lower addresses have lower significance (the word ...

Page 58

Endian Support 5.1 Memory Organization Different types of data will be stored differently in the memory in the different modes. Consider this example of data in the memory shown in Figure 5-1: A0=’m’ A8=0102h (16-bit Number) A1=’i’ A10=0304h A2=’c’ A12=0506h ...

Page 59

SC140 Architecture The entire memory space of the SC140 core is unified. The memory supports two parallel 64-bit data accesses issued by the core at the same time, one 128-bit program bus, and external port (usually for DMA accesses). ...

Page 60

Endian Support 5.1.2 Data Move Data moves are done by moving DALU register/ Memory over one of the data buses, XDBA or XDBB. Data registers can be accessed with three types of data: • A long type access, writing or ...

Page 61

Move.2W A8 Move.4W A16 Move.2L A16 12 12 SC140 1234 CORE 34 34 5678 56 78 Figure 5-4. Multiple Data Transfer in Big/Little Endian SC100 Application Binary Interface Big Endian ...

Page 62

Endian Support 5.1.3 Instruction Word Transfers Instruction words are transferred to the core from the memory over the Program Data Bus (PDB), to special instruction registers in the Program Dispatch Unit. The instruction registers can be accessed only with 128-bit ...

Page 63

Memory Access Behavior in Endian Modes Instruction MOVE.B 39 MOVEU.B 39 MOVE.W 39 MOVEU MOVE.2W 39 MOVE.4W MOVE MOVE.L (Extension SC100 Application Binary Interface Memory Access Behavior in Endian Modes ...

Page 64

Endian Support Table 5-1. MOVE Instructions (Continued) Instruction MOVEU MOVES MOVE. MOVE.F MOVES MOVE. MOVES. MOVE.4F 5-8 Register Operands ...

Page 65

Table 5-1. MOVE Instructions (Continued) Instruction 39 32 MOVES.4F 39 VSL. VSL.4F 39 VSL.2W VSL. SC100 Application Binary Interface Memory Access Behavior in Endian Modes Register Operands ...

Page 66

Endian Support Table 5-2. Stack Support Instructions Instruction POP POPN PUSH PUSHN 5-10 Register operands ...

Page 67

Instruction BMCHG.W 39 BMCLR.W 39 BMSET BMTSTS.W 39 BMTSTC.W 39 BMTSET.W 39 NOT.W 39 AND.W 39 OR.W 39 EOR SC100 Application Binary Interface Memory Access Behavior in Endian Modes Table 5-3. Bit-Mask Instructions Register Operands 16 ...

Page 68

Endian Support Table 5-4. Change of Flow Instructions Instruction BSR BSRD JSR JSRD RTE RTED RTS 32 PC ...

Page 69

Table 5-4. Change of Flow Instructions (Continued) Instruction RTSD RTSTK RTSTKD Instruction TRAP SC100 Application Binary Interface Memory Access Behavior in Endian Modes Register Operands A ...

Page 70

Endian Support Table 5-6 lists all the mnemonics available for instructions that are endian sensitive future version, a pointer will be added from each line of the table to the correct table above that describes the way it ...

Page 71

Table 5-6. Memory Access Instructions (Continued) Instruction ID# 237 622 637 623 624 327 115 608 113 606 605 159 161 216 225 207 213 301 222 210 218 304 227 172 112 462 464 465 467 165 217 226 ...

Page 72

Endian Support Table 5-6. Memory Access Instructions (Continued) Instruction ID# 463 466 122 208 124 155 302 110 299 460 294 324 164 212 221 121 206 123 154 300 109 114 607 211 219 305 228 111 117 160 ...

Page 73

Table 5-6. Memory Access Instructions (Continued) Instruction ID# 401 223 209 220 303 229 116 626 638 627 628 618 636 619 620 170 443 171 444 166 441 168 442 194 439 193 186 473 472 471 470 SC100 ...

Page 74

Endian Support 5.3 Comments The following are some comments related to some of the instructions. Based on these comments, a more detailed definition of these cases will be described in a future version of this document. 5.3.1 MOVE Multiple Registers ...

Page 75

Assembler Syntax and Directives This chapter identifies the directives and special characters that must be recognized by SC100 assemblers. Directives are commands that instruct the assembler to carry out some action during assembly, rather than instructions to be directly translated ...

Page 76

Assembler Syntax and Directives 6.2 Assembler Directives Assembler directives can be grouped by function into the following types: 1. Assembly control 2. Symbol definition 3. Data definition/storage allocation 4. Listing control and options 5. Object file control 6. Macros and ...

Page 77

Symbol Definition The directives used to control symbol definition are the following: ENDSEC End section EQU Equate symbol to a value GLOBAL Global section symbol declaration GSET Set global symbol to a value SECFLAGS Set ELF section flags 1 ...

Page 78

Assembler Syntax and Directives 6.2.4 Object File Control The directives used for control of the object file are the following COBJ Comment object code IDENT Object code identification record SYMOBJ Write symbol information to object file 6.2.5 Macros and Conditional ...

Page 79

Symbol Names Symbol names can be from one to 4000 characters long. The first character of a symbol must be alphabetic (upper or lower case); any remaining characters can be either alphanumeric (A-Z, a-z, 0-9) or the underscore character ...

Page 80

Assembler Syntax and Directives 6.2.6.4 Source Statement Format Each source statement may include several fields (for a single instruction assembly line) separated by one or more spaces or tabs: a label field, an operation field, an operand field or data ...

Page 81

Operand Field The interpretation of the operand field is dependent on the contents of the operation field. The operand field, if present, must follow the operation field, and must be preceded by at least one space or tab. The ...

Page 82

Assembler Syntax and Directives 6-8 SC100 Application Binary Interface Preliminary (April 2000) ...

Page 83

Symbols " 6-1 # 6-1 #< 6-1 #> 6-1 % 6-1 * 6-1 ++ 6-1 ; 6-1 ;; 6-1 < 6-1 << 6-1 > 6-1 ? 6-1 @ 6-1 \ 6-1 ^ 6-1 A Address Generation Unit (AGU) 5-7 Argument ...

Page 84

XREF 6-3 Dynamic Memory Allocation 2-8 E Endian 5-1 Executable and Linking Format (ELF) Header 4-2 Relocation 4-5 Sections 4-3 F Floating Point Routines 3-4 Fractional Arithmetic Support 3-2 Frame Pointers 2-7 H Hardware Loops 2-8 Hi Function 4-7 I ...

Page 85

...

Page 86

How to reach us: Motorola Literature Distribution P.O. Box 5405 Denver, Colorado 80217 1 (800) 441-2447 Asia/Pacific Motorola Semiconductors H.K. Ltd., Hong Kong 852-26629298 Japan Motorola Japan, Ltd., Shinagawa-ku, Japan 81-3-5487-8488 Motorola Fax Back System (Mfax™) 1 (800) 774-1848; RMFAX0@email.sps.mot.com ...

Related keywords