⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 说明.txt

📁 字节取反
💻 TXT
字号:
0、1转换





注意:程序中调用了DOS的功能调用,如:	AX=3D00H(对读访问打开文件)

					AX=3E00H(关闭文件描述字)

					AH=4202H(LSeek移动读/写指针--从文件尾开始移动指针)





程序代码:

#include<stdio.h>
#include<dos.h>
main()
{
 char c,fname[12],fname2[12];
 FILE *output,*input;
 union REGS in,out;
 struct SREGS segreg;
 long int i,filechar;
 int tmp;
 printf("Please input filename to jia-mi or jie-mi:\n");
 scanf("%s",fname);
 printf("output filename:\n");
 scanf("%s",fname2);
 input=fopen(fname,"r");
 output=fopen(fname2,"w");
 if(input==NULL)
 {
  printf("Cannot open file or file not exist!!\n");
  exit(1);
 };
 if(output==NULL)
 {
  printf("Cannot open file!!\n");
  exit(1);
 };

 in.x.ax=0x3d00;
 in.x.dx=FP_OFF(fname);
 segreg.ds=FP_SEG(fname);
 intdosx(&in,&out,&segreg);
 in.x.bx=out.x.ax;
 tmp=in.x.bx;
 in.x.cx=0;
 in.x.dx=0;
 in.x.ax=0x4202;
 intdos(&in,&out);
 filechar=16*out.x.dx+out.x.ax;
 in.x.bx=tmp;
 in.x.ax=0x3e00;
 intdos(&in,&out);

 for(i=0;i<filechar;i++)
 {
  c=fgetc(input);
  if(c=='\n')	i++;
  c=(c^0xff);
  fputc(c,output);
 }
 if(fclose(input))	printf("File close error\n");
 if(fclose(output))	printf("File close error\n");
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -