#include #include #include #include main() { int i; char SBI_hdr[4]; char instname[32], instno[4]; char instdata[16]; int infd,outfd; infd = open("default.set",O_RDONLY); outfd = open("myinst.sb",O_CREAT|O_WRONLY); strcpy(SBI_hdr,"SBI"); SBI_hdr[3] = 0x1A; for(i = 0; i< 128; i++) { read(infd,instdata,16); sprintf(instname,"Inst %.03d",i); write(outfd,SBI_hdr,4); write(outfd,instname,32); write(outfd,instdata,16); } close(infd); close(outfd); } .