原帖:http://www.61ic.com/Technology/embed/200604/3300.html
;Disasm51 Version 3.02 Copyright (c) 2000,2003 Xi'an XXX Co. HotPower
;Binfile_name :[N104V20.bin]
;Binfile_length:[12282...2FFAH]
;-------UDA1325 USB 定义---------------------------------------------------
S1CON EQU 0D8H
S1STA EQU 0D9H
S1DAT EQU 0DAH
S1ADR EQU 0DBH
;----------------------------------------------------------
ORG 0000H
RESET: LJMP L003E
;----------------------------------------------------------
EXTI0: LJMP L1156;INT0外部中断
;----------------------------------------------------------
S0006: LCALL S2A51;读USB信息
RET
D000A: DB 000H
;----------------------------------------------------------
TIMER0: LJMP L091A;T0中断
;----------------------------------------------------------
S000E: LCALL S2A51;读USB信息
RET
D0012: DB 000H
;----------------------------------------------------------
EXTI1: LJMP L1103;INT1外部中断
D0016: DB 032H;RETI
;----------------------------------------------------------
S0017: LCALL S2A51;读USB信息
RET
;----------------------------------------------------------
TIMER1: LJMP L0929;T1中断
D001E: DB 032H;RETI
;-------数据区----------------------------------------------
D001F: DB 041H,004H,01AH,0FFH
;-------数据区----------------------------------------------
D0023: DB 040H,004H,01AH,0FFH
D0027: DB 0A1H,004H,01AH,0FFH
D002B: DB 0A0H,004H,01AH,0FFH
;-------数据区----------------------------------------------
D002F: DB 070H,004H,01AH,0FFH
;----------------------------------------------------------
D0033: LJMP L0CB8;IIC中断
DB 032H;RETI
;----------------------------------------------------------
;if(p3.0 == 0) acc=0 else acc=8;
S0037: MOV A,P3
ANL A,#008H;取P3.3(PSIE_MMU_INT)
RET
D003C: DB 022H;RET
S003D: RET
;-------内存初始化(启动文件)--------------------------------
L003E: MOV R0,#07FH
L0040: MOV @R0,#000H
DJNZ R0,L0040
;----------------------------------------------------------
MOV DPTR,#D0EDE
LCALL S2C67;取散转向量表
LJMP L2A0E;LJMP MAIN
;-------执行散转程序-------------------------------------
S004D: MOV R0,SP
DEC R0
DEC R0
DEC R0
MOV SP,#093H
MOV A,@R0;取入口参数1
MOV @R0,#000H
PUSH ACC
INC R0
MOV A,@R0;取入口参数2
MOV @R0,#000H
PUSH ACC
INC R0
MOV A,@R0;取散转地址低位
MOV @R0,#000H
PUSH ACC
INC R0
MOV A,@R0;取散转地址高位
PUSH ACC
MOV @R0,#000H
RET;跳入散转向量
;-------发送USB命令---------------------------------
;入口参数:
; RAM (008H) 存放USB命令
;出口参数:
; 无
;----------------------------------------------------
S006D: MOV 009H,#001H
LCALL S00BC;等待PSIE_MMU_READY为高电平
MOV A,008H;取USB发送命令
MOV DPTR,#4001H;COMMAND REGISTER PSIE
MOVX @DPTR,A;发送命令
RET
;-------发送USB命令且写入1个字节---------------------
;入口参数:
; RAM (008H) 存放USB命令
; RAM (00BH) 存放USB数据
;出口参数:
; 无
;----------------------------------------------------
S007A: LCALL S006D;COMMAND REGISTER PSIE(<@08H>)
LCALL S00BC;等待PSIE_MMU_READY为高电平
MOV DPTR,#4000H;DATA REGISTER PSIE
MOV A,00BH;取USB数据
MOVX @DPTR,A
RET
;-------发送USB命令且写入N个字节---------------------
;入口参数:
; RAM (008H) 存放USB命令
; RAM (00CH) 存放写入USB数据指针首址
; RAM (00AH) 存放写入USB数据个数
;出口参数:
; 无
;----------------------------------------------------
S0087: LCALL S006D;COMMAND REGISTER PSIE(<@08H>)
LCALL S00BC;等待PSIE_MMU_READY为高电平
MOV R7,00AH;<@0AH>存放写入个数计数器
MOV DPTR,#4000H;DATA REGISTER PSIE
MOV R0,#00CH;起始地址
L0094: LCALL S00BC;等待PSIE_MMU_READY为高电平
MOV A,@R0
MOVX @DPTR,A;送数据
INC R0
DJNZ R7,L0094;<@08H>未送完,继续
RET
;-------发送USB命令且读1个字节-----------------------
;入口参数:
; RAM (008H) 存放USB命令
;出口参数:
; RAM (00BH) 读回USB数据
; ACC 读回USB数据
;----------------------------------------------------
S009D: ACALL S006D;COMMAND REGISTER PSIE(<@08H>)
LCALL S00BC;等待PSIE_MMU_READY为高电平
MOV DPTR,#4000H;DATA REGISTER PSIE
MOVX A,@DPTR;READ 1 BYTE
MOV 00BH,A;存入USB数据
RET
;-------发送USB命令且读10个字节-----------------------
;入口参数:
; RAM (008H) 存放USB命令
; RAM (00CH) 存放USB数据指针首址
;出口参数:
; RAM (00CH) 读回10字节USB数据
; RAM (00BH) 读回最后1字节USB数据
; ACC 读回最后1字节USB数据
;----------------------------------------------------
S00A9: ACALL S006D;COMMAND REGISTER PSIE(<@08H>)
ACALL S00BC;等待PSIE_MMU_READY为高电平
MOV R7,#00AH
MOV R0,#00CH
MOV DPTR,#4000H;DATA REGISTER PSIE
L00B4: ACALL S00BC;等待PSIE_MMU_READY为高电平
MOVX A,@DPTR
MOV @R0,A
INC R0
DJNZ R7,L00B4
RET
;-----------------------------------------------------
S00BC: JNB T0,$;等待PSIE_MMU_READY为高电平
RET
;-----------------------------------------------------
D00C0: DB 001H,003H
;-----------------------------------------------------
D00C2: DB 'dio Class 1.0S'
D00D0: DB 'W1.0-1.2LIB DEV '
D00E0: DB '1.0.1.11'
;-------版本说明----------------------------------------
;Philips ElectronicsDUSB Playback and Recording System
;\N104SW1.0-1.20Lb1.0-1.12ADC1.0HID1.0HUT1.0-C1
;\N104SW1.0-1.20Lb1.0-1.12ADC1.0HID1.0HUT1.0-CE
;-------------------------------------------------------
D0539: DB 050H,000H;'p'
DB 068H,000H;'h'
DB 069H,000H;'i'
DB 06CH,000H;'l'
DB 069H,000H;'i'
DB 070H,000H;'p'
DB 073H,000H;'s'
DB 020H,000H;' '
DB 045H,000H;'E'
DB 06CH,000H;'l'
DB 065H,000H;'e'
DB 063H,000H;'c'
DB 074H,000H;'t'
DB 072H,000H;'r'
DB 06FH,000H;'o'
DB 06EH,000H;'n'
DB 069H,000H;'i'
DB 063H,000H;'c'
DB 073H,000H;'s'
DB 044H,003H;'D'
DB 055H,000H;'U'
DB 053H,000H;'S'
DB 042H,000H;'B'
DB 020H,000H;' '
DB 050H,000H;'P'
DB 06CH,000H;'l'
DB 061H,000H;'a'
DB 079H,000H;'y'
DB 062H,000H;'b'
DB 061H,000H;'a'
DB 063H,000H;'c'
DB 06BH,000H;'k'
DB 020H,000H;' '
DB 061H,000H;'a'
DB 06EH,000H;'n'
DB 064H,000H;'d'
DB 020H,000H;' '
DB 052H,000H;'R'
DB 065H,000H;'e'
DB 063H,000H;'c'
DB 06FH,000H;'o'
DB 072H,000H;'r'
DB 064H,000H;'d'
DB 069H,000H;'i'
DB 06EH,000H;'n'
DB 067H,000H;'g'
DB 020H,000H;' '
DB 053H,000H;'S'
DB 079H,000H;'y'
DB 073H,000H;'s'
DB 074H,000H;'t'
DB 065H,000H;'e'
DB 06DH,000H;'m'
DB 05CH,003H;'\'
DB 04EH,000H;'N'
DB 031H,000H;'1'
DB 030H,000H;'0'
DB 034H,000H;'4'
DB 053H,000H;'S'
DB 057H,000H;'W'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 02DH,000H;'-'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 032H,000H;'2'
DB 030H,000H;'0'
DB 04CH,000H;'L'
DB 062H,000H;'b'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 02DH,000H;'-'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 031H,000H;'1'
DB 032H,000H;'2'
DB 041H,000H;'A'
DB 044H,000H;'D'
DB 043H,000H;'C'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 048H,000H;'H'
DB 049H,000H;'I'
DB 044H,000H;'D'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 048H,000H;'H'
DB 055H,000H;'U'
DB 054H,000H;'T'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 02DH,000H;'-'
DB 043H,000H;'C'
DB 031H,000H;'1'
D05FF: DB 05CH,003H;'\'
DB 04EH,000H;'N'
DB 031H,000H;'1'
DB 030H,000H;'0'
DB 034H,000H;'4'
DB 053H,000H;'S'
DB 057H,000H;'W'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 02DH,000H;'-'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 032H,000H;'2'
DB 030H,000H;'0'
DB 04CH,000H;'L'
DB 062H,000H;'b'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 02DH,000H;'-'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 031H,000H;'1'
DB 032H,000H;'2'
DB 041H,000H;'A'
DB 044H,000H;'D'
DB 043H,000H;'C'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 048H,000H;'H'
DB 049H,000H;'I'
DB 044H,000H;'D'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 048H,000H;'H'
DB 055H,000H;'U'
DB 054H,000H;'T'
DB 031H,000H;'1'
DB 02EH,000H;'.'
DB 030H,000H;'0'
DB 02DH,000H;'-'
DB 043H,000H;'C'
DB 045H,000H;'E'
;-------------------------------------------------------
S065B: MOV 03EH,#000H |