sacm_user.lst

来自「电子词典的设计开发」· LST 代码 · 共 102 行

LST
102
字号
Sunplus u'nSP Assembler - Ver. 1.10.0
              Listing File Has Been Relocated
                            	//========================================================================================
                            	// Progarm: SACM user.asm for A2000 V32
                            	// By: Arthur Shieh
                            	// Last modified date: 
                            	//      2002/09/29: V32:First release for SACM v32  
                            	//
                            	// Functions:
                            	//  F_USER_A2000_GetAWord
                            	//  
                            	// I/O APIs:
                            	//  _USER_SetStartAddr
                            	//
                            	// Note:1. In the demo, it shows a way to fetch ROM data to demonstrate 
                            	//         the manual mode operation. It fetchs data from T_SACM_A2000_SpeechTable
                            	//         and feeds back to library for playback. 
                            	//========================================================================================
                            	
                            	.public _USER_SetStartAddr
                            	.public F_USER_A2000_GetAWord
                            	
000007E6                    	.RAM  
000007E6 00 00              	.var R_Speech_Addr
000007E7 00 00              	.var R_Speech_Page
                            	
0000C41E                    	.CODE
                            	//--------------------------------------------------------------------
                            	//-- Procedure: _USER_SetStartAddr
                            	//-- Syntax: USER_SetStartAddr(int)
                            	//-- Parameter: R1 = PlayIndex 
                            	//-- Return: NONE
                            	//-- Description: This API allows users to set the beginning address 
                            	//                to fetch data. This address can be either a ROM address
                            	//                or a external storage address. User would have to modify
                            	//                the function body based on the application's need.    
                            	//--------------------------------------------------------------------
                            	_USER_SetStartAddr: 
                            	    //-----------------------
                            	    // defined by user
                            	    //-----------------------
0000C41E 88 DA              		push BP to [sp];
0000C41F 08 0B 01 00        		BP = sp + 1;
0000C421 90 D4              		push R1, R2 to [sp];
0000C422 03 92              		r1 = [BP + 3];
0000C423 04 94              		r2 = [BP + 4];
0000C424 19 D3 E6 07        		[R_Speech_Addr] = r1;
0000C426 1A D5 E7 07        		[R_Speech_Page] = r2;
0000C428 90 90              		pop R1, R2 from [sp];	
0000C429 88 98              		pop BP from [sp];
                            	    //-----------------------
                            		// end of user define area
                            	    //-----------------------
0000C42A 90 9A              		RETF;	
                            	
                            			
                            	
                            	//--------------------------------------------------------------------
                            	//-- Function: F_USER_A2000_GetAWord
                            	//-- Parameter: NONE
                            	//-- Return: R1 = Data
                            	//-- Description: This function called by library to fetch data  
                            	//                for playback. The Library needs a word data  
                            	//                Uaser would have to compose the function body 
                            	//                based on the storage type to fulfill this demand from 
                            	//                library. 
                            	//--------------------------------------------------------------------
                            	F_USER_A2000_GetAWord: 
                            	    //-----------------------
                            	    // defined by user
                            	    //-----------------------
0000C42B 11 93 E6 07        			r1 = [R_Speech_Addr];
0000C42D 12 95 E7 07        			r2 = [R_Speech_Page];
                            			
0000C42F 5A 95              			r2 = r2 LSL 4;
0000C430 5A 95              			r2 = r2 LSL 4;
0000C431 4A 95              			r2 = r2 LSL 2;
                            			
0000C432 7F BC              			SR &= 0x03f; 					// Change Page
0000C433 02 AD              	        SR |= R2; 						//
                            	          
0000C434 F1 96              	  		R3 = D:[R1 ++]; 				// Get data
                            			
0000C435 40 42              			cmp R1 , 0x0;
0000C436 03 4E              			JNE ?_update_addr;
0000C437 41 04              			R2 += 1;  
0000C438 1A D5 E7 07        			[R_Speech_Page] = R2;
                            			
                            			?_update_addr:
0000C43A 19 D3 E6 07        			[R_Speech_Addr] = R1;
                            			
                            			?_return_data:
0000C43C 03 93              			R1 = R3;
                            		//-----------------------
                            		// end of user define area
                            	    //-----------------------		  
0000C43D 90 9A              		  	RETF;
                            		  
                            	 .end 
0 error(s), 0 warning(s).

⌨️ 快捷键说明

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