Decimal to Binary Conversion Function program

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

//////// 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

Previous page

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

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 
Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor