|
|
DataMuseum.dkPresents historical artifacts from the history of: RegneCentralen RC759 "Piccoline" |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RegneCentralen RC759 "Piccoline" Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 2512 (0x9d0)
Types: TextFile
Names: »PMAP2SYM.C«
└─⟦33b70227c⟧ Bits:30003931/GEM_Develop_disk_3_CDOS.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
└─⟦this⟧ »PMAP2SYM.C«
└─⟦f18477172⟧ Bits:30003931/GEM_Develop_disk_1_CDOS.imd Disketter indleveret af Steffen Jensen (Piccolo/Piccoline)
└─⟦this⟧ »SAMP\PMAP2SYM.C«
/* PMAP2SYM */
/* PLINK module map file to GEMSID "SYM file */
/* 12 JULY 1985 */
/* */
/* This program creates a large model symbol file for use with */
/* GEMSID from a map file that was created using the "m" */
/* option in PLINK86. */
/* */
/* This program assumes that the substring "DATA" is part of */
/* the segment name or the class name for data segments. */
/* */
/* (use PMAPSYM.LNK to link this file) */
/* */
extern char *gets();
main()
æ
int done;
char bufÆ200Å;
int data_flg, code_flg;
char nameÆ13Å, seg_valÆ5Å, off_valÆ5Å;
char *buf_ptr, *buf_end;
done = 0;
while ( !done )
æ
if( gets(buf) == 0 )
æ
exit(1);
å
if( !strcmp(buf, "Modules:") )
done = 1;
å
while( gets(buf) )
æ
if( !strncmp( buf, " Segment ", 16 ) )
æ
if( find_str( buf, "DATA") )
æ
code_flg = 0;
data_flg = 1;
å
else
æ
code_flg = 1;
data_flg = 0;
å
å
else if ( !strncmp( buf, " ", 12 ) )
æ
buf_ptr = &bufÆ12Å;
buf_end = &bufÆ0Å + strlen(buf);
while( buf_ptr < buf_end )
æ
strncpy(name, buf_ptr, 8);
buf_ptr += 11;
strncpy(seg_val, buf_ptr, 4);
buf_ptr += 5;
strncpy(off_val, buf_ptr, 4);
buf_ptr += 7;
drop_blnk( name );
blnktozero( seg_val );
blnktozero( off_val );
if( data_flg )
æ
printf("0000 VARIABLESØt%s DATAØn",seg_val);
data_flg = 0;
å
if( code_flg )
æ
printf("0000 LABELSØt%s CODEØn",seg_val);
code_flg = 0;
å
printf("%s %sØn",off_val,name);
å
å
å
å
find_str( str1, str2 )
char *str1, *str2;
æ
int length;
length = strlen(str2);
while( *str1 )
æ
if( !strncmp( str1, str2, length ) )
return(1);
str1++;
å
return(0);
å
blnktozero( str )
char *str;
æ
while( *str )
æ
if( *str == ' ' )
*str = '0';
str++;
å
å
drop_blnk( str)
char *str;
æ
char *send;
send = str + strlen( str );
while( *(--send) == ' ');
*(send+1) = 0;
å
«eof»