Asked By
M Sajid
10 points
N/A
Posted on - 01/16/2012
Following is the memory dump of Drive Parameter Block that is retrieved using undocumented service 32 of Int 21h.
Following DPB (Drive Parameter Block) gives information about the logical drive which has FAT16 File system.Â
After reading the above dump of DPB (Drive Parameter Block), fill in the following table with required values.
Â
Detail of DPB dump
Of FAT16 Volume
Â
|
Value In Hexadecimal
|
Value In decimal
|
Logical Drive Letter.
Â
|
Â
|
Â
|
Unit No.
Â
|
Â
|
Â
|
Bytes per Sector.
Â
|
Â
|
Â
|
Highest Sector No. within a cluster.
Â
|
Â
|
Â
|
Sector Per Cluster
|
Â
|
Â
|
Shift count.
Â
|
Â
|
Â
|
Reserved sectors.
Â
|
Â
|
Â
|
Number of Fats
Â
|
Â
|
Â
|
Root Directory Entries
|
Â
|
Â
|
First Sector Containing user Data
Â
|
Â
|
Â
|
Highest Cluster Number
Â
|
Â
|
Â
|
No of sectors per FAT
Â
|
Â
|
Â
|
Sector number of First Directory
|
Â
|
Â
|
Â
Write a Simple Program in C language
C PROGRAM
Â
/*A summation program*/
Â
Â
#include <stdio.h>
#include <conio.h>
Â
int menu(){
char ch;
clrscr();
Â
printf("A.Summation of all numbers from 1 to nn");
printf("B.Summation of all the squares of the numbers from 1 to nn");
printf("C.Summation of all even numbers from 1 to nn");
printf("D.Summation of all odd numbers from 1 to nn");
printf("E.Exit the programnn");
printf("Enter the letter of your choice: ");
scanf(" %c", &ch);
return ch;
}
Â
int Summationofnumbers(int n){
int sum, i;
sum=0;
for(i=0; i<=n; i++){
sum=sum+i;
}
return sum;
}
Â
int Summationofsquares(int n){
int product=0, i;
for(i=0; i<=n; i++){
product=(i*i)+product;
}
return product;
}
Â
int Summationofeven(int n){
int even=0, i, rem;
for(i=0; i<=n; i++){
rem=i%2;
if (rem==0)
even=even+i;
}
return even;
}
Â
int Summationofodd(int n){
int odd=0, i, rem;
for(i=0; i<=n; i++){
rem=i%2;
if (rem!=0)
odd=odd+1;
}
return odd;
}
Â
int input(void){
int n;
printf("nEnter a number: ");
scanf("%d", &n);
return n;
}
Â
main()
{
int ch, n, sum, square, even, odd;
ch=menu();
switch(ch){
case 'A':
case 'a': n=input();
sum=Summationofnumbers(n);
printf("The summation of all numbers from 1 to %d is %d.", n, Summationofnumbers);
break;
Â
case 'B':
case 'b': n=input();
square=Summationofsquares(n);
printf("The summation of all the squares of the numbers from 1 to %d is %d.", n, Summationofsquares);
break;
Â
case 'C':
case 'c': n=input();
even=Summationofeven(n);
printf("The summation of all even numbers from 1 to %d is %d.", n, Summationofeven);
break;
Â
case 'D':
case 'd': n=input();
odd=Summationofodd(n);
printf("The summation of all odd numbers from 1 to %d is %d.", n, Summationofodd);
break;
Â
case 'E':
case 'e': printf("nnGoodbye! Press any key to continue…");
break;
Â
default: printf("nWrong Choice!n");
printf("nEnter only A, B, C, D or E");
break;
}
getch();
}
Â