background image

162

Section 3: Assembler

TI

-

89 / TI

-

92 Plus Sierra C Assembler Reference Manual

Not for Distribution

Beta Version February 2, 2001

Size

Option (asm68)

Option (asm68k)

word

a16

FRS

long

a32

FRL

† The displacement size is word if either the current section or the section

in which the displacement is defined has the .S qualifier; the size is also
word if the displacement is a symbol defined with the COMM.S or
LCOMM.S directive, or declared external with the XREF.S directive.

Table 3.14: Unknown Absolute Displacement Sizing

Size

Option (asm68)

Option (asm68k)

byte

fr8

BRB / BRS

word

fr16

BRW

Table 3.15: Unknown PC-Relative Displacement Sizing

The options described above are overridden when either hole compression
permits the use of a word displacement or the old-style displacement syntax is
used. If a base and index register are used with the old-style syntax, the
displacement 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 address consists of one or more of the following (see
Table 3.11 for addressing modes supported by Texas Instruments):

• 

Base displacement (minimally sized).

• 

Outer displacement (minimally sized).

• 

Base register (possibly PC resulting from coercion).

• 

Index register.

If the address consists of a base displacement with no memory indirection, then
the absolute short or absolute long addressing mode is selected depending on
the size of the displacement.

If the address consists of a byte displacement, a base register, an index register,
and no memory indirection, then the (d8,An,Xn) or (d8,PC,Xn) mode is selected.
When assembling for the 68000, the displacement can be omitted provided that
the .opt iopt / OPT IOPT directive is in effect (default).

If the address consists of a byte or word displacement, a base register, and no
memory indirection, then the (d16,An) or (d16,PC) mode is selected. The

Summary of Contents for TI-89 Plus

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 12: ...x Table of Contents TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 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...

Page 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...

Page 16: ...4 Section 1 General Information TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 140: ...128 Section 3 Assembler TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 308: ...296 Section 3 Assembler TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 310: ...298 Section 4 Linker TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 318: ...306 Section 4 Linker TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 320: ...308 Section 5 Utilities TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 326: ...314 Section 5 Utilities TI 89 TI 92 Plus Sierra C Assembler Reference Manual Not for Distribution Beta Version February 2 2001...

Page 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...

Page 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 _...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Page 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...

Reviews: