📄 format.lst
字号:
73 'F', 'A', 'T', '1', '6', ' ', ' ', ' ',// Offset_U256_BS_FilSysType 54 //If non-zero, indicates the sec
-tor number in the reserved //
74 //area of the volume of a copy of the boot record. //
75 //Executable Code
76 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
77 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
78 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
79 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
80 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
81
82 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
85 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-, 0, 0, 0, 0, 0, 0, 0,
86 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
87
88 0x00,//active partion
89 0x00,//head
90 0x00,//partion begin
91 0x00,//cylinder
92 0x06,//is partion used
93 0x00,//end head
94 0x00,//partion end
95 0x00,//end cylinder
96 0x00, 0x00, 0x00, 0x00,
C51 COMPILER V7.50 FORMAT 02/08/2007 11:18:10 PAGE 3
97 0x00, 0x80, 0x00, 0x00,//fist partion
98
99 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,//second partion
100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,//third partion
101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,//forth partion
102
103 0x55, 0xAA // Offset_short int_Signature 510 //0x55AA
104
105 };
106
107 /*读取一个page的内容
108 void ReadPage(unsigned int block, unsigned int page, unsigned char *pPage)
109 {
110 int i;
111 unsigned int blockPage = (block << 5) | page;
112
113 K9F_FUN = COMMAND;
114 *((unsigned char xdata *)K9F5608) = 0x00;
115 K9F_FUN = ADDRESS;
116 *((unsigned char xdata *)K9F5608) = 0; //A0-A7
117 *((unsigned char xdata *)K9F5608) = blockPage & 0xff; //A9-A16
118 *((unsigned char xdata *)K9F5608) = (blockPage >> 8) & 0xff; //A17-A24
119 K9F_FUN = D_DATA;
120
121 i = 512;
122 while(!(K9F_FUN & RB)); //等待操作的完成
123
124 while((i--)>0)
125 {
126 *pPage++ = *((unsigned char xdata *)K9F5608);
127 }
128 }
129 */
130
131 int WritePage(unsigned int block, unsigned int page, unsigned char *pPage)
132 {
133 1 int i = 512;
134 1 unsigned int blockPage = (block << 5) + page;
135 1
136 1 K9F_FUN = COMMAND;
137 1 *((unsigned char xdata *)K9F5608) = 0x80;
138 1 K9F_FUN = ADDRESS;
139 1 *((unsigned char xdata *)K9F5608) = 0;
140 1 *((unsigned char xdata *)K9F5608) = blockPage & 0xff;
141 1 *((unsigned char xdata *)K9F5608) = (blockPage >> 8) & 0xff;
142 1 K9F_FUN = D_DATA;
143 1
144 1 while (i--)
145 1 {
146 2 *((unsigned char xdata *)K9F5608)= *pPage++;
147 2 } //data input->as the same as _WrPage528()
148 1 // __WrPage528(pPage); //which is written with assemble in flash.s
149 1
150 1 K9F_FUN = COMMAND;
151 1 *((unsigned char xdata *)K9F5608) = 0x10;
152 1 delay();
153 1 while(!(K9F_FUN & RB)); //等待操作的完
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -