General Notice When using this document, keep the following in mind: nti 1. This document is confidential. By accepting this document you acknowledge that you are bound al by the terms set forth in the non-disclosure and confidentiality agreement signed separately and /in the possession of SEGA. If you have not signed such a non-disclosure agreement, please contact SEGA immediately and return this document to SEGA. 2. This document may include technical inaccuracies or typographical errors. Changes are periodi- cally made to the information herein; these changes will be incorporated in new versions of the document. SEGA may make improvements and/or changes in the product(s) and/or the program(s) described in this document at any time. de 3. No one is permitted to reproduce or duplicate, in any form, the whole or part of this document without SEGA’S written permission. Request for copies of this document and for technical information about SEGA products must be made to your authorized SEGA Technical Services representative. party. nfi 4. No license is granted by implication or otherwise under any patents, copyrights, trademarks, or other intellectual property rights of SEGA Enterprises, Ltd., SEGA of America, Inc., or any third 5. Software, circuitry, and other examples described herein are meant merely to indicate the character- describe herein. Co istics and performance of SEGA’s products. SEGA assumes no responsibility for any intellectual property claims or other problems that may result from applications based on the examples 6. It is possible that this document may contain reference to, or information about, SEGA products (development hardware/software) or services that are not provided in countries other than Japan. Such references/information must not be construed to mean that SEGA intends to provide such SEGA products or services in countries other than Japan. Any reference of a SEGA licensed prod- uct/program in this document is not intended to state or simply that you can use only SEGA’s GA licensed products/programs. Any functionally equivalent hardware/software can be used instead. 7. SEGA will not be held responsible for any damage to the user that may result from accidents or any other reasons during operation of the user’s equipment, or programs according to this document. NOTE: A reader's comment/correction form is provided with this document. Please address comments to : SE SEGA of America, Inc., Developer Technical Support (att. Evelyn Merritt) 150 Shoreline Drive, Redwood City, CA 94065 SEGA may use or distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you. (11/2/94- 002) TM ntial de nfi Co GA SCU DSP Assembler User's Manual SE Doc. # ST-240-A-042795 © 1995 SEGA. All Rights Reserved. READER CORRECTION/COMMENT SHEET Keep us updated! nti If you should come across any incorrect or outdated information while reading through the attached document, or come up with any questions or comments, please let us know so that we can make the al required changes in subsequent revisions. Simply fill out all information below and return this form to the Developer Technical Support Manager at the address below. Please make more copies of this form if more space is needed. Thank you. General Information: Your Name Phone Document number Document name Corrections: Chpt. pg. # ST-240-A-042795 SCU DSP Assembler User's Manual Correction de Date nfi Co GA Questions/comments: SE Fax: Where to send your corrections: (415) 802-1717 Attn: Evelyn Merritt, Developer Technical Support Mail: SEGA OF AMERICA Attn: Evelyn Merritt, Developer Technical Support 150 Shoreline Dr. Redwood City, CA 94065 1. Overview The SCU DSP assembler is designed to develop DSP instruction code and to simulate 2. Running the Assembler nti their execution under MS-DOS and UNIX environments. Linking of code is not re- quired since the assembler outputs code in Motorola S format. The DSP assembler requires a substantial knowledge of the hardware; therefore, the user is advised to al have a thorough understanding of the DSP hardware prior to use. dspasm [option] terminates execution without errors.) de 1) The following options are available (files can be created only after the program -l[Filename]: -a[Filename]: -c[Filename]: -m: Output list Output data in SH assembler format Output data in C format To use the MODEL M development target nfi 2) There are no default file extensions set for source filenames. 3) Only the errors detected in the initial search are displayed. Correct the errors and assemble the code repeatedly until all errors are eliminated. Ex: Co 3. How to Write a Program [label] [∆operation [∆operand]] ... [comment(s)] 1) Labels LABEL: MOV MC0, X ; comment(s) • Defined by the programmer, and used as the destination address for the JMP instruction. GA • When writing labels, begin from the first column, or use a colon “:” at the end of the word (ex. LABEL: ). • Labels can be as long as 32 characters in length, and upper or lower case English letters, numbers, and underscores(_) may be used. Numbers may not be used as the first character. Also, the labels are not case- sensitive. 2) Operations • Write the DSP execution instructions. • When writing code that begins with an operation, enter a blank space before the SE operation. • As many as six operand instructions can be listed under one operation (appli- cable to operand instructions only). 3) Operands • List operands required for the execution of operations. • Insert a space between operands. SCU DSP Assembler User's Manual 1 4) Comments • Comments can be written to make the program easier to understand. • Start comments with a semi-colon “;” and end the comment at the end of the line. *Note on writing: • ntial The basic rule is to write the operation and operand on one line; however, when this is not possible, enter “\” before pressing Return to continue on to the next line. To follow an operation after a comment, enter “\” before “;”. Also, do not exceed 255 characters per line. • Operations and operands are not case sensitive; use either upper or lower case English letters. • Specify $xx for hexadecimal, xxx for decimal, and %xxxxxxxx for binary. • • de Output code addresses can be specified by the ORG directive. Although the program area in DSP only has a maximum capacity of 256 instructions, it can issue a “warning” and output code containing up to 2048 instructions to facili- tate tasks such as the splitting of processes or optimization. However, only the SCU DSP Simulator can support this code. Therefore, it is necessary to edit the code down to its 256 instruction limit during assembly, if the code is actually used in the DSP. • not possible with 8-bit values. nfi Also, note that if the number of address labels exceeds 256 instructions, assignment is * Note on reserved words: The following names are reserved for operands and may not be used for labels. {ALH ALL ALU M0 M1 M2 M3 MC0 MC1 MC2 MC3 MUL} * Note on numeric operations: • Co The following operators can be used when setting values on labels, or when using numerical values for operands (When the following are used as operands, do not enter any spaces. Ex. JMP $+2 is correctly written, while JMP $ + 2 is incorrect.) Operators Operator Priority + addition 1. + – ~ (monadic operator) GA – subtraction 2. * / % * multiplication 3. + – / division 4. << >> % remainder 5. & ~ bit negation 6. | ^ & bit product | bit sum ^ exclusive bit sum SE << >> left shift right shift 2 4. Summary of Instructions 1) Operation instructions: 2) “Load immediate” instruction: nti NOP AND OR XOR ADD SUB AD2 SR RR SL RL RL8 CLR MOV MVI 3) DMA instructions: DMA DMAH al 4) JUMP instruction: JMP 5) LOOP BOTTOM instructions: BTM LPS 6) END instructions: END ENDI de Directive summary: EQU(=) ORG ENDS nfi Defines labels. Specifies starting address where instructions are located. Enter at the end of the program, anything beyond this point is IFDEF