function [] = BG1MRegDataExtract(zc,path,AMRegFile,BMRegFile)
%UNTITLED 此处显示有关此函数的摘要
%   此处显示详细说明

    Afid = fopen([path AMRegFile],'r');
    Bfid = fopen([path BMRegFile],'r');
    
    Atmp = fgets(Afid);
    if ~strncmp(Atmp,'@0000',5)
        frewind(Afid);
    end

    Btmp = fgets(Bfid);
    if ~strncmp(Btmp,'@0000',5)
        frewind(Bfid);
    end
    Adata = fscanf(Afid,'0x%08x\n');
    Adata = Adata(1:1248);
    Bdata = fscanf(Bfid,'0x%08x\n');
    Bdata = Bdata(1:1248);
    fclose(Afid);fclose(Bfid);
    if zc > 64
        Adata = reshape(Adata,96,13);
        Bdata = reshape(Bdata,96,13);
        ValidDataLen = zc/4;
        Adata = Adata(1:ValidDataLen,:);
        Bdata = Bdata(1:ValidDataLen,:);
    end
    Afid = fopen([path AMRegFile],'w');
    Bfid = fopen([path BMRegFile],'w');
    fprintf(Afid,'0x%08x\n',Adata);
    fprintf(Bfid,'0x%08x\n',Bdata);
    fclose(Afid);fclose(Bfid);
end

