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

📄 mp3.lst

📁 Build ourself a MP3 Player
💻 LST
📖 第 1 页 / 共 5 页
字号:
4116:  MOVLB  2
4118:  CLRF   xB5
411A:  CLRF   xB6
411C:  CLRF   xB7
411E:  MOVF   x1B,W
4120:  ANDLW  0F
4122:  MOVWF  00
4124:  MOVF   xB5,W
4126:  ANDLW  00
4128:  MOVWF  01
412A:  MOVF   xB6,W
412C:  ANDLW  00
412E:  MOVWF  02
4130:  MOVF   xB7,W
4132:  ANDLW  00
4134:  MOVWF  03
4136:  MOVF   00,W
4138:  IORLW  E0
413A:  MOVWF  xB8
413C:  MOVF   01,W
413E:  MOVWF  xB9
4140:  MOVF   02,W
4142:  MOVWF  xBA
4144:  MOVF   03,W
4146:  MOVWF  xBB
4148:  MOVLW  06
414A:  MOVWF  xC2
414C:  MOVLB  0
414E:  MOVFF  2B8,2C3
4152:  CALL   199A
....................    CF_TaskFileWrite(REG_COMMAND, COMMAND_WRITESECTOR);  
4156:  MOVLW  07
4158:  MOVLB  2
415A:  MOVWF  xC2
415C:  MOVLW  30
415E:  MOVWF  xC3
4160:  MOVLB  0
4162:  CALL   199A
....................    delay_ms(1);  
4166:  MOVLW  01
4168:  MOVLB  2
416A:  MOVWF  xB3
416C:  MOVLB  0
416E:  CALL   1832
....................    while ((CF_ReadByte()&0x88)!=0x08);     // check if valid??? 
4172:  CALL   18FA
4176:  MOVF   01,W
4178:  ANDLW  88
417A:  SUBLW  08
417C:  BTFSC  FD8.2
417E:  GOTO   4186
4182:  GOTO   4172
....................   
....................    CF_SetAddr(0);  
4186:  MOVLB  2
4188:  CLRF   xC4
418A:  MOVLB  0
418C:  CALL   17E8
4190:  RETLW  00
.................... }  
....................   
.................... /***************************************/  
.................... // dump the contents of sectorbuff into a sector or vice versa  
.................... // assumes you've StartSectorWrite/Read 'd  
....................   
.................... void CF_ReadSectorIntoBuff() {  
....................    int16 i;  
....................    for (i=0; i < (int16)512; i++) {  
*
3418:  MOVLB  2
341A:  CLRF   xBA
341C:  CLRF   xB9
341E:  MOVF   xBA,W
3420:  SUBLW  01
3422:  BTFSS  FD8.0
3424:  GOTO   345A
....................       sectorbuff[i] = CF_ReadByte();  
3428:  MOVLW  17
342A:  ADDWF  xB9,W
342C:  MOVWF  01
342E:  MOVLW  00
3430:  ADDWFC xBA,W
3432:  MOVWF  03
3434:  MOVF   01,W
3436:  MOVWF  xBB
3438:  MOVLB  0
343A:  MOVFF  03,2BC
343E:  CALL   18FA
3442:  MOVFF  2BC,FEA
3446:  MOVFF  2BB,FE9
344A:  MOVFF  01,FEF
....................    }  
344E:  MOVLB  2
3450:  INCF   xB9,F
3452:  BTFSC  FD8.2
3454:  INCF   xBA,F
3456:  GOTO   341E
345A:  MOVLB  0
345C:  RETLW  00
.................... }  
....................   
.................... void CF_WriteBuffIntoSector() {  
....................    int16 i;  
....................    for (i=0; i < (int16)512; i++) {  
*
4192:  MOVLB  2
4194:  CLRF   xB4
4196:  CLRF   xB3
4198:  MOVF   xB4,W
419A:  SUBLW  01
419C:  BTFSS  FD8.0
419E:  GOTO   41C8
....................       CF_WriteByte(sectorbuff[i]);  
41A2:  MOVLW  17
41A4:  ADDWF  xB3,W
41A6:  MOVWF  FE9
41A8:  MOVLW  00
41AA:  ADDWFC xB4,W
41AC:  MOVWF  FEA
41AE:  MOVLB  0
41B0:  MOVFF  FEF,2B5
41B4:  MOVFF  2B5,2C4
41B8:  CALL   197C
....................       //putc('.');  
....................    }  
41BC:  MOVLB  2
41BE:  INCF   xB3,F
41C0:  BTFSC  FD8.2
41C2:  INCF   xB4,F
41C4:  GOTO   4198
41C8:  MOVLB  0
41CA:  RETLW  00
.................... }  
....................   
.................... /***************************************/  
.................... void CF_DumpSector() {      // uses CF_CurrSector  
....................    int16 i;  
....................   
....................    CF_StartSectorRead();  
*
345E:  CALL   19AC
....................   
....................    CF_ReadSectorIntoBuff();  
3462:  CALL   3418
....................    for (i=0; i < (int16)512; i++) {  
3466:  MOVLB  2
3468:  CLRF   x9F
346A:  CLRF   x9E
346C:  MOVF   x9F,W
346E:  SUBLW  01
3470:  BTFSS  FD8.0
3472:  GOTO   349E
....................       putc(sectorbuff[i]);  
3476:  MOVLW  17
3478:  ADDWF  x9E,W
347A:  MOVWF  FE9
347C:  MOVLW  00
347E:  ADDWFC x9F,W
3480:  MOVWF  FEA
3482:  MOVLB  0
3484:  MOVFF  FEF,2A0
3488:  MOVLB  2
348A:  MOVF   xA0,W
348C:  BTFSS  F9E.4
348E:  GOTO   348C
3492:  MOVWF  FAD
....................    }  
3494:  INCF   x9E,F
3496:  BTFSC  FD8.2
3498:  INCF   x9F,F
349A:  GOTO   346C
349E:  MOVLB  0
34A0:  GOTO   4D32 (RETURN)
.................... }  
....................   
....................  
.................... #include "fat16.c" 
....................  #include "fat16.h" 
....................  // BPB info  
.................... typedef unsigned int16 uint16;  
.................... typedef unsigned int32 uint32;  
....................   
.................... uint16 BPB_StartSector;  
.................... uint16 BPB_ReservedSectorCount;  
.................... uint16 BPB_FATstart;               // sector the FAT starts in  
.................... byte  BPB_NumFATs;                // number of FATs (should be two)  
.................... uint16 BPB_BytesPerSector;         // # bytes per sector (should be 512)  
.................... byte  BPB_SectorsPerCluster;      // should be like 4 or something  
.................... uint16 BPB_FATSize;                   // size of fat  
.................... uint16 FAT_StartSector;  
.................... uint16 BPB_RootDirEntryCount;  
.................... uint16 FAT_FirstDataSector;        // where data starts  
.................... uint16 FAT_RootDirStartSector;     // first sector of root directory  
.................... uint16 FAT_RootDirNumSectors;      // number of sectors allocated to root directory  
....................   
.................... // Current Directory state  
.................... char  CWD_Name[9];  
.................... uint32 CWD_StartSector;  
.................... uint32 CWD_CurrSector;  
.................... byte  CWD_NumEntries;  
....................   
.................... // Current File state  
.................... char  File_Name[12];  
.................... char  File_Attr;  
.................... uint16 File_StartCluster;  
.................... uint16 File_CurrCluster;  
.................... uint32 File_Size;  
.................... uint32 File_CurrSector;  
.................... byte  File_CurrSectorNumInCluster;  
.................... uint32 File_CurrByte;  
.................... uint32 File_DirSectorNum;  
.................... uint16 File_DirEntryNum;           // this file is # in the current directory  
....................   
....................   
.................... #define FAT_IS_DIR 0x10  
.................... #define FAT_END_OF_DIR 0x2  
.................... #define FAT_FILE_DELETED 0xe5  
.................... #define FAT_LONG_FILENAME 0x3  
....................   
.................... uint32 FAT_ConvertClusterToSector(uint16 cluster);  
.................... void FAT_PrintCurrFileInfo();  
.................... uint16 FAT_GetNextCluster(uint16 cluster);  
.................... byte FAT_LoadFileInCWD(int16 filenumber);  
....................   
.................... int16 FAT_findUnusedCluster();  
.................... int16 FAT_findNextUnusedCluster(int16 oldcluster);  
.................... boolean FAT_loadFileWithName(char *filename);  
....................  
.................... #include "string.h" 
....................  ////////////////////////////////////////////////////////////////////////////  
.................... ////        (C) Copyright 1996,1997 Custom Computer Services            ////  
.................... //// This source code may only be used by licensed users of the CCS C   ////  
.................... //// compiler.  This source code may only be distributed to other       ////  
.................... //// licensed users of the CCS C compiler.  No other use, reproduction  ////  
.................... //// or distribution is permitted without written permission.           ////  
.................... //// Derivative programs created using this software in object code     ////  
.................... //// form are not restricted in any way.                                ////  
.................... ////////////////////////////////////////////////////////////////////////////  
.................... #ifndef _STRING  
.................... #define _STRING  
.................... #include <stddef.h> 
....................  ////        (C) Copyright 1996,2001 Custom Computer Services            ////  
.................... //// This source code may only be used by licensed users of the CCS C   ////  
.................... //// compiler.  This source code may only be distributed to other       ////  
.................... //// licensed users of the CCS C compiler.  No other use, reproduction  ////  
.................... //// or distribution is permitted without written permission.           ////  
.................... //// Derivative programs created using this software in object code     ////  
.................... //// form are not restricted in any way.                                ////  
.................... ////////////////////////////////////////////////////////////////////////////  
....................   
.................... #ifndef _STDDEF  
....................   
.................... #define _STDDEF  
....................   
.................... #if sizeof(int *)==1  
.................... #define ptrdiff_t int  
.................... #else  
.................... #define ptrdiff_t long  
.................... #endif  
....................   
.................... #define size_t int  
.................... #define wchar_t char  
.................... #define NULL 0  
....................   
.................... #define offsetof(s,f) (offsetofbit(s,f)/8)  
....................   
.................... #endif  
....................  
.................... #include <ctype.h> 
....................  ////        (C) Copyright 1996,1997 Custom Computer Services            ////  
.................... //// This source code may only be used by licensed users of the CCS C   ////  
.................... //// compiler.  This source code may only be distributed to other       ////  
.................... //// licensed users of the CCS C compiler.  No other use, reproduction  ////  
.................... //// or distribution is permitted without written permission.           ////  
.................... //// Derivative programs created using this software in object code     ////  
.................... //// form are not restricted in any way.                                ////  
.................... ////////////////////////////////////////////////////////////////////////////  
....................   
.................... #ifndef _CTYPE  
.................... #define _CTYPE  
....................   
.................... #define islower(x)  isamoung(x,"abcdefghijklmnopqrstuvwxyz")  
.................... #define isupper(x)  isamoung(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ")  
.................... #define isalnum(x)  isamoung(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")  
.................... #define isalpha(x)  isamoung(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")  
.................... #define isdigit(x)  isamoung(x,"0123456789")  
.................... #define isspace(x)  (x==' ')  
.................... #define isxdigit(x) isamoung(x,"0123456789ABCDEFabcdef")  
.................... #define iscntrl(x)  (x<' ')  
.................... #define isprint(x)  (x>=' ')  
.................... #define isgraph(x)  (x>' ')  
.................... #define ispunct(x)  ((x>' ')&&!isalnum(x))  
....................   
.................... #endif  
....................   
....................  
....................   
.................... /*Copying functions*/  
.................... /* standard template:  
....................    void *memmove(void *s1, void *s2, size_t n).  
....................    Copies max of n characters safely (not following ending '\0')  
....................    from s2 in s1; if s2 has less than n characters, appends 0 */  
....................   
.................... char *memmove(void *s1,char *s2,size_t n)  
.................... {  
....................    char *sc1;  
....................    char *sc2;  
....................    sc1=s1;  
....................    sc2=s2;  
....................    if(sc2<sc1 && sc1 <sc2 +n)  
....................       for(sc1+=n,sc2+=n;0<n;--n)  
....................          *--sc1=*--sc2;  
....................    else  
....................       for(;0<n;--n)  
....................          *sc1++=*sc2++;  
....................   return s1;  
....................   }  
.................... /*    Standard template: char *strcpy(char *s1, const char *s2)  
.................... copies the string s2 including the null character to s1*/  
....................   
.................... char strcpy(char *s1, char *s2)  
.................... {  
....................   char *s;  
....................   
....................   for (s = s1; *s2 != 0; s++, s2++)  
.................... 	  *s = *s2;  
....................   return(s1);  
.................... }  
.................... /* compiler ignored the name 'strcpy()'; perhaps, it's reserved?? 
....................    Standard template: char *strcpy(char *s1, const char *s2)  
....................    copies the string s2 including the null character to s1*/  
....................   
.................... char strcopy(char *s1, char *s2)  
.................... {  
....................   char *s;  
....................   
....................   for (s = s1; *s2 != 0; s++, s2++)  
.................... 	  *s = *s2;  
....................   return(s1);  
.................... }  
....................   
.................... /* standard template:  
....................    char *strncpy(char *s1, const char *s2, size_t n).  
....................    Copies max of n characters (not following ending '\0')  
....................    from s2 in s1; if s2 has less than n characters, appends 0 */  
....................   
.................... char strncpy(char *s1, char *s2, size_t n)  
.................... {  
....................   char *s;  
....................   
....................   for (s = s1; n > 0 && *s2 != '\0'; n--)  
....................      *s++ = *s2++;  
....................   for (; n > 0; n--)  
....................      *s++ = '\0';  
....................   
....................   return(s1);  
.................... }  
.................... /***********************************************************/  
....................   
.................... /*concatenation functions*/  
.................... /* standard template: char *strcat(char *s1, const char *s2)  
.................... appends s2 to s1*/  
....................   
.................... char strcat(char *s1, char *s2)  
.................... {  
....................    char *s;  
....................   
....................    for (s = s1; *s != '\0'; s++);  
....................    while ((*s = *s2) != '\0')  
....................    {  
....................        s++;  
....................        s2++;  
....................    }  
....................    return(s1);  
.................... }  
.................... /* standard template: char *strncat(char *s1, char *s2,size_t n)  
.................... appends not more than n characters from s2 to s1*/  
....................   
.................... char strncat(char *s1, char *s2, size_t n)  
.................... {  
....................    char *s;  
....................   
....................    for (s = s1; *s != '\0'; s++);  
....................    while ((*s = *s2) != '\0' && 0< n)  
....................    {  
....................        s++;  
....................        s2++;  
....................        --n;  
....................    }  
....................    *s='\0';  
....................    return(s1);  
.................... }  
....................   
.................... /***********************************************************/  
....................   
.................... /*comparison functions*/  
.................... /* standard template: signed int memcmp(void *s1, void *s2).  
....................    Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */  
....................   
.................... signed int memcmp(void * s1,char *s2,size_t n)  
.................... {  
.................... char *su1,su2;  
.................... for(su1=s1,su2=s2;0<n;++su1,++su2,--n)  
.................... {  

⌨️ 快捷键说明

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