background image

56 

Section 2: Compiler

TI

-

89 / TI

-

92 Plus Sierra C Assembler Reference Manual Not for Distribution

Beta Version February 2, 2001

2.7.4. Character 

Constants

A character constant is a sequence of up to four characters enclosed in single
quotes (

'

). Characters that cannot be entered directly or conveniently into the

source program, such as nongraphic characters, can be specified in a character
constant using an escape sequence. Table 2.1 lists the available escape
sequences and their values.

Character constants have type int. The value of each character in a character
constant is its integer encoding in the ASCII character set or the value of its
associated escape sequence, whichever is applicable.

The double quote (

"

) and the question mark (

?

) can be specified directly or with

their escape sequences. The single quote (

'

) and the backslash (

\

) , however,

must be specified with their escape sequences.

In the octal and hexadecimal escape sequences, 

ooo represents up to three

octal digits and 

hhh represents up to three hexadecimal digits. These digit

sequences are terminated with the third digit or the first nonoctal (or
nonhexadecimal) character. The specified digits determine the value of the
character.

Escape Sequence Common Name Integer Value

\a alert (bell) 0x7

\b backspace 0x8

\f form feed 0xC

\n newline 0xA

\r carriage return 0xD

\t horizontal tab 0x9

\v vertical tab 0xB

\' single quote 0x27

\" double quote 0x22

\? question mark 0x3F

\\ backslash 0x5C

\

ooo

octal escape code

0

ooo (masked with 0xFF)

\x

hhh

hexadecimal escape code

0x

hhh (masked with 0xFF)

        Table 2.1: Escape Characters

Some integer values that can be represented using three octal or hexadecimal
digits will not fit into a single eight-bit character. When a value does not fit into
eight bits, it is masked with the value 0xFF to force it to fit into eight bits. The
construct ' \x123 ' is a character constant containing a single character. To

Содержание TI-89 Plus

Страница 1: ...g 102 3542 CG Utrecht The Netherlands Texas Instruments U S A 7800 Banner Dr Dallas TX 75251 www ti com calc 1997 Texas Instruments TI 89 TI 92 Plus Sierra C Assembler Reference Manual Beta Version 02...

Страница 2: ...h or arising out of the purchase or use of these materials and the sole and exclusive liability of Texas Instruments regardless of the form of action shall not exceed the purchase price of this produc...

Страница 3: ...eader 11 1 4 2 1 Magic Number 11 1 4 2 2 Optional Header Size 11 1 4 2 3 Flags 12 1 4 3 Optional Header 12 1 4 4 Section Headers 13 1 4 5 Relocation Information 14 1 4 5 1 Relocation 15 1 4 5 2 Comple...

Страница 4: ...4 9 9 Names Related to Structures Unions and Enumerations 35 1 4 10 String Table 36 2 Compiler 41 2 1 Introduction 41 2 2 Invoking the Compiler 41 2 3 Command Line Flags 41 2 3 1 Usage 42 2 3 2 Defaul...

Страница 5: ...2 10 2 Integer Types 71 2 10 3 Floating Point and Integer Types 71 2 10 4 Floating Point Types 72 2 10 5 Usual Arithmetic Conversions 72 2 10 6 Restrictions 73 2 11 Function Calling Conventions 73 2 1...

Страница 6: ...97 2 16 3 4 Rescanning and Further Replacement 97 2 16 4 Macro Redefinition 97 2 16 5 Macro Examples 98 2 16 6 Line and Name Control 99 2 16 7 Error Directive 100 2 16 8 Pragma Directive 100 2 16 9 Tr...

Страница 7: ...Symbol Syntax 142 3 3 5 2 Labels 143 3 3 5 3 Symbol Assignment 143 3 3 5 4 Comm and Lcomm Symbols 144 3 3 5 5 Undefined Symbols 144 3 3 5 6 Compiler Locals 145 3 3 5 7 Floating Point Symbols 145 3 3...

Страница 8: ...sm68 Directive Reference 168 3 7 Asm68k Assembler Directives 209 3 7 1 Asm68k Section Directives 210 3 7 2 Asm68k Symbol Directives 211 3 7 3 Asm68k Data Fill Directives 212 3 7 4 Asm68k Control Direc...

Страница 9: ...ker 299 4 1 Introduction 299 4 2 Link68 Inputs and Outputs 299 4 3 Options 300 4 3 1 Library Search Options 300 4 3 2 Option Flags 300 4 4 Object Files 302 4 4 1 Sections 302 4 5 Symbols 302 4 6 Reloc...

Страница 10: ...1 Environment Variables 7 Table 1 2 Object File Layout 9 Table 1 3 File Header Contents 11 Table 1 4 File Header Flags 12 Table 1 5 Sierra Systems Optional Header Contents 12 Table 1 6 Section Header...

Страница 11: ...bol Entry for Sections 32 Table 1 28 Auxiliary Symbol Entry for Functions 33 Table 1 29 Auxiliary Symbol Entry for Beginning of Blocks and Functions 33 Table 1 30 Auxiliary Symbol Entry for End of Blo...

Страница 12: ...x Table of Contents TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 13: ...s 10 1 4 2 File Header 11 1 4 2 1 Magic Number 11 1 4 2 2 Optional Header Size 11 1 4 2 3 Flags 12 1 4 3 Optional Header 12 1 4 4 Section Headers 13 1 4 5 Relocation Information 14 1 4 5 1 Relocation...

Страница 14: ...4 9 7 Tag Names 34 1 4 9 8 End of Structures 35 1 4 9 9 Names Related to Structures Unions and Enumerations 35 1 4 10 String Table 36 Figures Figure 1 1 Partial Sierra C Directory Structure 7 Tables T...

Страница 15: ...and Storage Class 27 Table 1 22 Fundamental Types 28 Table 1 23 Derived Types 29 Table 1 24 Type Entries by Storage Class 30 Table 1 25 Auxiliary Symbol Table Entries 31 Table 1 26 Auxiliary Symbol En...

Страница 16: ...4 Section 1 General Information TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 17: ...dio will handle all invocations of the compiler assembler and linker but information is included in the various sections to enable developers to use them directly from the command line or create their...

Страница 18: ...rs are defined as follows Match zero or more characters where characters matched may be any character except the period Dot star at the end of a wildcard string matches files with and without extensio...

Страница 19: ...ERRA environment variable The SIERRA environment variable will be set when the setup program for the TI FLASH Studio is executed The SIERRA environment variable must be set before using any of the Sie...

Страница 20: ...semicolon separated list of one or more directory paths defines the standard library directories If the SIERRA environment variable is the only variable defined the lib subdirectory located under the...

Страница 21: ...BLE Table 1 2 Object File Layout Some or all of the last four sections relocation line number symbol table and string table may be missing from the final executable file If the program is linked with...

Страница 22: ...be copied from ROM to RAM at program startup the ROM copy source of the section s data is considered to be at the physical address and the RAM copy destination of the section s data is considered to...

Страница 23: ...y 1 1970 8 11 unsigned long fh_symtab_ptr File pointer containing the starting offset of the symbol table 12 15 unsigned long fh_nbr_symtab_ents Number of entries in the symbol table 16 17 unsigned sh...

Страница 24: ...As previously stated system independent COFF utilities can skip past the system dependent optional header to perform tasks such as dumping the symbol table Bytes Declaration Name Description 0 1 unsi...

Страница 25: ...e file pointers are byte offsets from the beginning of the file and can be used to locate the start of the data relocation or line entries for the section Bytes Declaration Name Description 0 7 char s...

Страница 26: ...d SH_OVERT 0x400 Overlay section not alloc d reloc d not load d SH_LIB 0x800 Library section Table 1 7 Section Header Flags All sections including sections with uninitialized data such as section bss...

Страница 27: ...entry will be ignored RL_DIR_BYTE 0x0F Direct 8 bit reference to symbol s virtual address RL_DIR_WORD 0x10 Direct 16 bit reference to symbol s virtual address RL_DIR_LONG 0x11 Direct 32 bit reference...

Страница 28: ...er with a 24 bit or 32 bit hole respectively 1 4 5 2 Complex Relocation A complex relocatable expression is an expression that cannot be reduced at assembly time to either an absolute value or a secti...

Страница 29: ...ry Defined in file_fmt txt are LINE_NBR and LINE_NBR_SIZE the typedefs for the line number entry structure and line number entry size respectively Bytes Declaration Name Description 0 3 unsigned long...

Страница 30: ...tion 1 function 2 local symbols for function 2 statics for file 1 filename 2 local symbols for function 1 statics for file 2 all defined global symbols all undefined global symbols Table 1 13 COFF Sym...

Страница 31: ...n or enumeration _etext Next available address after the end of the output section text _edata Next available address after the end of the output section data _end Next available address after the end...

Страница 32: ...mbol bb is inserted in the symbol table immediately before the first local symbol of the block Analogously the special symbol eb is inserted in the symbol table immediately after the last local symbol...

Страница 33: ...s use the same symbol table format Every symbol table entry occupies 18 bytes Table 1 16 describes the fields within a symbol table entry It should be noted that the indices for symbol table entries b...

Страница 34: ...ain the offset relative to the beginning of the string table of the name in the string table Since there cannot be a symbol with a null name the zeroes in the first four bytes distinguish a symbol tab...

Страница 35: ...C_STRTAG 10 Structure tag C_MOU 11 Member of union C_UNTAG 12 Union tag C_TPDEF 13 Type definition C_USTATIC 14 Uninitialized static C_ENTAG 15 Enumeration tag C_MOE 16 Member of enumeration C_REGPAR...

Страница 36: ...storage classes Table 1 18 lists the restricted special symbols with their allowed storage classes Also the storage classes C_FILE C_BLOCK C_FCN and C_EOS are used only with the special symbols they...

Страница 37: ...TAG 0 C_MOU 0 C_UNTAG 0 C_TPDEF 0 C_ENTAG 0 C_MOE Enumeration value C_REGPARM Register number C_FIELD Bit displacement C_BLOCK Relocatable address C_FCN Relocatable address C_EOS Size C_FILE see text...

Страница 38: ...result of defining an uninitialized external variable The ANSI C standard permits only a single defining instance initialized or uninitialized of a particular variable To permit compatibility with ear...

Страница 39: ...mbers Table 1 21 summarizes the relationship between storage class and section number Storage Class Section Number C_AUTO N_ABS C_EXT N_ABS N_UNDEF N_SCNUM C_STAT N_SCNUM C_REG N_ABS C_LABEL N_UNDEF N...

Страница 40: ...ndamental type and from zero to six derived types The following is the format of the 16 bit type entry d6 d5 d4 d3 d2 d1 type Bits 0 through 3 identified as type indicate one of the fundamental types...

Страница 41: ...he third derived type is also 1 pointer Combining the information into a single word 01 01 10 0100 as previously described the hexadecimal representation of the value in the type field is 0x164 short...

Страница 42: ...OE C_LABEL no no no T_NULL C_MOS no yes yes Any except T_MOE C_ARG yes no yes Any except T_MOE C_STRTAG no no no T_STRUCT C_MOU no yes yes Any except T_MOE C_UNTAG no no no T_UNION C_TPDEF no yes yes...

Страница 43: ...N DT_NON T_NULL Beginning of blocks and functions eb C_BLOCK DT_NON T_NULL End of blocks and functions ef C_FCN DT_NON T_NULL End of blocks and functions name related to structure union or enumeration...

Страница 44: ...rs Number of line number entries 8 17 Unused filled with 0 s Table 1 27 Auxiliary Symbol Entry for Sections 1 4 9 3 Functions The auxiliary symbol table entries for functions have the format shown in...

Страница 45: ...symbol table entries for beginning of blocks and functions have the format shown in Table 1 29 Bytes Declaration Name Description 0 3 Unused filled with 0 s 4 5 unsigned short symbol u1 s c_line_nbr C...

Страница 46: ...gned short symbol u2 array_dim 1 Second dimension 12 13 unsigned short symbol u2 array_dim 2 Third dimension 14 15 unsigned short symbol u2 array_dim 3 Fourth dimension 16 17 Unused filled with 0 s Ta...

Страница 47: ...symbol u1 s size Size of structure union or enumeration 8 17 Unused filled with 0 s Table 1 33 Auxiliary Symbol Entry for End of Structures 1 4 9 9 Names Related to Structures Unions and Enumerations...

Страница 48: ...the base offset of the symbol table The first four bytes of the string table contain the size of the string table in bytes thus the first string table symbol will be at offset four For example given a...

Страница 49: ...word 53 2 6 2 ANSI C Keywords 53 2 7 Constants 54 2 7 1 Floating Point Constants 54 2 7 2 Integer Constants 54 2 7 3 Enumeration Constants 55 2 7 4 Character Constants 56 2 8 Character Strings 57 2 9...

Страница 50: ...pe and Old Style Declarations 76 2 11 2 Passing Argument Values 77 2 11 3 Accessing Parameters 78 2 11 4 Returning Values 79 2 11 5 Register Usage 81 2 12 Compiler Generated Function Calls 81 2 12 1 I...

Страница 51: ...eta Version February 2 2001 2 16 4 Macro Redefinition 97 2 16 5 Macro Examples 98 2 16 6 Line and Name Control 99 2 16 7 Error Directive 100 2 16 8 Pragma Directive 100 2 16 9 Trigraph Sequences 100 2...

Страница 52: ...entations 60 Figure 2 2 Internal TI BCD Floating Point Representation 61 Figure 2 3 Special Internal Floating Point Representations 63 Figure 2 4 Floating Point Emulation Code Word 84 Tables Table 2 1...

Страница 53: ...piler Typically the TI FLASH Studio will handle all invocations of the compiler using the correct command line flags required to produce TI 89 TI 92 Plus apps or ASMs The following discussion of comma...

Страница 54: ...ehavior of the compiler com68 demo_in c lO demo_out s These two command lines demonstrate both how flags can be grouped together using a single hyphen and that they can appear anywhere on the command...

Страница 55: ...n optimizations Or2 Treat all qualifying automatic variables as register candidates Os2 In the presence of a function prototype arguments of type char and short int are pushed onto the stack as two by...

Страница 56: ...he assembly language listing as specified by the f format option LIC Display serial number and license information M M1 M2 tnbr M3 tnbr M4 tnbr M5 Not supported by Texas Instruments however M M1 M2 tn...

Страница 57: ...ly constants are to be moved outside inner most loops default The Op1 flag also default must also be in effect for l1 to have any effect l2 specifies that invariant expressions are to be moved outside...

Страница 58: ...Variables that were declared register may still be assigned to registers r4 prevents floating point automatic variables that have not been declared register from being placed into floating point regi...

Страница 59: ...s that would confuse a source level debugger are disabled when the q flag is specified q1 Generate full source level debugging information for everything except automatic variables and allow the compi...

Страница 60: ...file Errors are also written to stderr Esize Set the size of the expression stack The default size of the expression stack is 30 This option is not valid with the Z flag f Generate a warning when a f...

Страница 61: ...ith a maximum PC relative displacement of 16 bits q When used with the Z flag this option undoes the effect of the q and q1 flags used to specify the generation of source level debugger information Th...

Страница 62: ...es warnings concerning minor problems such as unnecessary assignments and statements that cannot be reached w2 disables warnings concerning the compile time initialization of address register relative...

Страница 63: ...e used as interrupt handlers Finally two pragmas allow selected data objects to be referenced using the absolute long addressing mode when a4 relative addressing is selected on the command line The fi...

Страница 64: ...l data objects declared between the pragma abs_data and pragma abs_data directives will be accessed using the absolute long addressing mode pragma abs_data Undo the effect of the pragma abs_data direc...

Страница 65: ...ce asm move w 0x2400 sr 4 The integer constant 4 that follows the string indicates the size of the instruction in bytes The size argument is optional if omitted the instruction is assumed to be two by...

Страница 66: ...e or E followed by an optionally signed decimal constant The type specifier is one of the letters f F l or L Either the decimal point or the exponent must be present for the constant to be recognized...

Страница 67: ...th no suffix is the first type in the following list in which its value can be represented int unsigned int long int unsigned long int 3 The type of a constant with only the u or U suffix is the first...

Страница 68: ...must be specified with their escape sequences In the octal and hexadecimal escape sequences ooo represents up to three octal digits and hhh represents up to three hexadecimal digits These digit seque...

Страница 69: ...of bit 7 the sign of a four character character constant is determined by the value of bit 31 Two and three character character constants are always positive The examples in Table 2 2 illustrate how...

Страница 70: ...is is a test of a string that spans two lines Character strings can also be continued by placing them adjacent to each other For example the following two strings are equivalent this string has been b...

Страница 71: ...pointers to int and pointers to short int are different types and a warning will be issued if either type is assigned to the other Also the program may someday be recompiled on another compiler where...

Страница 72: ...Floating Point Functions for more information on the IEEE format There are two forms of the TI BCD floating point values differing only in the number of significant digits retained in the mantissa Bot...

Страница 73: ...alue greater than 0x4000 represents a positive exponent The memory address of a floating point data object is the address of the first byte of the sign exponent The decimal point is assumed to be afte...

Страница 74: ...within the range required by the calculator user floating point representation and what to do when it is not There are also several specific floating point representations for signed zeros infinities...

Страница 75: ...Developers Guide for information on how and when to verify that the floating point value is valid as required by the calculator user floating point representation and what to do when it is not 2 9 5 E...

Страница 76: ...ify the enumeration type name If subsequent declarations will not be made the enumeration type name enum tag can be omitted from the initial declaration For example the following three sets of declara...

Страница 77: ...n after the member declarator In the following declaration x a is a 10 bit integer x b is a 12 bit integer and x c is a seven bit integer struct s long int a 10 long int b 12 c 7 x The three members o...

Страница 78: ...aced in the lowest order bits highest address available in the specified integer type If a bit field does not fit in the remainder of the current integer it is placed in a new one i e it cannot span t...

Страница 79: ...is implied The const type specifier can also be used to declare pointers to constant objects and constant pointers to constant and nonconstant objects Just as an asterisk in a declaration indicates a...

Страница 80: ...s that would alter either the size of references to the object e g char short int etc or the number of references made to the object For example the compiler cannot test a bit in a four byte volatile...

Страница 81: ...e were established to help prevent accidental references of volatile objects with dereferenced pointers to nonvolatile objects 2 9 10 Touch Operator The _touch pointer_to_volatile_argument operator us...

Страница 82: ...cast required pi legal pv 2 illegal size of void pointer unknown f pv illegal to dereference a void pointer 2 10 Conversions The compiler provides for both the implicit and explicit conversion of val...

Страница 83: ...is converted to an integer type of shorter length the resultant value is the value of the truncated bit pattern as interpreted by the new type When a signed integer type is converted to an unsigned i...

Страница 84: ...versions The first applicable rule in the following lists specifies the performed conversions If either operand is of type double the other operand is converted to type double If either operand is of...

Страница 85: ...or an implicit conversion involving a pointer excluding null pointers and void pointers is illegal In both of these cases however the conversion will be performed and a warning issued All conversions...

Страница 86: ...argument types Function prototypes prevent errors caused by passing the wrong argument type or wrong number of arguments to a called function The following are examples of prototype function declarati...

Страница 87: ...le of a prototype function definition double f1 short a int b double c function body The function f1 is defined to accept three arguments and return a value of type double The formal parameter type de...

Страница 88: ...rmed At a function call site there is no information available on the types of the arguments If a called function has a formal parameter declared to be of type float it is expecting an actual paramete...

Страница 89: ...compiler command line flags Xf1 Xf2 and Xf3 can be used to verify that appropriate declarations are being utilized The Xf1 flag causes a warning to be issued when a function is called outside the sco...

Страница 90: ...rototype 2 11 3 Accessing Parameters Inside the called function the function parameters are accessed from the stack The exact mechanism for accessing the parameters is determined by the presence or ab...

Страница 91: ...h data or address register pushed onto the stack Ten bytes for each floating point register pushed onto the stack Four bytes introduced by the addq l 4 sp instruction if present 2 11 4 Returning Value...

Страница 92: ...n an integer must be declared in a file before it is called Failure to do so could result in unexpected behavior Without a declaration in scope a called function is assumed to return an integer theref...

Страница 93: ...nction that uses them Registers a6 frame pointer and a7 stack pointer must also remain stable across function calls The unlk instruction restores registers a6 and a7 2 12 Compiler Generated Function C...

Страница 94: ...Divide 16 bit unsigned by 16 bit unsigned __ds32s32 Divide 32 bit signed by 32 bit signed __du32u32 Divide 32 bit unsigned by 32 bit unsigned __ds16u16 Divide 16 bit signed by 16 bit unsigned __ms16u...

Страница 95: ...able to 20 BCD digits and the TI BCD values have 16 digits differences will be extremely rare double flt1 1024 16 IEEE operations double flt2 flt2 flt1 4 TI BCD floating point routines When generating...

Страница 96: ...rands If one of the operands is specified by its absolute address the 32 bit address is pushed onto the stack immediately before the function call If an operand is specified to be an immediate short i...

Страница 97: ...adius 5 void circle void text align 2 globl _circle def _circle val _circle scl 2 type 0xd0020 endef _circle link a6 36 6 9 area 3 14159 radius radius fmove d _radius fp0 move l a0 sp lea _radius a0 m...

Страница 98: ...tion is corrupted The XS flag causes the compiler to insert calls to _stk_ck at the beginning of every function in the file The amount of stack space used by the function is available to _stk_ck in re...

Страница 99: ...e data object is assigned to the bss section where it is set to zero at the start of program execution An initializer for an integer or floating point data object must be an expression that evaluates...

Страница 100: ...izers in a brace enclosed list than there are members in the aggregate For initialization purposes a union is treated as a structure that contains a single member where the single member is the first...

Страница 101: ...he following two examples however are not equivalent short x 2 3 1 2 short x 2 3 1 2 The first defines an array in which x 0 0 1 x 0 1 2 and all other elements are zero the second defines in array in...

Страница 102: ...variables that qualify the qualifying variables that are not already declared register are prioritized based on the number of times they appear in the function On the basis of their assigned prioritie...

Страница 103: ...to be assigned or there are no more address registers to be allocated 3 Fit integer type objects into address registers until there are no more integer type objects to be assigned or there are no more...

Страница 104: ...here are more than four case labels the switch algorithm selected is determined by both the number of case statements and their values If the case value density is sufficiently high a jump table is ge...

Страница 105: ...xt of a C source program before it is passed onto the compiler proper The preprocessor is typically used to simplify both the writing and maintenance of a C source program Controlled by preprocessor d...

Страница 106: ...DE68 If INCLUDE68 is not set the include subdirectory of the directory specified by the SIERRA environment variable is searched A preprocessing directive of the following form specifies that the filen...

Страница 107: ...ant expression that follows a if or elif must contain only integral constants including character constants that may contain escape sequences and it must not contain the sizeof operator a cast operato...

Страница 108: ...n A function like macro name that is not followed by a left parenthesis is not recognized as a macro name and no replacement is made The replaced sequence is terminated by the matching right parenthes...

Страница 109: ...t list 2 16 3 4 Rescanning and Further Replacement After all parameters in the replacement list have been substituted as described above the resulting tokens are rescanned for more macro names to repl...

Страница 110: ...for redefinition tokenization macro replacement and replacement list reexamination define x 3 define q x define f i f q i m define b b c undef x define x 5 define z a a define g f define j define d de...

Страница 111: ...After string concatenation the above result appears as follows printf max a b becomes a b a b n Space around the and operators is optional 2 16 6 Line and Name Control A preprocessing directive of the...

Страница 112: ...ocessing_tokens A pragma causes the compiler to behave in specified ways The functionality of a pragma directive is similar to that of a command line flag except that the specified behavior can be emb...

Страница 113: ...string literal e g file_name __FLOAT__ Not supported by Texas Instruments however __FLOAT__ is recognized as a reserved name by the compiler __INT__ A macro that expands to 16 or 32 to indicate wheth...

Страница 114: ...s unknown An automatic or uninitialized static array is declared with an empty dimension asm keyword requires a character string The argument specified inside the parentheses following the asm keyword...

Страница 115: ...nstant too long A character constant contains more than four characters character string too long A character string contains more than 512 characters When adjacent character strings are concatenated...

Страница 116: ...eger expression required A constant integer expression is required This error may occur when a floating point or nonconstant expression is used in an array declaration bit field specification or enum...

Страница 117: ...y a matching if ifdef or ifndef directive endif without matching if ifdef or ifndef A endif directive cannot appear without being preceded by a matching if ifdef or ifndef directive empty character co...

Страница 118: ...ro A compile time floating point division by zero occurred floating point operand error A compile time operand error has occurred formal parameter declaration list illegal with prototypes A prototyped...

Страница 119: ...e nested deeper than 16 levels include s are nested too deep Included files cannot be nested deeper than 50 levels generated code contains too many labels The assembly code generated by the compiler c...

Страница 120: ...A function returning a structure must return a structure type that matches the function return type illegal continue A continue statement may appear only inside a do for or while statement illegal dec...

Страница 121: ...nonpointer object illegal initialization type type An incompatible type was used to initialize a variable of type type illegal initialization bit field type The constant used to initialize a bit field...

Страница 122: ...not a pointer to a structure or a union was used where such a pointer was expected illegal to cast a string inside an initialization It is illegal to apply the cast operator to a character string use...

Страница 123: ...o an object whose address cannot be taken illegal use of on register type It is illegal to take the address of an object declared with the register storage class specifier illegal use of member identi...

Страница 124: ...he length of a preprocessor token identifier or numeric constant exceeds 256 characters integer divide by zero An integer division by zero occurred while doing integer constant folding invalid argumen...

Страница 125: ...memory allocation request too large code number A memory request by the compiler exceeds the maximum block size available on the host machine The code number is an internal code specifying the locati...

Страница 126: ...nstant An unescaped newline appears inside a character constant newline inside character string An unescaped newline appears inside a character string newline inside filename A newline character appea...

Страница 127: ...blem report on TI s web site prototype declarations are nested too deep Function prototype declarations can be nested up to ten levels deep redeclaration of identifier The given identifier is declared...

Страница 128: ...structure or union is not known thus a structure or union assignment cannot be made size of struct union member identifier is unknown The size of the given structure or union member is unknown size o...

Страница 129: ...ion type not pointer required The operand to the left of the dot operator is a structure pointer instead of a structure type struct union type required by nonunique member identifier The given member...

Страница 130: ...t level number An aggregate declaration contains more initializers than there are objects to initialize at the specified brace level type name cannot be initialized A typedef declaration cannot contai...

Страница 131: ...e sequence in character constant A character constant following a if or elif directive contains an unrecognized escape sequence unrecognized preprocessor directive token The given token is not a legal...

Страница 132: ...fewer arguments than were specified by an in scope prototyped function declaration warning function ident called with too many arguments The function was called with more arguments than were specifie...

Страница 133: ...ompile time initialization warning illegal use of member identifier The structure to the left of the dot or arrow operator does not include the given member warning incompatible parameter types indent...

Страница 134: ...ture or union pointer warning struct union type required The left operand of the arrow operator is not a structure or union type warning too many dimensions for symbolic debugging The object file symb...

Страница 135: ...t Variables 136 3 2 5 Invocation Examples 137 3 3 Assembly Language 137 3 3 1 Overview 138 3 3 2 Assembler Statements 138 3 3 2 1 Statement Syntax asm68 138 3 3 2 2 Statement Syntax asm68k 139 3 3 3 C...

Страница 136: ...odes 155 3 5 1 Overview 155 3 5 2 Terminology 157 3 5 3 Effective Address Syntax 158 3 5 4 Addressing Mode Selection 160 3 5 4 1 PC relative Coercion 160 3 5 4 2 Displacement Sizing 161 3 5 4 3 Mode s...

Страница 137: ...rence 215 3 8 Asm68k Macros 271 3 8 1 User Defined Macros 271 3 8 1 1 Macro Definition 271 3 8 1 2 Macro Invocation 272 3 8 1 3 Parameters 273 3 8 1 4 Local Labels 274 3 8 1 5 NARG Symbol 274 3 8 1 6...

Страница 138: ...le 3 8 Integer Expression Operators 149 Table 3 9 Operator Precedence Associativity 150 Table 3 10 Instruction Optimizations and Corrections 154 Table 3 11 Effective Addressing Modes 156 Table 3 12 Ef...

Страница 139: ...ruary 2 2001 Table 3 25 Symbol Directives 211 Table 3 26 Data Fill Directives 212 Table 3 27 Control Directives 213 Table 3 28 Output Directives 214 Table 3 29 Debugging Directives 215 Table 3 30 Inte...

Страница 140: ...128 Section 3 Assembler TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 141: ...was designed to assemble code written for the Motorola M68000 Resident Structured Assembler Its directive set has been extended to offer many of the features provided by asm68 while remaining compatib...

Страница 142: ...8 a description of asm68k user defined macros and structured control macros Section 3 9 an instruction set summary including a list of all supported instructions and legal size extensions 3 1 2 Prereq...

Страница 143: ...semblers in fact allow directives to be written in either lowercase or uppercase characters The asm68k directives shown in lowercase and beginning with a period are extensions to the Motorola M68000 R...

Страница 144: ...as shown in the sample assembler invocations included in the TI 89 TI 92 Plus SDK files Other flag combinations may produce output incompatible with the TI 89 TI 92 Plus data objects Numerical argume...

Страница 145: ...l symbol with value value If value is omitted the symbol is assigned a value of 1 D symbol value Define a global symbol symbol with value value If value is omitted the symbol is assigned a value of 1...

Страница 146: ...ce When the L flag is specified all debugging directives except for the type TYPE directive are ignored see sections 3 6 6 Asm68 Debugging Directives and 3 7 6 Asm68k Debugging Directives The type TYP...

Страница 147: ...is omitted or is zero or one spaces are used instead of tabs this is the default behavior T Generate a transcript of the input assembly source when it is read from the standard input stream stdin The...

Страница 148: ...ilename Since the full path name is not used the object file is written in the current directory regardless of the location of the source file If the name of the listing file is not specified see y fl...

Страница 149: ...tory 3 2 5 Invocation Examples The following examples demonstrate how to invoke the assemblers The assembler asm68 is used in the examples Path names are specified using MS DOS syntax asm68 o obj driv...

Страница 150: ...bject File Format 3 3 2 Assembler Statements An assembly language program consists of statements that are used to generate machine instructions control the behavior of the assembler and provide docume...

Страница 151: ...t Syntax Label label comment Instruction label instruction operand comment Directive label directive operand comment Equate label equate operand comment Macro label macro operand comment Comment comme...

Страница 152: ...an absolute address during linkage Each relocatable section must have a name names are optional for absolute sections The remainder of this section describes the various types of sections and the met...

Страница 153: ...is section relative in a relocatable section The location counter allows a resumed section to continue as if there had been no interruption additional object code is placed immediately following the...

Страница 154: ...ers When using asm68 symbol names can be composed of the following characters The alphabetical characters A Z and a z The numerical characters 0 9 The underscore _ They cannot begin with a numerical c...

Страница 155: ...ing the label to be external see xdef XDEF directive When using asm68k it is also possible to limit the scope of a label to a particular subset of a source file A local label is defined by prefixing i...

Страница 156: ...bility with these languages therefore they allow symbols to be redefined provided the size and alignment information are identical If the C linker command flag is specified at link time definitions of...

Страница 157: ...respectively 3 3 5 7 Floating Point Symbols A floating point symbol is defined by assigning it a floating point constant Since the floating point assignment operator in asm68 and the FEQU directive in...

Страница 158: ...Table 3 6 Values are stored using two s complement representation Bytes Signed Range Unsigned Range 1 L128 127 0 255 2 L32 768 32 767 0 65 535 4 L2 147 483 648 2 147 483 647 0 4 294 967 295 Table 3 6...

Страница 159: ...Table 3 7 Syntax Description a bell alert b backspace f form feed n newline r carriage return t tab v vertical tab xh hexadecimal constant h is at most 3 hexadecimal digits Xh hexadecimal constant h...

Страница 160: ...int data objects are stored in 10 bytes See the double directive in sections 3 6 7 Asm68 Directive Reference and 3 7 7 Asm68k Directive Reference for examples of floating point constant entry 3 3 7 Ex...

Страница 161: ...lus Addition Subtraction Left shift Right shift Bitwise AND Bitwise exclusive OR or Bitwise inclusive OR Table 3 8 Integer Expression Operators Each assembler has its own operator precedence rules as...

Страница 162: ...file has been completely scanned so that any forward references can be resolved Once an expression has been evaluated by the assembler it can be classified as one of the following three types absolut...

Страница 163: ...e when it is encountered Also expressions used in assignments must resolve to an absolute or simple relocatable expression when encountered Expressions used elsewhere will typically carry no restricti...

Страница 164: ...n optional size qualifier The recognized mnemonics and corresponding legal size qualifiers are shown in Table 3 32 in section 3 9 Instruction Set Summary For restrictions on the placement of instructi...

Страница 165: ...ality e g add l 4 d0 can be replaced with addq 4 d0 Corrections are performed on instructions when one of the effective addressing modes is incompatible with the instruction In this case the instructi...

Страница 166: ...data ea SUBI data ea SUBI data An SUBA data An SUB qdata ea SUBQ qdata ea SUBI qdata ea SUBQ qdata ea SUBA qdata An SUBQ qdata An CMP data ea CMPI data ea CMP ea An CMPA ea An CMPI data An CMPA data...

Страница 167: ...plicable However only the 68000 addressing modes are supported by Texas Instruments For convenience the effective address notation used in this table and throughout this section is identical to that w...

Страница 168: ...Xn Memory Indirect Postindexed bd An Xn od Preindexed bd An Xn od Program Counter Indirect with Displacement d16 PC Program Counter Indirect with Index 8 Bit Displacement d8 PC Xn Base Displacement bd...

Страница 169: ...r Indirect with Displacement Program Counter Indirect with Index 8 Bit Displacement Base Displacement Program Counter Memory Indirect Postindexed Preindexed Absolute Data Addressing Short Long Immedia...

Страница 170: ...t address xxx W Absolute long address xxx L Base and outer displacements can be either a word or a long word If omitted they are said to be null displacements which have a value of zero in effective a...

Страница 171: ...r or scaling factor Since it cannot be determined which is the base register the one on the left is selected arbitrarily The address register on the right is used as the index register For backward co...

Страница 172: ...1 PC relative Coercion The effective address specifications that are eligible for PC relative coercion are those that have a displacement and no base register This includes the absolute addressing mo...

Страница 173: ...ffect and neither the displacement nor the reference of the displacement is known to be in an absolute section when the instruction is encountered To generate position independent code the pcf PCF and...

Страница 174: ...nt is a byte if only a base register is used the displacement is a word 3 5 4 3 Mode selection After PC relative coercion has been attempted and displacement sizing has been performed the specified ad...

Страница 175: ...n omitted a null displacement is used A word displacement is used in the case of a byte size displacement If the outer displacement has been omitted a null displacement is used A word displacement is...

Страница 176: ...tive is issued Section directives can also be used to create structure template sections these are special dummy sections that allow the convenient definition of labels suitable for structure field re...

Страница 177: ...er to be referenced from within other files they must be declared to have external scope Table 3 18 summarizes the symbol directives for asm68 For more information see section 3 3 5 Symbols Directive...

Страница 178: ...ves are used to allocate storage typically for uninitialized data Table 3 19 summarizes the data and fill directives for asm68 For more information see sections 3 3 5 Symbols and 3 3 6 Constants Direc...

Страница 179: ...tive Function cmnt Begin comment block elifdef Assemble if alternative symbol defined else Assemble if converse true end End assembly endc End comment block endif End conditional assembly ifdef Assemb...

Страница 180: ...mbly language Instead the L command line flag should be used in conjunction with the type directive to provide a reasonable level of debugging capability When the L command line flag is specified a li...

Страница 181: ...0x4000 ascii Generate Integer Data Byte Syntax ascii operand operand Description operand Specifies an integer expression The ascii directive generates byte integer data The values of the specified ope...

Страница 182: ...h The bin directive inserts the contents of the specified binary file at the current position in the assembler source If the file is not specified with a full path it is searched for in or relative to...

Страница 183: ...he specified section already exists it is resumed either at its current location i e the value of its location counter or at the specified address address An absolute section can be restarted at any a...

Страница 184: ...This directive is a synonym for the ascii directive For additional information see section 3 3 6 2 Character Constants Examples byte Hello 0 4865 6c6c 6f21 00 byte a 61 byte 1111 017 15 0xf 0f0f 0f0f...

Страница 185: ...block of uninitialized data in the BSS type section bss The number of bytes in this block is specified by count The alignment of the block is specified by align if omitted or if the c flag has been sp...

Страница 186: ...t comprise a symbol attribute block can be specified as a backslash separated list The information contained in an attribute block is stored in the object file s symbol table for purposes of symbolic...

Страница 187: ...im directive sets the dimension attribute of the symbol referenced by the current attribute block see def directive The dimension attribute is specified for array types see sections 1 4 8 7 Type Entry...

Страница 188: ...llowed The double directive generates TI BCD floating point data The values of the specified operands are placed in 10 bytes beginning at the current location in the current section A warning is issue...

Страница 189: ...forward external or undefined references The dsection directive begins a data type section with name name If address is specified the section is absolute and begins at that address otherwise the secti...

Страница 190: ...those of the ANSI standard C library function printf are shown below the default is d d Signed decimal u Unsigned decimal o Octal x Hexadecimal lower case X Hexadecimal upper case The echo directive c...

Страница 191: ...mbol The elifdef directive is used in a conditional assembly block It is equivalent to the else directive followed by an ifdef endif block see ifdef and endif directives Its use obviates the need for...

Страница 192: ...ective If this preceding directive fails then the statements between the else directive and the matching endif directive are assembled otherwise these statements are skipped The else directive is opti...

Страница 193: ...tive ends a conditional assembly block see ifdef and ifndef directives Example ifdef debug jsr mem_dump endif ends End a Structure Template Section Syntax ends Description The ends directive ends a st...

Страница 194: ...bols that are referenced in a file but not defined in that file are assumed to have external scope therefore these directives are not necessary unless the E flag is specified on the command line Examp...

Страница 195: ...d precision Real not supported p Packed Decimal Real not supported count Specifies the unit count It is an absolute expression that cannot contain any forward external or undefined references value Sp...

Страница 196: ...t location in the current section A warning is issued if the alignment is odd The data generated is the same as the double directive allowing 16 digits in the mantissa Since a float in the compiler co...

Страница 197: ...These directives are synonyms for the xdef directive Examples globl main jmp_tbl global diag_list proc1 eval ifdef Assemble If Symbol Defined Syntax ifdef symbol Description symbol Specifies a user d...

Страница 198: ...y block If the specified symbol symbol is not defined when the directive is encountered then the statements between this directive and the first matching elifdef else or endif directive are assembled...

Страница 199: ...ied file at the current position in the assembler source If the file is not specified with a full path it is searched for in or relative to the following directories in the indicated order 1 The curre...

Страница 200: ...requirements for the symbol Its value can be 1 2 or 4 It is an absolute expression that cannot contain any forward external or undefined references The lcomm directive defines the specified symbol sym...

Страница 201: ...directive sets the line number attribute of the symbol referenced by the current attribute block see def directive For a detailed description of this attribute see section 1 4 9 Auxiliary Table Entrie...

Страница 202: ...d references The ln directive creates a line number entry for purposes of source level debugging This entry associates the current section s location counter with a line in the associated C source fil...

Страница 203: ...enerates long word integer data The values of the specified operands are placed in successive long words beginning at the current location in the current section A warning is issued if the alignment i...

Страница 204: ...ct code associated with data directives e g byte word etc to be listed in its entirety while the nodlist option permits only one line of object code to be listed Default dlist eqin noeqin Enable disab...

Страница 205: ...ist nolist Enable disable listing of the assembly code These options are used to omit portions of the assembly code from the listing file Pairs of these complement options can be nested Default list n...

Страница 206: ...ng four levels of range checking are provided 0 No checking all values are silently truncated 1 Byte 256 255 Word 65536 65535 2 Byte 128 255 Word 32768 65535 3 Byte 128 127 Word 32768 32767 Default rn...

Страница 207: ...absolute expression that cannot contain any forward external or undefined references The org directive begins an unnamed data type section The section s base address address is fixed Examples org 0x8...

Страница 208: ...section will continue It is an absolute expression that cannot contain any forward external or undefined references The reorg directive resets the location counter in an absolute section The continua...

Страница 209: ...rences The scl directive sets the storage class attribute of the symbol referenced by the current attribute block see def directive For a list of recognized storage classes see section 1 4 8 2 Storage...

Страница 210: ...ed references The section directive begins a data type section with name name If address is specified the section is absolute and begins at that address otherwise the section is relocatable If the spe...

Страница 211: ...ds beginning at the current location in the current section A warning is issued if the alignment is odd This directive is a synonym for the word directive For additional information refer to section 3...

Страница 212: ...ze attribute of the symbol referenced by the current attribute block see def directive The size attribute is specified for aggregate types see section 1 4 9 Auxiliary Table Entries This directive can...

Страница 213: ...Integer 4 bytes s Single precision Real not supported d Double precision Real not supported x Extended precision Real not supported p Packed Decimal Real not supported count Specifies the unit count I...

Страница 214: ...ute address zero Since they are dummy sections they cannot contain any object code Also they cannot be nested however fields of a nested structure can be treated as part of the enclosing structure The...

Страница 215: ...able Entries This directive can appear at most once per symbol attribute block The tag directive is typically used only for C source level debugging it is ignored when assembler source level debugging...

Страница 216: ...forward external or undefined references The tsection directive begins a text type section with name name If address is specified the section is absolute and begins at that address otherwise the secti...

Страница 217: ...ute block see def directive For a discussion of fundamental and derived types see section 1 4 8 7 Type Entry This directive can appear at most once per symbol attribute block The type directive can al...

Страница 218: ...mbol referenced by the current attribute block see def directive The meaning of the value attribute is dependent upon the selected storage class see section 1 4 8 4 Symbol Value Field This directive c...

Страница 219: ...tional information refer to section 3 3 6 2 Character Constants Examples word ab 6162 word 1111111111 01777 1023 03ff 03ff 03ff word 1024 16 4000 Each of the above examples is shown with the sequence...

Страница 220: ...the current file Section names and floating point symbols are not allowed The xref directive declares the scope of the symbol symbol to be external This is necessary when a locally referenced symbol...

Страница 221: ...Create and modify symbols Data Fill directives Generate initialized uninitialized data Control directives Control assembly Output directives Specify output settings Debugging directives Generate debug...

Страница 222: ...es Table 3 24 summarizes the section directives for asm68k For more information see section 3 3 4 Sections See chapter 7 Flash Application Layout in the TI 89 TI 92 Plus Developer Guide for informatio...

Страница 223: ...s they must be declared to have external scope Table 3 25 summarizes the symbol directives for asm68k For more information see section 3 3 5 Symbols Directive Function comm Define a comm symbol global...

Страница 224: ...ypically for uninitialized data Table 3 26 summarizes the data and fill directives for asm68k For more information see sections 3 3 5 Symbols and 3 3 6 Constants Directive Function align Align locatio...

Страница 225: ...irective Function cmnt Begin comment block elifdef Assemble if alternative symbol defined else Assemble if converse true endc End comment block endif End conditional assembly ifdef Assemble if symbol...

Страница 226: ...ting file TTL Set title in listing file Ignored by assembler Table 3 28 Output Directives 3 7 6 Asm68k Debugging Directives Debugging directives are used to generate source level debugging information...

Страница 227: ...ser defined and dummy functions ends when either a new function is defined or a new section is created Directive Function def DEF Begin symbol attribute block dim DIM Set array dimension attribute end...

Страница 228: ...x bin filename BIN filename Description filename The name of a binary file including an optional absolute or relative path It can optionally be enclosed in single or double quotes The BIN directive in...

Страница 229: ...cannot contain any forward external or undefined references The bsection BSECTION directive begins a BSS type section with name name If address is specified the section is absolute and begins at that...

Страница 230: ...section 3 3 4 1 Section Types byte Generate Integer Data Byte Syntax byte operand operand Description operand Specifies an integer expression The byte directive generates byte integer data The values...

Страница 231: ...other comment markers are needed endc COMLINE Allocate a Block of Uninitialized Memory Syntax COMLINE count Description count Specifies the number of bytes to allocate It is an absolute expression tha...

Страница 232: ...ernal or undefined references The COMM directive defines the specified symbol symbol and associates with it a block of uninitialized data in the BSS type section bss The number of bytes in this block...

Страница 233: ...Data type Section data Syntax data Description The data directive begins or resumes the data type section data It is functionally equivalent to dsection data The section data contains initialized read...

Страница 234: ...ported P Packed decimal Real not supported operand Specifies either an integer or floating point value Forward references are not allowed when specifying floating point data The DC directive can be us...

Страница 235: ...ed precision Real not supported P Packed decimal Real not supported count Specifies the unit count It is an absolute expression that cannot contain any forward external or undefined references value S...

Страница 236: ...ectives that comprise a symbol attribute block can be specified on a single line as a semicolon separated list The information contained in an attribute block is stored in the object file s symbol tab...

Страница 237: ...he dim DIM directive sets the dimension attribute of the symbol referenced by the current attribute block see def DEF directive The dimension attribute is specified for array types see sections 1 4 8...

Страница 238: ...lowed The double directive generates TI BCD floating point data The values of the specified operands are placed in 10 bytes beginning at the current location in the current section A warning is issued...

Страница 239: ...ed D Double precision Real not supported X Extended precision Real not supported P Packed Decimal Real not supported count Specifies the unit count It is an absolute expression that cannot contain any...

Страница 240: ...ssion that cannot contain any forward external or undefined references The dsection DSECTION directive begins a data type section with name name If address is specified the section is absolute and beg...

Страница 241: ...those of the ANSI standard C library function printf are shown below the default is d d Signed decimal u Unsigned decimal o Octal x Hexadecimal lowercase X Hexadecimal uppercase The echo directive ca...

Страница 242: ...mbol The elifdef directive is used in a conditional assembly block It is equivalent to the else directive followed by an ifdef endif block see ifdef and endif directives Its use obviates the need for...

Страница 243: ...mbled otherwise these statements are skipped The else directive is optional within a conditional assembly block Example ifdef debug moveq 1 d0 else moveq 0 d0 endif ELSEC Assemble If Converse True Syn...

Страница 244: ...Any assembler statements appearing after this directive are ignored endc End Comment Block Syntax endc Description The endc directive ends a comment block see cmnt directive Note that the endc direct...

Страница 245: ...EF End Symbol Attribute Block Syntax endef ENDEF Description The endef ENDEF directive ends the current symbol attribute block see def DEF directive endif End Conditional Assembly Block Syntax endif D...

Страница 246: ...e or simple relocatable expression that cannot contain any forward external or undefined references The EQU directive defines the symbol symbol and assigns to it the value value The symbol is defined...

Страница 247: ...k a case that should not occur Examples FAIL 83 FAIL 2 second argument inside a macro FEQU Define a Floating Point Symbol Not supported by Texas Instruments However FEQU is still recognized as a reser...

Страница 248: ...data generated is the same as the double directive allowing 16 digits in the mantissa Since a float in the compiler com68 contains only 14 significant digits in the mantissa it is recommended to alwa...

Страница 249: ...other source files since the default symbol scope is static This directive is a synonym for the XDEF directive Example global main jmp_tbl globl procl eval IDNT Set Name of Source File Syntax filenam...

