SCS_L; usb_write_8_COM(0x4C); //以扇區(qū)為單位寫入命令 usb_write_8_DATA(3); SCS_H; ass1=usb_zhongduan_duqu(); //讀取中斷標志 if(ass1==0x14) { SCS_L; usb_write_8_COM(0x27); //讀取寫入允許扇區(qū)和起始LBA usb_read_8(); shanqu=usb_read_32(); //讀取的最低位為1,可能扇區(qū)為1 qushi_LAB=usb_read_32(); //起始LBA SCS_H; usb_delay(20); SCS_L; usb_write_8_COM(0x56); //輸入起始地址和扇區(qū)數(shù) usb_write_8_DATA(qushi_LAB); usb_write_8_DATA(qushi_LAB>>8); usb_write_8_DATA(qushi_LAB>>16); usb_write_8_DATA(qushi_LAB>>24); usb_write_8_DATA(shanqu); SCS_H; ass1=usb_zhongduan_duqu(); //讀取允許輸入標志 if(ass1==0x1E) { kuai_zongshu=shanqu_shu_a*8; do { usb_25X40_DUQU(w25x40_duqu_zushu); //usb存儲讀取( 第幾組數(shù)據(jù)) shuju_zhizhen=cunchu_zan; //將指針指向數(shù)組起始地址 usb_shanqu_xieru(shuju_zhizhen,w25x40_duqu_zushu,1); //扇區(qū)寫入(數(shù)據(jù)起始指針,數(shù)據(jù)長度) SCS_L; usb_write_8_COM(0x57); SCS_H; ass1=usb_zhongduan_duqu(); //讀取允許輸入標志 if(ass1!=0x1E) {break;} }while(--kuai_zongshu); } }