?? project.s
字號:
.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 + -