Страница 250: ...ual then the statements between this directive and the first matching ELSEC or ENDC directive are assembled and the remainder of the block is skipped Otherwise the statements associated with the IFC d...

Страница 251: ...zero LT Expression is less than zero value Specifies the control value for the assembly block It is an absolute expression that cannot contain any forward external or undefined references Each IFcc di...

Страница 252: ...y block If the specified symbol symbol is defined when the directive is encountered then the statements between this directive and the first matching elifdef else or endif directive are assembled and...

Страница 253: ...ot equal then the statements between this directive and the first matching ELSEC or ENDC directive are assembled and the remainder of the block is skipped Otherwise the statements associated with the...

Страница 254: ...y block If the specified symbol symbol is not defined when the directive is encountered then the statements between this directive and the first matching elifdef else or endif directive are assembled...

Страница 255: ...ective inserts the contents of the specified file at the current position in the assembler source If the file is not specified with a full path it is searched for in or relative to the following direc...

Страница 256: ...te expression that cannot contain any forward external or undefined references The LCOMM directive defines the specified symbol symbol and associates with it a block of uninitialized data in the BSS t...

Страница 257: ...INE directive sets the line number attribute of the symbol referenced by the current attribute block see def DEF directive For a detailed description of this attribute see section 1 4 9 Auxiliary Tabl...

Страница 258: ...assembly listing after it has been disabled with the NOL or NOLIST directive Pairs of NOLIST and LIST directives can be nested LLEN Set Line Length of Listing File Syntax LLEN length Description leng...

Страница 259: ...efined references The ln LN directive creates a line number entry for purposes of source level debugging This entry associates the current section s location counter with a line in the associated C so...

Страница 260: ...he current section A warning is issued if the alignment is odd For additional information see section 3 3 6 2 Character Constants Examples long abcd 61626364 long 16777215 0xFFFFFF 00FFFFFF 00FFFFFF l...

Страница 261: ...of the assembly to be omitted from the listing file The listing is resumed with the LIST directive Pairs of NOLIST and LIST directives can be nested NOOBJ Suppress Object Code Generation Syntax NOOBJ...

Страница 262: ...ructure field references These labels are not included in the object file s symbol table Since structure template sections are dummy sections they cannot contain any object code Also they cannot be ne...

Страница 263: ...ter case sensitivity in symbol names see section 3 3 5 1 Symbol Syntax Default CASE CEX NOCEX Enable disable full listing of data directive assembly The CEX option allows the object code associated wi...

Страница 264: ...uction Optimization Default IOPT ISIZE size Set the default instruction size see section 3 4 2 Instruction Sizing The following are the legal sizes B Byte Integer W Word Integer L Long word Integer De...

Страница 265: ...bles the PCB16 option The PCB32 option is not legal on the 68000 10 Default PCB16 PCF Enable coercion to PC relative addressing modes for forward references references to locations positioned at an un...

Страница 266: ...erence 16 bit L Absolute long reference 32 bit address Specifies the base address of the section It is an absolute expression that cannot contain any forward external or undefined references The ORG d...

Страница 267: ...the current file It must appear in the label field of the statement register Specifies a data address or floating point register Hyphen separated ranges must be specified in ascending order The REG d...

Страница 268: ...orward external or undefined references The REORG directive resets the location counter in an absolute section The continuation address address must be greater than the current value of the section s...

Страница 269: ...ences The scl SCL directive sets the storage class attribute of the symbol referenced by the current attribute block see def DEF directive For a list of recognized storage classes see section 1 4 8 2...

Страница 270: ...at cannot contain any forward external or undefined references The SECTION directive begins a data type section with name name If address is specified the section is absolute and begins at that addres...

Страница 271: ...ies the value of the symbol It is an absolute or simple relocatable expression that cannot contain any forward external or undefined references The SET directive defines the symbol symbol and assigns...

Страница 272: ...rective generates word integer data The values of the specified operands are placed in successive words beginning at the current location in the current section A warning is issued if the alignment is...

Страница 273: ...e size attribute of the symbol referenced by the current attribute block see def DEF directive The size attribute is specified for aggregate types see section 1 4 9 Auxiliary Table Entries This direct...

Страница 274: ...er 4 bytes s Single precision Real not supported d Double precision Real not supported x Extended precision Real not supported p Packed Decimal Real not supported count Specifies the unit count It is...

Страница 275: ...C Generate Blank Lines in Listing File Syntax SPC count Description count Specifies the number of blank lines It is an absolute expression that cannot contain any forward external or undefined referen...

Страница 276: ...liary Table Entries This directive can appear at most once per symbol attribute block The tag TAG directive is typically used only for C source level debugging it is ignored when assembler source leve...

Страница 277: ...ssion that cannot contain any forward external or undefined references The tsection TSECTION directive begins a text type section with name name If address is specified the section is absolute and beg...

Страница 278: ...It is an ASCII string that can be optionally enclosed in double quotes The TTL directive sets the title that appears in the header of each page of the listing file This directive stays in effect until...

Страница 279: ...attribute block see def DEF directive For a discussion of fundamental and derived types see section 1 4 8 7 Type Entry This directive can appear at most once per symbol attribute block The type TYPE d...

Страница 280: ...symbol referenced by the current attribute block see def DEF directive The meaning of the value attribute is dependent upon the selected storage class see section 1 4 8 4 Symbol Value Field This dire...

Страница 281: ...tional information refer to section 3 3 6 2 Character Constants Examples word ab 6162 word 1111111111 01777 1023 03FF 03FF 03FF word 1024 16 4000 Each of the above examples is shown with the sequence...

Страница 282: ...symbol that is referenced but not defined in the current file Section names and floating point symbols are not allowed The XREF directive declares the scope of the symbol symbol to be external This is...

Страница 283: ...nces generated by a single macro Using macros simplifies programming since changes can be isolated to a single location Also assembly programs written using macros are more concise and easier to under...

Страница 284: ...ption label Specifies an optional label macro Specifies the name of the macro It must have been previously defined with the MACRO directive qualifier Specifies a size qualifier that is passed to the m...

Страница 285: ...meters of a macro are the parameters that are referenced in the macro s definition They are denoted by a backslash followed by a digit or alphabetical character either lowercase or uppercase The forma...

Страница 286: ...macro if the macro will be used more than once in a file otherwise multiple invocations of the macro will produce multiple definitions of the label Labels local to a macro can be generated by using th...

Страница 287: ...modified to accept any number of statements including invocations of other macros Following the macro definition is an example invocation and the assembler statements it generates REP MACRO IFEQ 2 ME...

Страница 288: ...presents a macro that can be used to perform copying of strings and arbitrary memory ranges Its parameters include the source and destination addresses the type of copy to be performed and the number...

Страница 289: ...0 A1 A0 3 ENDC IFC 3 STRING COPY BNE L ELSEC DBF D0 L ENDC ENDM COUNT MACRO IFC 2 B 3 1 1 4 ELSEC IFC 2 L 3 1 2 1 4 ELSEC 3 1 1 1 4 ENDC ENDC ENDM OPT MEX COPY B MESG1 MESG2 STRING COPY 3 4 LEA MESG1...

Страница 290: ...rol expressions are used to specify the flow of execution for certain structured control macros These expressions are translated into one or more CMP BRA and Bcc instructions to provide the necessary...

Страница 291: ...perands If necessary the operands of this instruction will be exchanged to produce a legal instruction in this case the corresponding conditional test will also be reversed The operands will be exchan...

Страница 292: ...not reserved they are AND BY DO DOWNTO OR THEN and TO These keywords are required syntax for macro invocations but can be used elsewhere as ordinary symbols As with user defined macros invocations of...

Страница 293: ...urrent default forward branch size see OPT BRB BRS BRW directive B 8 bit forward branch S 8 bit forward branch W 16 bit forward branch The BREAK macro is analogous to the break statement in C i e it t...

Страница 294: ...forward branch size see OPT BRB BRS BRW directive B 8 bit forward branch S 8 bit forward branch W 16 bit forward branch The CONTINUE macro is analogous to the continue statement in C i e it proceeds t...

