home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
sigm
/
vol179
/
cutils.lbr
/
CPMADR.C
next >
Wrap
Text File
|
1985-02-09
|
3KB
|
62 lines
/* program to experiment with cpm addresses */
main()
{
int wb,cs,ci,co,lo,po,ro,hd,sd,st,ss;
int sdma,rd,wd,rl,strn,dphadr,seldrv,logdrv;
int xtbl,diradr,dpbadr,dava,davb;
int spt,bsh,blm,exm,dsm,mdb,drm,al0;
char drv;
wb=getadr(1);
cs=wb+3; ci=cs+3; co=ci+3; lo=co+3; po=lo+3;
ro=po+3; hd=ro+3; sd=hd+3; st=sd+3; ss=st+3; sdma=ss+3;
rd=sdma+3; wd=rd+3; rl=wd+3; strn=rl+3;
Printf("\n\nCP/M Data Program Version 1.0 by C. B. Mueller 12/15/82\n\n");
printf("This program will print CP/M information based on your system");
printf(" size\nand attributes of the drive that it is run on.\n\n");
printf("%x = CCP Start Address\n",wb-0x1603);
printf("%x = BDOS Start Address\n",wb-0xE03);
printf("%x = BIOS start Address (Cold Boot)\n\n",wb-3);
printf("BIOS ENTRY ADDRESS\n");
printf("%x = Warm Boot\t\t%x = Select Disk\n",wb,sd);
printf("%x = Console Stat\t\t%x = Set Track Number\n",cs,st);
printf("%x = Console Input\t\t%x = Set Sector number\n",ci,ss);
printf("%x = Console Output\t\t%x = Set DMA Address\n",co,sdma);
printf("%x = List Output\t\t%x = Read Disk\n",lo,rd);
printf("%x = Punch Output\t\t%x = Write Disk\n",po,wd);
printf("%x = Reader Output\t\t%x = Return List Status\n",ro,rl);
printf("%x = Home Drive\t\t%x = Sector Translate\n\n",hd,strn);
logdrv=peek(4);
if(logdrv==0)drv='A';
else
drv='B';
dphadr=call(sd,0,0,logdrv,0);
printf("DRIVE %c DISK PARAMETER HEADER TABLES\n",drv);
printf("Disk Parmater Header Address = %x\n",dphadr);
printf("Translation Table Address = %x\n",xtbl=getadr(dphadr));
printf("Directory Buffer Address = %x\n",diradr=getadr(dphadr+8));
printf("Disk Parameter Block Address = %x\n",dpbadr=getadr(dphadr+10));
printf("Disk Allocation Vector = %x\n\n",dava=getadr(dphadr+14));
printf("DISK %c PARAMETER BLOCK TABLES\n");
printf("Logical Sectors per Track = %dD\n",spt=peek(dpbadr));
printf("Block Shift Factor = %dD\n",bsh=peek(dpbadr+2));
printf("Block Mask = %x\n",blm=peek(dpbadr+3));
printf("Extent Mask = %x\n",exm=peek(dpbadr+4));
printf("Max Disk Blocks = %dD\n",dsm=(getadr(dpbadr+5)+1));
printf("Max Directory Entries = %dD\n",drm=(peek(dpbadr+7)+1));
printf("Directory Block Alloc = %x\n",al0=peek(dpbadr+9));
exit();
}
getadr(lobyte)
int lobyte;
{
int lsbyte,msbyte,adr;
lsbyte=peek(lobyte);
msbyte=peek(lobyte+1);
adr = (msbyte * 0x100)+lsbyte;
return(adr);
}