home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
sigm
/
vol179
/
cutils.lbr
/
SECTRAN.C
< prev
next >
Wrap
Text File
|
1985-02-09
|
1KB
|
37 lines
/* Program to print a translation table based on the logged in drive. */
main()
{
int logdrv,bios,seldrv,sectran,dphadr,xtbl,dpbadr;
int sec,maxsec,physec;
logdrv=peek(4);
bios=getadr(1);
seldrv=bios+24;
sectran=bios+45;
dphadr=call(seldrv,0,0,logdrv,0);
printf("\n\nLogical to physical sector translation program");
printf(" ver 1.0 C.B. Mueller 12-16-82\n\n");
printf("Disk Parameter Header address = %x\n",dphadr);
printf("Translation Table Address = %x\n",xtbl=getadr(dphadr));
printf("Disk Paramater Block Address = %x\n",dpbadr=getadr(dphadr+10));
printf("Logical Sectors per Track = %dD\n\n",maxsec=peek(dpbadr));
sec = 0;
for (sec=0; sec < maxsec; sec++) {
printf("logical= %2d physical = %2d\n",sec,
physec=(call(sectran,0,0,sec,xtbl)));
}
exit();
}
getadr(lobyte)
int lobyte;
{
int lsbyte,msbyte,adr;
lsbyte=peek(lobyte);
msbyte=peek(lobyte+1);
adr = (msbyte * 0x100)+lsbyte;
return(adr);
}