我建立一個TXT文檔,起名為AAA。然后找到它根目錄所在的扇區(qū)為504,然后我想用匯編將這個AAA.txt文檔讀出來,可是讀出的數(shù)據(jù)返回值是1DH,不是40H。請問是怎么回事 PS:我程序很菜,請指教。謝謝。下面是我的程序,帶“☆”的地方就是我認為應該返回40H但去返回1DH的位置。 ORG 0000H AJMP MAIN MAIN: MOV DPH,#80H ;TEST MOV A,#06H MOVX @DPTR,A MOV DPH,#00H MOV A,#55H MOVX @DPTR,A NOP MOVX A,@DPTR NOP ////////返回正常,AAH ; MOV DPH,#80H ;RESET MOV A,#15H MOVX @DPTR,A MOV A,#07H MOVX @DPTR,A MOV R0,#014H WAIT1: NOP ;DELAY20US DJNZ R0,WAIT1 MOV DPH,#00H MOVX A,@DPTR LCALL DELAY ; MOV DPH,#80H ;SET MODE MOV A,#15H MOVX @DPTR,A MOV A,#06H MOVX @DPTR,A MOV R0,#14H WAIT2: NOP ;FIND USB DJNZ R0,WAIT2 MOV DPH,#00H MOVX A,@DPTR NOP //////返回51H ; MOV DPH,#80H ;INIT MOV A,#51H MOVX @DPTR,A NOP LCALL DELAY MOV DPH,#80H MOV A,#22H MOVX @DPTR,A NOP MOV DPH,#00H MOVX A,@DPTR NOP NOP ///// 返回14H
RDDATA: MOV DPH,#80H ;;;DISK READ MOV A,#54H MOVX @DPTR,A NOP MOV DPH,#00H MOV A,#0F8H ;;;;;ZUI DI MOVX @DPTR,A NOP NOP MOV DPH,#00H MOV A,#01H ;;;;;JIAO DI MOVX @DPTR,A NOP NOP MOV DPH,#00H MOV A,#00H ;;;;;JIAO GAO MOVX @DPTR,A NOP NOP MOV DPH,#00H MOV A,#00H ;;;;;ZUI GAO MOVX @DPTR,A NOP NOP MOV DPH,#00H ;;;;;SHAN QU MOV A,#01H MOVX @DPTR,A NOP NOP MOV DPH,#80H MOV A,#22H MOVX @DPTR,A NOP MOV DPH,#00H MOVX A,@DPTR NOP NOP ///// 返回1DH LCALL DELAY CJNE A,#1DH,RDDATA NOP NOP MOV DPH,#80H ;;;;;RD USB DATA MOV A,#28H MOVX @DPTR,A NOP LCALL DELAY MOV DPH,#00H MOVX A,@DPTR NOP ☆☆☆☆☆☆☆☆☆////返回錯誤
,返回值為1DH☆☆☆☆☆☆☆☆☆☆☆ LCALL DELAY NOP MOV R0,#40H MOV R1,#08H RDGO: MOV DPH,#80H ;;;;;DISK RD GO MOV A,#55H MOVX @DPTR,A NOP MOV DPH,#80H MOV A,#22H MOVX @DPTR,A NOP MOV DPH,#00H MOVX A,@DPTR MOV 30H,A MOVC A,@A+DPTR INC 30H DJNZ R0,RDGO NOP MOV DPH,#80H MOV A,#22H MOVX @DPTR,A NOP DJNZ R1,RDDATA NOP LCALL DELAY MOV DPH,#80H MOV A,#22H MOVX @DPTR,A NOP MOV DPH,#00H MOVX A,@DPTR NOP NOP RDWC: CJNE A,#14H,RDWC
;;;;;;;;
DELAY: MOV R6,#0C8H ;DELAY 200mS LOOP1: MOV R7,#0F8H NOP LOOP2: DJNZ R7,LOOP2 DJNZ R6,LOOP1 RET