home *** CD-ROM | disk | FTP | other *** search
- ===========================================================================
- BBS: The Abacus * HST/DS * Potterville, MI
- Date: 05-25-93 (16:18) Number: 109
- From: PAT DONOVAN Refer#: 164
- To: DONG NGUYEN Recvd: NO
- Subj: PSP Conf: (36) C Language
- ---------------------------------------------------------------------------
- #include <stdio.h> /* fprintf NULL*/
- #include <dos.h> /* _psp+ MK_FP */
-
- #ifndef __LARGE__
- error : BORLAND PRODUCT. try LARGE model
- #endif
-
- typedef struct{
- unsigned bit_0 : 1; /* written by + donated to public domain */
- unsigned bit_1 : 1; /* by pat donovan sept/92 */
- unsigned bit_2 : 1;
- unsigned bit_3 : 1; /* nb: I want my mommy! */
- unsigned bit_4 : 1; /* pat */
- unsigned bit_5 : 1;
- unsigned bit_6 : 1;
- unsigned bit_7 : 1;
- unsigned bit_8 : 1;
- }BYTELOOK;
- int offset[] ={0,0x0,0x2,0x4, 0x5,0x6,0x8,
- 0xa,0xe,0x12, 0x16,0x18,0x2c,
- 0x2e,0x32,0x34, 0x38,0x3c,0x40,
- 0x42,0x48,0x49, 0x50,0x53,0x5c,
- 0x6c,0x7c,0x0};
- int size[]={0,2,2,1,1,2, 2,4,4,4,2,
- 20,2,4,2,4, 4,4,2,6,1,
- 7,3,9,16,16, 4,0};
- char *msg[] = {
- " ",
- "_psp:00h int20 2 bytes", "_psp:02h lastbyte word",
- "_psp:04h blank1 byte", "_psp:05h serreg byte",
- "_psp:06h first_com_seg word", "_psp:08h remd 2 bytes",
- "_psp:0ah term_addr dword", "_psp:oeh ctrlbrk_add dword",
- "_psp:12h int24 dword", "_psp:16h psp_addr word",
- "_psp:18h JFT 20 bytes", "_psp:2ch envr word",
- "_psp:2eh SS/SP dword", "_psp:32h size_of_JFT word",
- "_psp:34h JFT ADDR_2 dword", "_psp:38h prv_psp_addr dword",
- "_psp:3ch blank2 4 bytes", "_psp:40h int21_ret 2 bytes",
- "_psp:42h blank3 6 bytes", "_psp:48h non_win_3 1 bytes",
- "_psp:49h blank4 7 bytes", "_psp:50h bserv_reg 3 bytes",
- "_psp:53h blank5 9 bytes", "_psp:5ch FCB1 16 bytes",
- "_psp:6ch FCB2 16 bytes", "_psp:7ch blank6 4 bytes",
- };
-
- void printbytes(long HEXADDRESS,unsigned count,unsigned line,
- char *label, FILE *f1)
- { unsigned num;
- static char buff[128];
- fprintf( f1," ADDRESS bytes %s _psp = %4X \n",label, _psp);
- for(num=0;num<count;num++,HEXADDRESS++){
- BYTELOOK one = *(BYTELOOK *)HEXADDRESS;
- long c = HEXADDRESS;
- fprintf( f1," %Fp %d %d %d %d %d %d %d %d ",HEXADDRESS,
- one.bit_1,one.bit_2,one.bit_3,one.bit_4,
- one.bit_5,one.bit_6,one.bit_7,one.bit_8);
- fprintf( f1,"asccii. %c HEX. %2X byte %3d \n",
- (*((char *) c)),(*((char *) c)), num );
- buff[num-1] = *(char *)c;
- }
- fprintf( f1,"%c %2d:%Fp %s %s \n\n",
- 219,line,HEXADDRESS-count,(char *)msg[line],(char *)buff);
- }
-
- int main(int argc, char *argv[]){
- char index=0;
-
-
- FILE *f1= fopen(argv[1], "w");
- if( !argc || f1 == NULL) f1= stdout;
-
- system("COMMAND");
-
- puts("this will create a file with <progname> output.nam ");
- puts(" or just dump 11K to the screen one line at a time.");
-
- for(index=1;index<27;index++)
- printbytes((long)MK_FP(_psp,offset[index]),
- size[index],index,msg[index],f1);
-
- fclose(f1);
-
- return(1);
- }
- /* i havo *no * idea why I shelled in this. Prob'ly to look at a memmap. pat */
-
-
- --- Maximus 2.01wb
- * Origin: Ned's Opus * Northern FDN Connection * (1:243/14)
- SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
- SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
- SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
-