📄 ide_test.lst
字号:
C51 COMPILER V7.00 IDE_TEST 12/31/2003 02:59:24 PAGE 1
C51 COMPILER V7.00, COMPILATION OF MODULE IDE_TEST
OBJECT MODULE PLACED IN IDE_TEST.OBJ
COMPILER INVOKED BY: F:\Keil\C51\BIN\C51.EXE IDE_TEST.C BROWSE INTVECTOR(0X8000) DEBUG OBJECTEXTEND TABS(2)
stmt level source
1 /*
2 Copyright (C) 2003 Bart Bilos <boombox666@yahoo.com>.
3
4 Adapted from original work by Paul Stoffregen.
5 http://www.pjrc.com/tech/8051/ide/
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 */
22 #include <Dallas\REG320.H> /* Declaration for the 8051 Regs */
23 #include <stdio.h> /* prototype declarations for I/O functions */
24 #include "IDE_LIB.h" /* IDE working variables */
25 #include "timertick.h" /* timer subsystem */
26
27 // Small delay subroutine
28 void delay(unsigned int delay) {
29 1 unsigned int i,j;
30 1 for(i = 0; i < delay ;i++)
31 1 for(j = 0; j < 255 ;j++);
32 1 }
33
34 void init(void){
35 1 inittimer();
36 1 ide_hard_reset();
37 1 ide_init();
38 1 }
39
40 /*------------------------------------------------\
41 Test program to see if the IDE_8255 is functioning
42 ------------------------------------------------*/
43 void main (void) {
44 1 xdata char sector[512];
45 1 idata char lba[4] = {0,0,0,0};
46 1 unsigned char i,j,k,l;
47 1 int seconden = getseconds();
48 1 long int sectoren=0,sects=0;
49 1 init();
50 1 printf(" IDE TEST PROGRAM \n");
51 1 for(i = 0 ;i < 0x60 ;i++) {
52 2 for(j = 0 ;j != 0xFF ;j++) {
53 3 for(k = 0 ;k != 0xFF ;k++) {
54 4 for(l = 0 ;l != 0xFF ;l++) {
55 5 lba[0] = l;
C51 COMPILER V7.00 IDE_TEST 12/31/2003 02:59:24 PAGE 2
56 5 lba[1] = k;
57 5 lba[2] = j;
58 5 lba[3] = i;
59 5 if(read_sector(lba,sector) != 0) {
60 6 printf("READ ERROR @ %ld ",sectoren);
61 6 }
62 5 P1 = sector[0];
63 5 sects++;
64 5 sectoren++;
65 5 if((getseconds() - seconden) > 0){
66 6 printf(" %ld Kbs, %ld sectoren read \n",sects>>1,sectoren);
67 6 seconden = getseconds();
68 6 sects=0;
69 6 }
70 5 }
71 4 }
72 3 }
73 2 }
74 1 printf(" %ld sectors read total %ld MB read in %ld seconds ",sectoren,sectoren>>11,getseconds());
75 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 424 ----
CONSTANT SIZE = 124 ----
XDATA SIZE = ---- 512
PDATA SIZE = ---- ----
DATA SIZE = ---- 14
IDATA SIZE = ---- 4
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -