⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 project.s

📁 AVRkaifashili.rar
💻 S
📖 第 1 页 / 共 5 页
字号:
	.module project.c
	.area lit(rom, con, rel)
_QFDZ::
	.byte 16,16
	.byte 23,21
	.byte 149,'u
	.byte 'W,16
	.byte 16,19
	.byte 48,208
	.byte 'W,16
	.byte 16,0
	.byte 0,0
	.byte 254,32
	.byte 36,34
	.byte 252,0
	.byte 0,248
	.byte 2,1
	.byte 254,0
	.byte 0,0
	.byte 16,16
	.byte 16,16
	.byte 16,16
	.byte 159,'R
	.byte 50,18
	.byte 18,19
	.byte 16,16
	.byte 16,0
	.byte 2,2
	.byte 4,8
	.byte 48,192
	.byte 0,0
	.byte 4,2
	.byte 2,252
	.byte 0,0
	.byte 0,0
	.byte 0,'D
	.byte 'N,'T
	.byte 'd,'G
	.byte 'T,'N
	.byte 'D,0
	.byte 31,0
	.byte 0,255
	.byte 0,0
	.byte 0,'B
	.byte 'C,'B
	.byte 'D,252
	.byte 'D,'H
	.byte 'H,0
	.byte 240,2
	.byte 1,254
	.byte 0,0
	.byte 8,10
	.byte 'I,56
	.byte 8,15
	.byte 8,0
	.byte 0,0
	.byte 255,8
	.byte 8,8
	.byte 8,0
	.byte 8,8
	.byte 208,48
	.byte 208,16
	.byte 0,254
	.byte 132,132
	.byte 132,132
	.byte 132,254
	.byte 0,0
	.dbfile H:\Project\Project/zimo.h
	.dbsym e QFDZ _QFDZ A[128:4:32]kc
_DL::
	.byte 0,'D
	.byte 'N,'T
	.byte 'd,'G
	.byte 'T,'N
	.byte 'D,0
	.byte 31,0
	.byte 0,255
	.byte 0,0
	.byte 0,'B
	.byte 'C,'B
	.byte 'D,252
	.byte 'D,'H
	.byte 'H,0
	.byte 240,2
	.byte 1,254
	.byte 0,0
	.byte 0,64
	.byte 64,64
	.byte 64,64
	.byte 64,'O
	.byte 'H,'P
	.byte 'P,96
	.byte 96,64
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,2
	.byte 1,254
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.dbsym e DL _DL A[64:2:32]kc
_State1::
	.byte 8,16
	.byte 32,203
	.byte 'j,'Z
	.byte 'J,'Z
	.byte 47,202
	.byte 'j,'Z
	.byte 'N,64
	.byte 64,0
	.byte 0,4
	.byte 4,196
	.byte 'H,'H
	.byte 'P,96
	.byte 255,64
	.byte 64,'H
	.byte 'D,'x
	.byte 0,0
	.byte 0,8
	.byte 8,31
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,4
	.byte 4,252
	.byte 4,4
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 8,10
	.byte 'I,56
	.byte 8,15
	.byte 8,0
	.byte 0,0
	.byte 255,8
	.byte 8,8
	.byte 8,0
	.byte 8,8
	.byte 208,48
	.byte 208,16
	.byte 0,254
	.byte 132,132
	.byte 132,132
	.byte 132,254
	.byte 0,0
	.dbsym e State1 _State1 A[96:3:32]kc
_State2::
	.byte 8,16
	.byte 32,203
	.byte 'j,'Z
	.byte 'J,'Z
	.byte 47,202
	.byte 'j,'Z
	.byte 'N,64
	.byte 64,0
	.byte 0,4
	.byte 4,196
	.byte 'H,'H
	.byte 'P,96
	.byte 255,64
	.byte 64,'H
	.byte 'D,'x
	.byte 0,0
	.byte 0,14
	.byte 16,16
	.byte 16,17
	.byte 14,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,12
	.byte 20,36
	.byte 'D,132
	.byte 12,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 8,10
	.byte 'I,56
	.byte 8,15
	.byte 8,0
	.byte 0,0
	.byte 255,8
	.byte 8,8
	.byte 8,0
	.byte 8,8
	.byte 208,48
	.byte 208,16
	.byte 0,254
	.byte 132,132
	.byte 132,132
	.byte 132,254
	.byte 0,0
	.dbsym e State2 _State2 A[96:3:32]kc
_State3::
	.byte 8,16
	.byte 32,203
	.byte 'j,'Z
	.byte 'J,'Z
	.byte 47,202
	.byte 'j,'Z
	.byte 'N,64
	.byte 64,0
	.byte 0,4
	.byte 4,196
	.byte 'H,'H
	.byte 'P,96
	.byte 255,64
	.byte 64,'H
	.byte 'D,'x
	.byte 0,0
	.byte 0,12
	.byte 16,17
	.byte 17,18
	.byte 12,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,24
	.byte 4,4
	.byte 4,136
	.byte 'p,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 0,0
	.byte 8,10
	.byte 'I,56
	.byte 8,15
	.byte 8,0
	.byte 0,0
	.byte 255,8
	.byte 8,8
	.byte 8,0
	.byte 8,8
	.byte 208,48
	.byte 208,16
	.byte 0,254
	.byte 132,132
	.byte 132,132
	.byte 132,254
	.byte 0,0
	.dbsym e State3 _State3 A[96:3:32]kc
	.area data(ram, con, rel)
	.dbfile H:\Project\Project/zimo.h
_EOM_Flag::
	.blkb 1
	.area idata
	.byte 1
	.area data(ram, con, rel)
	.dbfile H:\Project\Project/zimo.h
	.dbfile H:\Project\Project\project.c
	.dbsym e EOM_Flag _EOM_Flag c
_State::
	.blkb 1
	.area idata
	.byte 1
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbsym e State _State c
_Speed::
	.blkb 1
	.area idata
	.byte 20
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbsym e Speed _Speed c
_Snd_Info::
	.blkb 2
	.area idata
	.byte 0,17
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbsym e Snd_Info _Snd_Info A[2:2]c
_Snd_Pre_Info::
	.blkb 2
	.area idata
	.byte 18,0
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.blkb 1
	.area idata
	.byte 19
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbsym e Snd_Pre_Info _Snd_Pre_Info A[3:3]c
_Snd_Spec::
	.blkb 2
	.area idata
	.byte 21,22
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbsym e Snd_Spec _Snd_Spec A[2:2]c
_Snd_Welc::
	.blkb 1
	.area idata
	.byte 20
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbsym e Snd_Welc _Snd_Welc c
	.area vector(rom, abs)
	.org 2
	rjmp _Key_Scan
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.area vector(rom, abs)
	.org 4
	rjmp _Receive_EOM
	.area data(ram, con, rel)
	.dbfile H:\Project\Project\project.c
	.area text(rom, con, rel)
	.dbfile H:\Project\Project\project.c
	.dbfunc e delay _delay fV
;              t -> R16,R17
	.even
_delay::
	.dbline -1
	.dbline 47
L2:
	.dbline 47
L3:
	.dbline 47
; //***************************FileName:Project.c**********************//
; //***************************ICCAVR6.30编译**************************//
; #include <io8535v.h>	     //AT90S8535寄存器定义;
; #include <macros.h>	         //AT90S8535宏定义;
; #include "zimo.h"            //点阵LED字模
; #define uchar unsigned char  //数据类型定义
; #define uint unsigned int    //数据类型定义
; 
; uchar Key_Value;		     //按键键值;
; uchar State_Flag;		     //站点标志;
; uchar Ack_Flag;		         //确认标志;
; uchar Pre_Flag;		         //预报标志;
; uchar Move_Flag;		     //滚动标志;
; uchar Spec_Flag;		     //特殊信息标志;
; uchar EOM_Flag=1;	         //信息结束标志;
; uchar Pst_Flag;		         //上、下行标志;
; uchar State=1;			     //站数;
; uchar Spec;			         //特殊信息数;
; uchar Speed=20;		         //文字滚动速度;
; uchar Word_Number;	         //显示字数;
; 
; //语音芯片第1~16段分别保存16站的站名信息
; //第17段保存报站信息“到了,请要下车的乘客依次从后门下车”
; //第18、19段分别保存预报信息“前方到站”、“请要下车的乘客做好下车准备”
; //第20段保存欢迎信息及公交车线路说明
; //第21、22段保存特殊提示信息
; uchar Snd_Info[]={0,17};			   //报站声音信息
; uchar Snd_Pre_Info[]={18,0,19};		   //预报声音信息
; uchar Snd_Spec[]={21,22};			   //特殊声音信息
; uchar Snd_Welc=20;				       //欢迎声音信息
; 
; //本例公交车语音报站系统包含16站
; //所有的站名都以“第n站”代替,其中n为当前站数,n<16
; //报站时显示屏滚动显示“第n站到了”
; //预报站时显示屏显示“前方到站第n站”
; //其中“第n站”字模存放在二维数组State n[3][32]中
; //“到了”字模存放在二维数组DL[2][32]中
; //“前方到站”字模存放在二维数组QFDZ[4][32]中
; uchar text[32];				           //当前显示文字
; uchar next[32];			               //下一个显示文字
; 
; #pragma interrupt_handler Key_Scan:2   //定义按键中断INT0的中断服务程序
; #pragma interrupt_handler Receive_EOM:3//定义语音中断INT1的中断服务程序
; 
; //****************************延时程序*******************************//
; void delay(int t)
; {while(t--) ;}
	mov R2,R16
	mov R3,R17
	subi R16,1
	sbci R17,0
	tst R2
	brne L2
	tst R3
	brne L2
X0:
	.dbline -2
	.dbline 47
L1:
	.dbline 0 ; func end
	ret
	.dbsym r t 16 I
	.dbend
	.dbfunc e Set_CE _Set_CE fV
;          level -> R16
	.even
_Set_CE::
	.dbline -1
	.dbline 51
; 
; //****************************语音芯片驱动程序***********************//
; void Set_CE(uchar level)               //定义ISD2560使能线为PA^4
; {if(level==1) PORTA |=0x10;           
	.dbline 51
	cpi R16,1
	brne L6
	.dbline 51
	sbi 0x1b,4
	rjmp L7
L6:
	.dbline 52
	in R24,0x1b
	andi R24,239
	out 0x1b,R24
L7:
	.dbline -2
	.dbline 53
;  else         PORTA &=0xef;
; }
L5:
	.dbline 0 ; func end
	ret
	.dbsym r level 16 c
	.dbend
	.dbfunc e Set_PD _Set_PD fV
;          level -> R16
	.even
_Set_PD::
	.dbline -1
	.dbline 56
; 
; void Set_PD(uchar level)               //定义ISD2560的PD线为PA^3      
; {if(level)    PORTA |=0x08;
	.dbline 56
	tst R16
	breq L9
	.dbline 56
	sbi 0x1b,3
	rjmp L10
L9:
	.dbline 57
	in R24,0x1b
	andi R24,247
	out 0x1b,R24
L10:
	.dbline -2
	.dbline 58
;  else         PORTA &=0xf7;
; }
L8:
	.dbline 0 ; func end
	ret
	.dbsym r level 16 c
	.dbend
	.dbfunc e Set_PR _Set_PR fV
;          level -> R16
	.even
_Set_PR::
	.dbline -1
	.dbline 61
; 
; void Set_PR(uchar level)               //定义ISD2560的PR线为PA^2
; {if(level)    PORTA |=0x04;
	.dbline 61
	tst R16
	breq L12
	.dbline 61
	sbi 0x1b,2
	rjmp L13
L12:
	.dbline 62
	in R24,0x1b
	andi R24,251
	out 0x1b,R24
L13:
	.dbline -2
	.dbline 63
;  else         PORTA &=0xfb;
; }
L11:
	.dbline 0 ; func end
	ret
	.dbsym r level 16 c
	.dbend
	.dbfunc e Set_A6 _Set_A6 fV
;          level -> R16
	.even
_Set_A6::
	.dbline -1
	.dbline 66
; 
; void Set_A6(uchar level)               //定义ISD2560的A6/8/9线为PA^1
; {if(level)    PORTA |=0x02;
	.dbline 66
	tst R16
	breq L15
	.dbline 66
	sbi 0x1b,1
	rjmp L16
L15:
	.dbline 67
	in R24,0x1b
	andi R24,253
	out 0x1b,R24
L16:
	.dbline -2
	.dbline 68
;  else         PORTA &=0xfd;
; }
L14:
	.dbline 0 ; func end
	ret
	.dbsym r level 16 c
	.dbend
	.dbfunc e Set_A0 _Set_A0 fV
;          level -> R16
	.even
_Set_A0::
	.dbline -1
	.dbline 71
; 
; void Set_A0(uchar level)               //定义ISD2560的A6/8/9线为PA^1
; {if(level)    PORTA |=0x01;
	.dbline 71
	tst R16
	breq L18
	.dbline 71
	sbi 0x1b,0
	rjmp L19
L18:
	.dbline 72
	in R24,0x1b
	andi R24,254
	out 0x1b,R24
L19:
	.dbline -2
	.dbline 73
;  else         PORTA &=0xfe;
; }
L17:
	.dbline 0 ; func end
	ret
	.dbsym r level 16 c
	.dbend
	.dbfunc e Seek_Segment _Seek_Segment fV
;              s -> R20
	.even
_Seek_Segment::
	rcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 77
; 
; //****************************语音搜索和播放程序****************************//
; void Seek_Segment(uchar s)             //语音搜索程序
; {Set_PD(1);				               //语音芯片复位
	.dbline 77
	ldi R16,1
	rcall _Set_PD
	.dbline 78
;  delay(20000);
	ldi R16,20000
	ldi R17,78
	rcall _delay
	.dbline 79
;  Set_PD(0);
	clr R16
	rcall _Set_PD
	.dbline 80
;  Set_PR(1);				               //放音模式
	ldi R16,1
	rcall _Set_PR
	.dbline 81
;  Set_A0(1);	 			               //M0模式
	ldi R16,1
	rcall _Set_A0
	rjmp L22
L21:
	.dbline 83
;  while(s--)				               //快进s段
;  {Set_CE(0);
	.dbline 83
	clr R16
	rcall _Set_CE
	.dbline 84
;   Set_CE(1);
	ldi R16,1
	rcall _Set_CE
L24:
	.dbline 85
;   do NOP();
	nop
L25:
	.dbline 86
	lds R2,_EOM_Flag
	tst R2
	brne L24
	.dbline 87
	ldi R24,1
	sts _EOM_Flag,R24
	.dbline 87
L22:
	.dbline 82
	mov R2,R20
	clr R3
	subi R20,1
	tst R2
	brne L21
	.dbline 88
;   while(EOM_Flag);		               //检测EOM标志位,为0时有效
;   EOM_Flag=1;}
;  Set_A0(0);	 			               //M6模式
	clr R16
	rcall _Set_A0
	.dbline -2
	.dbline 89
; }
L20:
	rcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r s 20 c
	.dbend
	.dbfunc e Play _Play fV
	.even
_Play::
	.dbline -1
	.dbline 92
; 
; void Play(void)                        //语音播放程序
; {Set_CE(0);				               //CE线低电平触发芯片的放音操作
	.dbline 92
	clr R16
	rcall _Set_CE
	.dbline 93
;  Set_CE(1);
	ldi R16,1
	rcall _Set_CE
L28:
	.dbline 94
;  do  NOP();
	nop
L29:
	.dbline 95
;  while(EOM_Flag);		               //检测EOM标志位,为0时有效
	lds R2,_EOM_Flag
	tst R2
	brne L28
	.dbline 96
;  EOM_Flag=1;			               //重新赋EOM标志位为1
	ldi R24,1
	sts _EOM_Flag,R24
	.dbline -2
	.dbline 97
; }
L27:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e Inform _Inform fV
;              i -> R20
;              m -> R20
	.even
_Inform::
	rcall push_gset1
	mov R20,R16
	.dbline -1
	.dbline 101
; 
; //****************************语音报站程序****************************//
; void Inform(uchar m)                   //报站
; {uchar i;
	.dbline 102
;  if(Pst_Flag) Snd_Info[0]=m;           //若为上行方向,顺序报站
	lds R2,_Pst_Flag
	tst R2
	breq L32
	.dbline 102
	sts _Snd_Info,R20
	rjmp L33
L32:
	.dbline 103
;  else		  Snd_Info[0]=17-m;	       //若为下行方向,逆序报站
	ldi R24,17
	sub R24,R20
	sts _Snd_Info,R24
L33:
	.dbline 104
;  Set_PD(1);				               //语音芯片复位
	ldi R16,1
	rcall _Set_PD
	.dbline 105
;  delay(20000);
	ldi R16,20000
	ldi R17,78
	rcall _delay
	.dbline 106
;  Set_PD(0); 
	clr R16
	rcall _Set_PD
	.dbline 107
;  for(i=0;i<2;i++)
	clr R20
	rjmp L37
L34:
	.dbline 108
	.dbline 108
	ldi R24,<_Snd_Info
	ldi R25,>_Snd_Info
	mov R30,R20
	clr R31
	add R30,R24
	adc R31,R25
	ldd R16,z+0
	rcall _Seek_Segment
	.dbline 109
	rcall _Play
	.dbline 109
L35:
	.dbline 107
	inc R20
L37:
	.dbline 107
	cpi R20,2
	brlo L34
	.dbline -2
	.dbline 110
;  {Seek_Segment(Snd_Info[i]);	       //搜索相应语音信息段
;   Play();}						       //播放
; }
L31:
	rcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 c

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -