TMS320C5x DSP STARTER KIT USER'S GUIDE

TMS320C5x DSP STARTER KIT USER'S GUIDE TMS320C5x DSP STARTER KIT USER'S GUIDE

13.07.2015 Views

.copy/.includeDirectives ReferenceListing file:00001 –––– 0e00 .ds 0e00h ;filename:source.asm00002 –––– –––– ;filename:source.asm00003 0e00 0010 .space 10h ;filename:source.asm00004 –––– –––– .include ”byte.asm” ;filename:source.asm******************************************** OPENING INCLUDE FILE byte.asm*******************************************00001 –––– –––– ;filename:byte.asm00002 0e01 0061 .byte ”a”,0ah,32 ;filename:byte.asm0e02 000a0e03 002000003 –––– –––– .include ”word.asm” ;filename:byte.asm******************************************** OPENING INCLUDE FILE word.asm*******************************************00001 –––– –––– ;filename:word.asm00002 0e04 abcd .word 0abcdh,56 ;filename:word.asm0e05 003800003 –––– –––– ;filename:word.asm>>>>> FINISHED READING ALL FILES******************************************** CLOSING FILE word.asm*******************************************00004 0e06 000b .byte 11,12,13 ;filename:byte.asm0e07 000c0e08 000d******************************************** CLOSING FILE byte.asm*******************************************00005 –––– –––– ;filename:source.asm00006 0e09 0020 .space 20h ;filename:source.asm>>>>> FINISHED READING ALL FILES>>>>> ASSEMBLY COMPLETE: ERRORS:0 WARNINGS:05-14

Directives Reference.data/.dsSyntax.data.ds [address]DescriptionThe .data and .ds directives tell the assembler to begin assembling source codeinto data memory. The .data and .ds sections are normally used to contain tablesof data or preinitialized variables.address is an optional parameter that specifies a 16-bit address. Normally, thesection program counter is set to 0 the first time the .data or .ds section isassembled; you can use this parameter to assign an initial value to the SPC.Note that the assembler assumes that .text is the default section. Therefore,at the beginning of an assembly, the assembler assembles code into the .textsection unless you specify a section control directive.ExampleThis example shows the assembly of code into the .data and .text sections..ps 0a00h ;set up load and run addresses.entry.include ”VECT.ASM”.ds 0400h.textsetup: mar *,AR0 ;initialize the CPU registerslar AR0,#0lar AR1,#0lar AR2,#0lar AR3,#0val_1:.data.int 0,1,2,3,4,5,6,7 ;init. integer values.textloop: mar *+,AR1mar *+,AR2mar *+,AR3b loop,*+,AR0;continue with some codeval_2:.data.float 0,1,2,3,4,5,6,7 ;init. flt–pt valuesAssembler Directives5-15

Directives Reference.data/.dsSyntax.data.ds [address]DescriptionThe .data and .ds directives tell the assembler to begin assembling source codeinto data memory. The .data and .ds sections are normally used to contain tablesof data or preinitialized variables.address is an optional parameter that specifies a 16-bit address. Normally, thesection program counter is set to 0 the first time the .data or .ds section isassembled; you can use this parameter to assign an initial value to the SPC.Note that the assembler assumes that .text is the default section. Therefore,at the beginning of an assembly, the assembler assembles code into the .textsection unless you specify a section control directive.ExampleThis example shows the assembly of code into the .data and .text sections..ps 0a00h ;set up load and run addresses.entry.include ”VECT.ASM”.ds 0400h.textsetup: mar *,AR0 ;initialize the CPU registerslar AR0,#0lar AR1,#0lar AR2,#0lar AR3,#0val_1:.data.int 0,1,2,3,4,5,6,7 ;init. integer values.textloop: mar *+,AR1mar *+,AR2mar *+,AR3b loop,*+,AR0;continue with some codeval_2:.data.float 0,1,2,3,4,5,6,7 ;init. flt–pt valuesAssembler Directives5-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!