Decimal to Binary Conversion Function program

Data Recovery PRO DATA DOCTOR

Home | Order Online | Downloads | Contact Us | Software Knowledgebase

it | es | pt | fr | de | jp | kr | cn | ru | nl | gr


//////// Decimal to Binary Conversion Function \\\\\\\\

Decimal_to_Binary(unsigned long input)
{
unsigned long i;
int count = 0;
int binary [32]; /* 32 Bit MAX only 32
elements total */

do
{
i = input%2; /* MOD 2 to get 1 or a 0*/
binary[count] = i; /* Load Elements into the
Binary Array */
input = input/2; /* Divide input by 2 to
decrement via binary */
count++; /* Count how many elements
are needed */
}while (input > 0);

/* Reverse and output binary digits */

do
{
printf ("%d", binary[count - 1]);
count--;
} while (count > 0);

return 0;
}

When the program is run to read the DBR of a large volume, The Output of the Program is displayed as follows:

 

 Jump Instruction Code = EB5890 (H)
 OEM name and version = MSWIN4.1
 Bytes per sector = 512
 Sectors per cluster = 8
 Reserved sectors = 32
 FAT copies = 2
 Root directory entries = 0
 No. of sectors on disk = 0
 Media Descriptor Byte = F8 (H)
 Sectors per FAT = 0
 Sectors per track = 63
 No. of sides = 255
 No. of reserved (Hidden) sectors = 63
 
     ===========  For Large (>32MB) Disks  ===========

 No. of sectors, (if Volume is >32MB) = 11277567
 Number of Sectors per FAT = 11003
 Root Directory Starting Cluster = 2
 File System Information Sector = 1
 Sector Number of Backup Boot Sector = 6
 Physical Drive Number = 80 (H)
 Extended Boot Signature = 29 (H)
 32-Bit Binary Volume ID = 110101010001100001110111100101 (B)
 Volume Label = SAAYA
 FAT name = FAT32
 Magic Number = 55AA (H)

In the output of the program we see that the following parameters are shown zero:

  • Root Directory Entry
  • Number of Sectors on Disk
  • Number Sectors Per FAT

These parameters are so because these values are set to zero, if the partition volume is greater then 32MB in size and the actual information is found in the Extended Volume Information Block of the DBR.

For Example, in the initial part of the DBR information, the number of Sectors per FAT is 0 and in the Extended Volume Information Block of DBR the Number of Sectors per FAT is 11003, which is the Actual Value for this large Volume.

The DBR of the Volume has the important information about the disk parameters, which can be used to link the all data information for programming purpose. For Example, if you want to access the DBRs of other Partition volume on the disk, you can calculate it by number of sectors, written in DBR and other related information.

If you want to access the Disk with cluster approach, you can make calculations with the help of Sectors per cluster, sectors per FAT and other information.

If you are using the hard disk larger than 8.4 GB (See the chapter, “Logical Approach to Disks and OS”, Discussed earlier in this book), use extensions to access all the DBR’s of the disk beyond 8.4 GB. Refer the Extended read-write functions, given in the previous chapters

Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Data Recovery with & without Programming


Publishers of the Book
Number of Pages
ISBN
Price of the Book


BPB Publications, New Delhi, India
540
81-7656-922-4
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)





Buy Data recovery Book

Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9

Next page

© Copyright 2002-2005 DataDoctor.Biz

Home | Contact us | Downloads | Services | Terms and conditions | Site map

Website Data Recovery | recuperación de Datos | Récupération de données | Datenrettung | Recupero dati | データ復旧 | 데이터 복구 | 数据恢复 | Восстановление данных | De terugwinning van gegevens | Ανάκτηση δεδομένων
Sitemap Site map1 2 3 4 | Spanish1 2 3 | French1 2 3 | German1 2 3 | Italian1 2 3 | Portuguese1 2 3 | Japanese1 2 3 | Korean1 2 3 | Chinese1 2 3 | Russian1 2 3 | Dutch1 2 3 | Greek1 2 3
Data Recovery Book English | Spanish | French | German | Italian | Portuguese | Japanese | Korean | Chinese | Russian | Dutch | Greek