4161|1

2498

帖子

0

TA的资源

至上芯片

楼主
 

永远的经典:helloworld! [复制链接]

/*hello.h*/

/*

*
Copyright 2002 by Texas Instruments Incorporated.


*
All rights reserved. Property of Texas Instruments Incorporated.


*
Restricted rights to use, duplicate or disclose this code are


*
granted through contract.


*


*/

/* "@(#) DSP/BIOS 4.80.208 12-06-02 (barracuda-l19)" */
struct PARMS {

int Beta;


int EchoPower;


int ErrorPower;


int Ratio;


struct PARMS *Link;

};


/*

*
Copyright 2002 by Texas Instruments Incorporated.


*
All rights reserved. Property of Texas Instruments Incorporated.


*
Restricted rights to use, duplicate or disclose this code are


*
granted through contract.


*


*/

/* "@(#) DSP/BIOS 4.80.208 12-06-02 (barracuda-l19)" */
/***************************************************************************/
/*

*/

/*
H E L L O . C
*/

/*
*/

/*
Basic C standard I/O from main.
*/

/*
*/

/*
*/

/***************************************************************************/

#include
#include "hello.h"

#define BUFSIZE 30

struct PARMS str =
{

2934,


9432,


213,


9432,


&str

};

/*hello.c*/

/*

*
======== main ========


*/

void main()
{
#ifdef FILEIO

int
i;



char
scanStr[BUFSIZE];


char
fileStr[BUFSIZE];


size_t
readSize;


FILE
*fptr;

#endif


/* write a string to stdout */


puts("hello world!\n");


#ifdef FILEIO

/* clear char arrays */


for (i = 0; i < BUFSIZE; i++) {


scanStr = 0 ;
/* deliberate syntax error */


fileStr = 0;


}

   

/* read a string from stdin */


scanf("%s", scanStr);

   

/* open a file on the host and write char array */


fptr = fopen("file.txt", "w");



fprintf(fptr, "%s", scanStr);


fclose(fptr);

                     

/* open a file on the host and read char array */


fptr = fopen("file.txt", "r");


fseek(fptr, 0L, SEEK_SET);


readSize = fread(fileStr, sizeof(char), BUFSIZE, fptr);


printf("Read a %d byte char array: %s \n", readSize, fileStr);


fclose(fptr);

#endif

}



;
;
Copyright 2002 by Texas Instruments Incorporated.

;
All rights reserved. Property of Texas Instruments Incorporated.

;
Restricted rights to use, duplicate or disclose this code are

;
granted through contract.

;
file name: vectors.asm

;
; "@(#) DSP/BIOS 4.80.208 12-06-02 (barracuda-l19)"
;*
;*
Copyright 2001 by Texas Instruments Incorporated.

;*
All rights reserved. Property of Texas Instruments Incorporated.

;*
Restricted rights to use, duplicate or disclose this code are

;*
granted through contract.

;*


.ref
_c_int00


.sect ".vectors"

RESET:
.long
_c_int00




/*************************************************

file name hello.cmd


map for new eZDSP 2812



Lori Heustess


DCS Product Applications
30 July 2001



M0/M1 Generic Linker Command File



For C28x K1 this file assumes M0M1MAP = 1

**************************************************/

MEMORY
{
PAGE 0 : PROG
: origin = 0x3f8000, length = 0x0023fff


RESET
: origin = 0x0, length = 0x3f


PAGE 1 :


DATA
: origin = 0x008000, length = 0x001fff

}

SECTIONS
{

.reset
: load = RESET, PAGE = 0


.text
: load = PROG, PAGE = 0


.cinit
: load = PROG, PAGE = 0


.vectors
: load = PROG, PAGE = 0


.stack
: load = DATA, PAGE = 1


.data
: load = DATA, PAGE = 1


.ebss
: load = DATA, PAGE = 1


.bss
: load = DATA, PAGE = 1


.econst
: load = DATA, PAGE = 1


.const
: load = DATA, PAGE = 1


.cio
: load = DATA, PAGE = 1

}

作者都有注释。是DSP 入门的程序。

hello world!.doc

36.5 KB, 下载次数: 27

最新回复

支持!  详情 回复 发表于 2009-10-19 20:32
 
点赞 关注
个人签名我的邮箱gaoxiaoan123@163.com!回帖是一种美德!互相帮助,共同进步!
口头禅:生活在于创造机会,把握机会!

回复
举报

7

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
支持!

赞赏

1

查看全部赞赏

 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表