/ * ABSOLUTE LOADER */
#include #include #include void main() { FILE*f1,*f2; unsigned int str; char a[10],b[10]; printf("Enter the starting address"); scanf("%u",&str); f1=fopen("ref.txt","r"); f2=fopen("output.txt","w"); while(!feof(f1)) { fscanf(f1,"%s%s",a,b); fprintf(f2,"\t%u\t%s\n",str,b); str++; } fclose(f2); fclose(f1); }
INPUT //REF.TXT
LDA 00 LDCH 50 LDX 04 JLT 38 ADD 18
OUTPUT Enter the starting address:4000 //OUTPUT.TXT
4000 00 4001 50 4002 04 4003 38 4004 18
|
No responses found. Be the first to respond and make money from revenue sharing program.
|