Страница 295: ...be an alterable effective address expression see section 3 5 Effective Addressing Modes op2 Specifies the initial value of the loop counter It can be any effective address expression op3 Specifies the...

Страница 296: ...est which is situated at the end of the loop a conditional backward branch is used to jump to the beginning of the loop to perform the next iteration The initial jump to the termination test will be o...

Страница 297: ...Specifies the size qualifier for the structured control expression The legal values are shown below if omitted the size is determined according to the rules discussed in section 3 4 2 Instruction Siz...

Страница 298: ...assembler statement The IF ELSE ENDI macro is analogous to the if else construct in C If the specified expression is true the set of statements following the THEN keyword is executed otherwise the set...

Страница 299: ...tion 3 8 2 1 Structured Control Expressions The REPEAT UNTIL macro generates a loop that executes until the specified condition becomes true The termination test is performed at the end of the loop th...

Страница 300: ...re shown below if omitted the size is determined by the current default forward branch size see OPT BRB BRS BRW directive B 8 bit forward branch S 8 bit forward branch W 16 bit forward branch statemen...

Страница 301: ...mmary The instructions for the 68000 family of microprocessors and coprocessors are listed alphabetically in Table 3 32 However only the 68000 instruction set is supported by Texas Instruments Use of...

Страница 302: ...A W L L W ADDI B W L L W ADDQ B W L L W ADDX B W L L W AND B W L L W ANDI B W L L W ANDI to CCR B B B ANDI to SR W W W ASL B W L L W ASR B W L L W Bcc B W L W W BCHG B L B L B L BCLR B L B L B L BFCHG...

Страница 303: ...CMPM B W L L W cpBcc W L W W cpDBcc W W W cpGEN cpRESTORE cpSAVE cpScc B B B cpTRAPcc W L W W CPUSH DBcc W W W DIVS W L L W DIVSL L L L DIVU W L L W DIVUL L L L EOR B W L L W EORI B W L L W EORI to CC...

Страница 304: ...S D X P X W FDNEG B W L S D X P X W FDSQRT B W L S D X P X W FDSUB B W L S D X P X W FETOX B W L S D X P X W FETOXM1 B W L S D X P X W FGETEXP B W L S D X P X W FGETMAN B W L S D X P X W FINT B W L S...

Страница 305: ...W L S D X P X W FSMOVE B W L S D X P X W FSMUL B W L S D X P X W FSNEG B W L S D X P X W FSQRT B W L S D X P X W FSSQRT B W L S D X P X W FSSUB B W L S D X P X W FSUB B W L S D X P X W FTAN B W L S D...

Страница 306: ...C L L L MOVEM W L L W MOVEP W L L W MOVEQ L L L MOVES B W L L W MULS W L L W MULU W L L W NBCD B B B NEG B W L L W NEGX B W L L W NOP NOT B W L L W OR B W L L W ORI B W L L W ORI to CCR B B B ORI to S...

Страница 307: ...L L W RTD RTE RTM RTR RTS SBCD B B B Scc B B B STOP SUB B W L L W SUBA W L L W SUBI B W L L W SUBQ B W L L W SUBX B W L L W SWAP W W W TAS B B B TBLS B W L L W TBLSN B W L L W TBLU B W L L W TBLUN B...

Страница 308: ...296 Section 3 Assembler TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 309: ...01 Section 4 Linker 4 Linker 299 4 1 Introduction 299 4 2 Link68 Inputs and Outputs 299 4 3 Options 300 4 3 1 Library Search Options 300 4 3 2 Option Flags 300 4 4 Object Files 302 4 4 1 Sections 302...

Страница 310: ...298 Section 4 Linker TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 311: ...each section in the file to an output section of the same name Otherwise if the file is a library the linker searches the symbol table of the library file to determine if any undefined symbols may be...

Страница 312: ...l flag is not required to specify a library file the full pathname of the library can also be specified The L flag adds a directory to the linker s library search path used with the l flag The directo...

Страница 313: ...linkage pass is required unlikely a message is generated indicating that the additional pass is necessary The H flag must be used on the second hole compression linker pass and on any subsequent passe...

Страница 314: ...ss in a relocatable section it is called relocatable because its value changes as the linker relocates its section If a symbol refers to a numeric constant or an address in an absolute section it is c...

Страница 315: ...erage of four to seven percent The actual size decrease speed increase depends on a number of factors such as the placement of the various output sections and the number of external references in thos...

Страница 316: ...to compress a hole will not be legal for the effective address field of a given instruction If the addressing mode required to compress a hole is legal though the assembler will shrink the hole to 16...

Страница 317: ...s reserve several symbols to locate the memory heap The symbols heap_org and heap_len and the memory routines that use them such as malloc are not supported by Texas Instruments However they are still...

Страница 318: ...306 Section 4 Linker TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 319: ...I 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001 Section 5 Utilities 5 Utilities 309 5 1 Symbol Table Name Utility 309 5 2 Object File Size Utility...

Страница 320: ...308 Section 5 Utilities TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 321: ...ut an extension is specified the extension out is assumed if the file cannot first be found without the extension By default the output from nm68 contains detailed information about each symbol includ...

Страница 322: ...g table in parentheses The optional a out header listing includes a magic number a version number an execution entry point and the sizes and addresses of the text data and bss sections Each section he...

Страница 323: ...text symbol global U undefined symbol T Do not truncate symbol names and type information to fit in the column space provided If a name or type overflows the allotted space the columns to the right of...

Страница 324: ...SIZE 000048 0018ac FLAGS 0120 LINE_ENTRIES 0 001932 RELOC_ENTRIES 0 000000 data ADDRESS p 006824 v 006824 SIZE 000008 0018f4 FLAGS 0140 LINE_ENTRIES 0 001932 RELOC_ENTRIES 0 000000 bss ADDRESS p 0068...

Страница 325: ...ments and prints size and address information on each file and its sections The object files obj_files specified on the command line can be either relocatable or absolute COFF object files If no file...

Страница 326: ...314 Section 5 Utilities TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Страница 327: ...scii 169 bb 19 20 24 31 bf 18 19 21 24 31 bin 170 216 bsection 171 217 bss 10 19 24 26 140 144 171 173 188 218 220 byte 172 218 cmnt 172 219 comm 173 220 const 10 87 data 10 19 24 140 173 221 def 174...

Страница 328: ...2 __du16u16 82 __du32u32 82 __FILE__ 101 __FLOAT__ 101 __INT__ 101 __LINE__ 101 __line_ck 48 __ms16u16 82 __ms32s32 82 __mu16u16 82 __mu32u32 82 __PCREL__ 101 __SIERRA__ 101 __stk_ck 50 __TIME__ 101 _...

Страница 329: ...bugging 134 168 174 182 190 214 224 235 237 247 transcript file 135 warning generation 135 assembler macro 271 definition 271 examples 275 277 invocation 272 line continuation 274 local label 274 MEXI...

Страница 330: ...unctions 83 internal integer functions 82 invocation 41 42 optimizations 44 68 register allocation 90 register usage 81 reserved keywords 53 source level debugging 47 49 50 static storage initializati...

Страница 331: ...150 simple relocatable 150 F FAIL 235 FEQU 235 file header 11 flags 12 file_fmt txt 10 fill value 183 192 252 See also section fill value floating point arithmetic See also compiler internal floating...

Страница 332: ...6 LLEN 246 LN 247 long int 54 59 72 78 M macro 96 271 See assembler macro See preprocessor See structured control macro magic number 11 12 MASK2 248 MEXIT 274 N NARG 274 nm68 See symbol table name uti...

Страница 333: ...88 DOWNTO 280 283 OR 278 280 overview 278 reference 280 structured control expression 278 THEN 280 285 TO 280 283 suppressed register 158 163 symbol 141 302 See also assembly language comm 144 173 220...

Страница 334: ...28 30 fundamental 28 30 T TAG 264 TI BCD floating point 5 54 60 61 72 78 83 148 166 176 184 212 226 236 trigraph sequences 100 TSECTION 265 tst See _touch TTL 266 TYPE 267 U unsigned 54 59 65 UNTIL 2...

Отзывы: