易码技术论坛

 找回密码
 加入易码
搜索
楼主: gameghost

[下载]星星上的6502编译工具

[复制链接]
 楼主| 发表于 2005-6-3 04:50:00 | 显示全部楼层
66楼的错误:
第一句话指的还是输入GB的问题,不是宏。
(我想要改的时候已经是30.95分钟了,正好改不了)
发表于 2005-6-3 06:36:00 | 显示全部楼层
label应该是标号吧,就是相当于某一行程序的标识
跳转时是跳转到label而不是绝对地址。
发表于 2005-6-3 09:58:00 | 显示全部楼层
还是不对啊~
看程序:
.ORG $4000
.DB $AE,$EE,$EA,
.DB $00,$10,$00,$20
JMP START
.DB $70,$03,$31
.DB $03,$FF,$FF
START:
INT $C737
INT $C72A
LDX #$04
LOOP:
LDA TXT-1,X
STA $02BF,X
DEX
BNE LOOP
F:
LDA $0392
PHA
LDA $0393
PHA
LDA #$00
STA $0393
LDA #$01
STA $0392
INT $C719
INT $C00A
PLA
STA $0392
PLA
STA $0393
RTS
TXT:
.DB "TEST"

编译好了运行就死机
发表于 2005-6-3 10:23:00 | 显示全部楼层
文件入口和标号地址总是错误
发表于 2005-6-3 20:31:00 | 显示全部楼层
lava似乎对系统保护不足
我在汇编完后不小心输了一个空文件名
结果文件系统被破坏 no load hot key ..
用 brk 0524 重置文件系统后才恢复
当然网络被清空了 唉
看来lava离java的安全性还远着呢
 楼主| 发表于 2005-6-3 22:06:00 | 显示全部楼层
回70楼

目前没有加参数和标号地址的操作

所以不能用 LDA TXT-1,X

发表于 2005-6-4 07:49:00 | 显示全部楼层
哦~ 谢谢了  看来和电脑上还有一段距离,别忘了时常更新哦~
 楼主| 发表于 2005-6-4 09:10:00 | 显示全部楼层
由于条件原因,现在程序可能不能继续修改,我就在这里先帖出来了:

(有些地方别嫌幼稚,没办法,有的是lava的问题,有的是还没完成,多余的东西以后再删去)

这个程序好象还没改进文件名的输入和宏的部分,最近改的实在传不上来了。

还有上次忘说了,.org可以随处使用,.org后地址就变了,为的是可以把某段程序放到某段地址,主要针对JSR和JMP,但是目前用处不大,因为没有写标号地址的操作,不定义的话默认为$0000。

#define UP 0x14
#define DOWN 0x15
#define LEFT 0x17
#define RIGHT 0x16
#define CAPS 18
#define UUP 19
#define DDOWN 14
#define RESAY 16
#define SAY 15
#define POINT 46
#define ZERO 48
#define SHIFT 26
#define HELP 25
#define F_A 28
#define F_B 29
#define F_C 30
#define F_D 31
char chose;
char inp;
char fp;
char did;
char dose;
char word;
long add;
long addlcd;
char kinnow;
char makefp;
int maxlength;
char demo;
char wrong;
long addnow;
int enters;
char ptnums;
char bnums;
char jnums;
long org;
char orged;
char mwd;
char hexch[4];
char line[27];
char ch[60];
char k[11];
char hexa[16]={'0','b','n','m','g','h','j','t','y','u','a','.','c','d','e','f'};
char hexb[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
char hexd[16]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
char hex[256][3]={"00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F",
               "10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F",
               "20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F",
               "30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F",
               "40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F",
               "50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F",
               "60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F",
               "70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F",
               "80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F",
               "90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F",
               "A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF",
               "B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF",
               "C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF",
               "D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF",
               "E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF",
               "F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"};
char chr[768]={'I','N','T','O','R','A',0,0,0,0,0,0,0,0,0,0,0,0,
               'A','S','L',0,0,0,'P','H','P','O','R','A','A','S','L',
               0,0,0,0,0,0,'O','R','A','A','S','L',0,0,0,'B','P','L',
               'O','R','A',0,0,0,0,0,0,0,0,0,'O','R','A','A','S','L',
               0,0,0,'C','L','C','O','R','A',0,0,0,0,0,0,0,0,0,
               'O','R','A','A','S','L',0,0,0,'J','S','R','A','N','D',
               0,0,0,0,0,0,'B','I','T','A','N','D','R','O','L',0,0,0,
               'P','L','P','A','N','D','R','O','L',0,0,0,'B','I','T',
               'A','N','D','R','O','L',0,0,0,'B','M','I','A','N','D',
               0,0,0,0,0,0,0,0,0,'A','N','D','R','O','L',0,0,0,
               'S','E','C','A','N','D',0,0,0,0,0,0,0,0,0,'A','N','D',
               'R','O','L',0,0,0,'R','T','I','E','O','R',0,0,0,0,0,0,
               0,0,0,'E','O','R','L','S','R',0,0,0,'P','H','A',
               'E','O','R','L','S','R',0,0,0,'J','M','P','E','O','R',
               'L','S','R',0,0,0,'B','V','C','E','O','R',0,0,0,0,0,0,
               0,0,0,'E','O','R','L','S','R',0,0,0,'C','L','I',
               'E','O','R',0,0,0,0,0,0,0,0,0,'E','O','R','L','S','R',
               0,0,0,'R','T','S','A','D','C',0,0,0,0,0,0,0,0,0,
               'A','D','C','R','O','R',0,0,0,'P','L','A','A','D','C',
               'R','O','R',0,0,0,'J','M','P','A','D','C','R','O','R',
               0,0,0,'B','V','S','A','D','C',0,0,0,0,0,0,0,0,0,
               'A','D','C','R','O','R',0,0,0,'S','E','I','A','D','C',
               0,0,0,0,0,0,0,0,0,'A','D','C','R','O','R',0,0,0,0,0,0,
               'S','T','A',0,0,0,0,0,0,'S','T','Y','S','T','A',
               'S','T','X',0,0,0,'D','E','Y',0,0,0,'T','X','A',
               0,0,0,'S','T','Y','S','T','A','S','T','X',0,0,0,
               'B','C','C','S','T','A',0,0,0,0,0,0,'S','T','Y',
               'S','T','A','S','T','X',0,0,0,'T','Y','A','S','T','A',
               'T','X','S',0,0,0,0,0,0,'S','T','A',0,0,0,0,0,0,
               'L','D','Y','L','D','A','L','D','X',0,0,0,'L','D','Y',
               'L','D','A','L','D','X',0,0,0,'T','A','Y','L','D','A',
               'T','A','X',0,0,0,'L','D','Y','L','D','A','L','D','X',
               0,0,0,'B','C','S','L','D','A',0,0,0,0,0,0,'L','D','Y',
               'L','D','A','L','D','X',0,0,0,'C','L','V','L','D','A',
               'T','S','X',0,0,0,'L','D','Y','L','D','A','L','D','X',
               0,0,0,'C','P','Y','C','M','P',0,0,0,0,0,0,'C','P','Y',
               'C','M','P','D','E','C',0,0,0,'I','N','Y','C','M','P',
               'D','E','X',0,0,0,'C','P','Y','C','M','P','D','E','C',
               0,0,0,'B','N','E','C','M','P',0,0,0,0,0,0,0,0,0,
               'C','M','P','D','E','C',0,0,0,'C','L','D','C','M','P',
               0,0,0,0,0,0,0,0,0,'C','M','P','D','E','C',0,0,0,
               'C','P','X','S','B','C',0,0,0,0,0,0,'C','P','X',
               'S','B','C','I','N','C',0,0,0,'I','N','X','S','B','C',
               'N','O','P',0,0,0,'C','P','X','S','B','C','I','N','C',
               0,0,0,'B','E','Q','S','B','C',0,0,0,0,0,0,0,0,0,
               'S','B','C','I','N','C',0,0,0,'S','E','D','S','B','C',
               0,0,0,0,0,0,0,0,0,'S','B','C','I','N','C',0,0,0};
//xx 1 [bne]xx 2 #$xx 3 $xx 4 $xx,X 5 $xx,Y 6 ($xx,X) 7 ($xx),Y 8
//$xxxx 9 $xxxx,X 10 $xxxx,y 11
// ($xxxx) 12
char kind[256]={9,7,0,0,0,4,4,0,1,3,1,0,0,9,9,0,2,8,0,0,0,5,5,0,1,//25
                11,0,0,0,10,10,0,9,7,0,0,4,4,4,0,1,3,1,0,9,9,9,0,9,//24
                8,0,0,0,6,6,0,1,11,0,0,0,10,10,0,1,7,0,0,0,4,4,0,1,//24
                3,1,0,9,9,9,0,2,8,0,0,0,5,5,0,1,11,0,0,0,10,10,0,1,
                7,0,0,0,4,4,0,1,3,1,0,12,9,9,0,2,8,0,0,0,5,5,0,1,11,
                0,0,0,10,10,0,0,7,0,0,4,4,4,0,1,0,1,0,9,9,9,0,2,8,
                0,0,5,5,6,0,1,11,1,0,0,10,0,0,3,7,3,0,4,4,4,0,1,3,1,
                0,9,9,9,0,2,8,0,0,5,5,6,0,1,11,1,0,10,10,10,0,3,7,
                0,0,4,4,4,0,1,3,1,0,9,9,9,0,2,8,0,0,0,5,5,0,1,11,0,
                0,0,10,10,0,3,7,0,0,4,4,4,0,1,3,1,0,9,9,9,0,2,8,0,0,
                0,5,5,0,1,11,0,0,0,10,10,0};

//A:and,asl,adc
//B:bit,brk,beq,bne,bcc,bcs,bpl,bmi,bvc,bvs
//D:dec,dex,dey,
//C:cmp,cpx,cpy,clc,cld,cli,clv
//E:eor
//I:inc,inx,iny
//J:jmp,jsr
//L:lsr
//N:nop
//ora
//P:pha,pla,php,plp
//R:rts,rti,rol,ror
//S:sta,stx,sty,sbc,sec,sed,sei
//T:tax,tay,txa,tya,tsx,txs

//kind:
//1.xx 2.[ccc]xx 3.#$xx 4.$xx 5.$xx,X 6.$xx,Y 7.($xx,X) 8,($xx),Y
//9.$xxxx 10.$xxxx,X 11.$xxxx,y 12.($xxxx)
//寻址指令长度
//1,2,2,2,2,2,2,2,3,3,3,3
//隐含寻址
char pha=0x48;
char pla=0x68;
char php=0x08;
char plp=0x28;
char tax=0xaa;
char tay=0xa8;
char txa=0x8a;
char tya=0x98;
char tsx=0xba;
char txs=0x9a;
char clc=0x18;
char sec=0x38;
char cld=0xd8;
char sed=0xf8;
char cli=0x58;
char sei=0x78;
char clv=0xb8;
char inx=0xe8;
char iny=0xc8;
char dex=0xca;
char dey=0x88;
//相对寻址
char beq[2]={0x00,0xf0};
char bne[2]={0x00,0xd0};
char bcc[2]={0x00,0x90};
char bcs[2]={0x00,0xb0};
char bpl[2]={0x00,0x10};
char bmi[2]={0x00,0x30};
char bvc[2]={0x00,0x50};
char bvs[2]={0x00,0x70};
//绝对寻址
char ldakind[11]={0x00,0x00,0xa9,0xa5,0xb5,0x00,0xa1,0xb1,0xad,0xbd,0xb9};
char ldxkind[11]={0x00,0x00,0xa2,0xa6,0x00,0xb6,0x00,0x00,0xae,0x00,0xbe};
char ldykind[11]={0x00,0x00,0xa0,0xa4,0xb4,0x00,0x00,0x00,0xac,0xbc,0x00};
char stakind[11]={0x00,0x00,0x00,0x85,0x95,0x00,0x81,0x91,0x8d,0x9d,0x99};
char stxkind[11]={0x00,0x00,0x00,0x86,0x00,0x96,0x00,0x00,0x8e,0x00,0x00};
char stykind[11]={0x00,0x00,0x00,0x84,0x94,0x00,0x00,0x00,0x8c,0x00,0x00};
char adckind[11]={0x00,0x00,0x69,0x65,0x75,0x00,0x61,0x71,0x6d,0x7d,0x79};
char sbckind[11]={0x00,0x00,0xe9,0xe5,0xf5,0x00,0xe1,0xf1,0xed,0xfd,0xf9};
char andkind[11]={0x00,0x00,0x29,0x25,0x35,0x00,0x21,0x31,0x2d,0x3d,0x39};
char orakind[11]={0x00,0x00,0x09,0x05,0x15,0x00,0x01,0x11,0x0d,0x1d,0x19};
char eorkind[11]={0x00,0x00,0x49,0x45,0x55,0x00,0x41,0x51,0x4d,0x5d,0x59};
char cmpkind[11]={0x00,0x00,0xc9,0xc5,0xd5,0x00,0xc1,0xd1,0xcd,0xdd,0xd9};
char cpxkind[11]={0x00,0x00,0xe0,0xe4,0x00,0x00,0x00,0x00,0xec,0x00,0x00};
char cpykind[11]={0x00,0x00,0xc0,0xc4,0x00,0x00,0x00,0x00,0xcc,0x00,0x00};
char bitkind[11]={0x00,0x00,0x00,0x24,0x00,0x00,0x00,0x00,0x2c,0x00,0x00};
char inckind[11]={0x00,0x00,0x00,0xe6,0xf6,0x00,0x00,0x00,0xee,0xfe,0x00};
char deckind[11]={0x00,0x00,0x00,0xc6,0xd6,0x00,0x00,0x00,0xce,0xde,0x00};
char aslkind[11]={0x0a,0x00,0x00,0x06,0x16,0x00,0x00,0x00,0x0e,0x1e,0x00};
char lsrkind[11]={0x4a,0x00,0x00,0x46,0x56,0x00,0x00,0x00,0x4e,0x5e,0x00};
char rolkind[11]={0x2a,0x00,0x00,0x26,0x36,0x00,0x00,0x00,0x2e,0x3e,0x00};
char rorkind[11]={0x6a,0x00,0x00,0x66,0x76,0x00,0x00,0x00,0x6e,0x7e,0x00};
char intkind[11]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
//openfile-----------------------------------------------------------
char openfile(){
char filept;
char dir[20][20];
char dirdeep;
char filename[20];
did=1;
dose++;
dirdeep=0;
filept=0;
ChDir("/");
for(;;){
  if(FileList(dir[dirdeep])){
   if(ChDir(dir[dirdeep]))dirdeep++;
   else{
    sprintf(filename,dir[dirdeep]);
    filept=fopen(filename,"r");
    return filept;
   }
  }
  else {
   ChDir("..");
   if(dirdeep==0){
    did=0;
    dose--;
    return filept;
   }
   else dirdeep--;
  }
}
}
//savefile
char savefile(){
char filept;
char a;
char han[3];
char zc[20];
char iiii;
did=1;
dose++;
filept=0;
ChDir("/");
SetScreen(0);
Locate(0,0);
memset(_TEXT,' ',156);
printf("\n输入绝对路径:\n");
  for(a=0;a<20;a++){
   iiii=GetWord(3);
   if((iiii&0xff00)==0&&isprint(iiii)){
    zc[a]=iiii;
    printf("%c",iiii);
   }
   else if(iiii<0){
    memset(_TEXT+80,' ',20);
    zc[a]=iiii;
    han[0]=zc[a];
    a++;
    zc[a]=iiii>>8;
    han[1]=zc[a];
    printf("%s",han);
   }
   if(iiii==13){
   
    break;
   }
   if(iiii==27){
   did=0;
   return filept;
   }
  }
  filept=fopen(zc,"w+");
  return filept;
}

[此贴子已经被作者于2005-6-4 9:26:20编辑过]

 楼主| 发表于 2005-6-4 09:12:00 | 显示全部楼层
//dectohex-----------------------------------------------------------
void dectohex(long deca){
long decb,decc,decd;
char lp;
for(lp=0;lp<4;lp++)hexch[lp]=0;
decb=deca;
deca=deca/0x10;
deca=deca*0x10;
hexch[3]=hexb[hexd[decb-deca]];
decb=deca;
decb=decb/0x100;
decb=decb*0x100;
hexch[2]=hexb[hexd[(deca-decb)/0x10]];
decc=decb;
decc=decc/0x1000;
decc=decc*0x1000;
hexch[1]=hexb[hexd[(decb-decc)/0x100]];
decd=decc;
decd=decd/0x10000;
decd=decd*0x10000;
hexch[0]=hexb[hexd[(decc-decd)/0x1000]];
}
//one-----------------------------------------------------------
void one(){
char a;
for(a=5;a<27;a++)line[a]=32;
line[6]=hex[word][0];
line[7]=hex[word][1];
line[15]=chr[word*3];
line[16]=chr[word*3+1];
line[17]=chr[word*3+2];
line[19]=0;
}
//two-----------------------------------------------------------
void two(){
char a;
long c;
for(a=5;a<27;a++)line[a]=32;
fread(&a,1,1,fp);
addlcd++;
line[6]=hex[word][0];
line[7]=hex[word][1];
line[9]=hex[a][0];
line[10]=hex[a][1];
line[15]=chr[word*3];
line[16]=chr[word*3+1];
line[17]=chr[word*3+2];
if(kind[word]>4)goto five;
if(kind[word]==2){
  line[19]='$';
  if(a<0x80)c=addlcd+a;
  else c=addlcd-256+a;
  dectohex(c);
  line[20]=hexch[0];
  line[21]=hexch[1];
  line[22]=hexch[2];
  line[23]=hexch[3];
  line[24]=0;
  return;
}
if(kind[word]==3){
  line[19]='#';
  line[20]='$';
  line[21]=hex[a][0];
  line[22]=hex[a][1];
  line[23]=0;
  return;
}
if(kind[word]==4){
  line[19]='$';
  line[20]=hex[a][0];
  line[21]=hex[a][1];
  line[22]=0;
  return;  
}
five:
if(kind[word]==5){
  line[19]='$';
  line[20]=hex[a][0];
  line[21]=hex[a][1];
  line[22]=',';
  line[23]='X';
  line[24]=0;
  return;
}
if(kind[word]==6){
  line[19]='$';
  line[20]=hex[a][0];
  line[21]=hex[a][1];
  line[22]=',';
  line[23]='Y';
  line[24]=0;
  return;
}
if(kind[word]==7){
  line[19]='(';
  line[20]='$';
  line[21]=hex[a][0];
  line[22]=hex[a][1];
  line[23]=',';
  line[24]='X';
  line[25]=')';
  line[26]=0;
  return;
  }
if(kind[word]==8){
  line[19]='(';
  line[20]='$';
  line[21]=hex[a][0];
  line[22]=hex[a][1];
  line[23]=')';
  line[24]=',';
  line[25]='Y';
  line[26]=0;
  return;
}
}
//three-----------------------------------------------------------
void three(){
char b;
char c;
long d;
for(b=5;b<27;b++)line=32;
fread(&b,1,1,fp);
fread(&c,1,1,fp);
addlcd=addlcd+2;
line[6]=hex[word][0];
line[7]=hex[word][1];
line[9]=hex[0];
line[10]=hex[1];
line[12]=hex[c][0];
line[13]=hex[c][1];
line[15]=chr[word*3];
line[16]=chr[word*3+1];
line[17]=chr[word*3+2];
if(kind[word]==9){
line[19]='$';
line[20]=hex[c][0];
line[21]=hex[c][1];
line[22]=hex[0];
line[23]=hex[1];
line[24]=0;
return;
}
if(kind[word]==10){
line[19]='$';
line[20]=hex[c][0];
line[21]=hex[c][1];
line[22]=hex[0];
line[23]=hex[1];
line[24]=',';
line[25]='X';
line[26]=0;
return;
}
if(kind[word]==11){
line[19]='$';
line[20]=hex[c][0];
line[21]=hex[c][1];
line[22]=hex[0];
line[23]=hex[1];
line[24]=',';
line[25]='Y';
line[26]=0;
return;
}
else{
line[19]='(';
line[20]='$';
line[21]=hex[c][0];
line[22]=hex[c][1];
line[23]=hex[0];
line[24]=hex[1];
line[26]=')';
line[27]=0;
return;
}
}
//lookfile-----------------------------------------------------------
void lookfile(){
char shortadd[5];
long shortch[4];
char times;
char othertime;
char loop;
char isword;
char loopa;
char wordlong;
long addsb;
char timeall;
long addrts[100];
char jmptime;
dose=2;
L1:ClearScreen();
TextOut(20,33,"请选择要反汇编的文件:",1);
Refresh();
if(getchar()==27){
  did=0;
  return;
}
fp=openfile();
if(did==0)return;
if(fp==0){
  ClearScreen();
  TextOut(56,31,"无法打开",128);
  Refresh();
  getchar();
  goto L1;
}
for(loop=0;loop<5;loop++)shortadd[loop]=0;
for(loop=0;loop<4;loop++)shortch[loop]=0;
ClearScreen();
TextOut(13,22,"输入虚拟反汇编开始地址:",1);
times=0;
shortadd[0]=48;
shortadd[1]=0;
for(;;){
  if(times<2){
   othertime=0;
  }
  else othertime=times-1;
  if(times==0){
   shortadd[0]=48;
   shortadd[1]=0;
   shortch[0]=0;
   shortch[1]=0;
  }
  Rectangle(75-othertime*3,38,85+othertime*3,52,1);
  TextOut(77-othertime*3,40,shortadd,1);
  Block(77-othertime*3,40,83+othertime*3,50,2);
  Refresh();
  Block(40,38,120,53,0);
  isword=0;
  inp=getchar();
  for(loop=0;loop<16;loop++){
   if(inp==hexa[loop]){
    if(times==4)continue;
    isword=1;
    break;
   }
  }
  if(isword==1){
   shortadd[times]=hexb[loop];
   shortch[times]=hexd[loop];
   times++;
   }
  else{
   if(inp==27){
    fclose(fp);
    goto L1;
   }
   if(inp==13){
    for(loop=0;loop<times-1;loop++){
     for(loopa=0;loopa<=loop;loopa++)shortch[loopa]=shortch[loopa]*16;
    }
    addsb=shortch[0]+shortch[1]+shortch[2]+shortch[3];
    break;
   }
   if(inp==LEFT&&times>0){
    times--;
    shortadd[times]=0;
    shortch[times]=0;
   }
  }
}
add=0;
addlcd=add+addsb;
L2:
for(;;){
  fseek(fp,add,0);
  timeall=0;
  ClearScreen();
  for(loop=0;loop<6;loop++){
   fread(&word,1,1,fp);
   dectohex(addlcd);
   line[0]=hexch[0];
   line[1]=hexch[1];
   line[2]=hexch[2];
   line[3]=hexch[3];
   line[4]='-';
   addlcd++;
   if(kind[word]==1){one();shortadd[loop]=1;timeall=timeall+1;}
   else if(kind[word]<9&&kind[word]>1){two();shortadd[loop]=2;timeall=timeall+2;}
   else if(kind[word]>8){three();shortadd[loop]=3;timeall=timeall+3;}
   else {
    for(loopa=5;loopa<27;loopa++)line[loopa]=32;
    line[6]=hex[word][0];
    line[7]=hex[word][1];
    line[15]='?';
    line[16]=0;
    shortadd[loop]=1;
    timeall=timeall+1;
   }
   TextOut(0,loop*12+3,line,1);
  }
  Refresh();
  addlcd=addlcd-timeall;
  inp=getchar();
  if(inp==LEFT){
   if(addlcd>addsb){
    addlcd=addlcd-1;
    add=addlcd-addsb;
   }
  }
  if(inp==RIGHT){
   addlcd=addlcd+1;
   add=addlcd-addsb;
  }
  if(inp==DOWN){
   addlcd=addlcd+shortadd[0];
   add=addlcd-addsb;
  }
  
  if(inp==UP){
   addlcd=addlcd;
   if(addlcd==addsb)continue;
   addlcd--;
   add=addlcd-addsb;
   fseek(fp,add,0);
   fread(&word,1,1,fp);
   for(;;){
    if(kind[word]>0)break;
    else{
     if(addlcd==addsb)break;
     addlcd--;
     add=addlcd-addsb;
     fseek(fp,add,0);
     fread(&word,1,1,fp);
    }
   }
  }
  if(inp=='j'){
   if(jmptime==99)continue;
   fseek(fp,add,0);
   fread(&word,1,1,fp);
   if(kind[word]==2){
    fread(&word,1,1,fp);
    addrts[jmptime]=addlcd;
    if(word<0x80)add=addlcd+word+2;
    else add=addlcd-256+word+2;
    if(add>=addsb&&add<0xc000){
     addlcd=add;
     jmptime++;
    }
    add=addlcd-addsb;
    fseek(fp,add,0);
   }
   else if(kind[word]>8){
    if(word!=0){
     addrts[jmptime]=addlcd;
     fread(&word,1,1,fp);
     fread(&times,1,1,fp);
     add=times*256+word;
     if(add>=addsb&&add<0xc000){
      addlcd=add;
      jmptime++;
     }
     add=addlcd-addsb;
     fseek(fp,add,0);
    }
   }
   else fseek(fp,add,0);
  }
  if(inp=='r'&&jmptime>0){
   jmptime--;
   addlcd=addrts[jmptime];
   add=addlcd-addsb;
   fseek(fp,add,0);
  }
  if(inp==27){
    fclose(fp);
    goto L1;
  }
  if(inp==32){
L3:for(loop=0;loop<5;loop++)shortadd[loop]=0;
   for(loop=0;loop<4;loop++)shortch[loop]=0;
   ClearScreen();
   TextOut(47,22,"跳转地址到:",1);
   times=0;
   shortadd[0]=48;
   shortadd[1]=0;
   for(;;){
    if(times<2){
     othertime=0;
    }
    else othertime=times-1;
    if(times==0){
     shortadd[0]=48;
     shortadd[1]=0;
     shortch[0]=0;
     shortch[1]=0;
    }
    Rectangle(75-othertime*3,38,85+othertime*3,52,1);
    TextOut(77-othertime*3,40,shortadd,1);
    Block(77-othertime*3,40,83+othertime*3,50,2);
    Refresh();
    Block(40,38,120,53,0);
    isword=0;
    inp=getchar();
    for(loop=0;loop<16;loop++){
     if(inp==hexa[loop]){
      if(times==4)continue;
      isword=1;
      break;
     }
    }
    if(isword==1){
     shortadd[times]=hexb[loop];
     shortch[times]=hexd[loop];
     times++;
    }
    else{
     if(inp==27){
      goto L2;
     }
     if(inp==13){
      for(loop=0;loop<times-1;loop++){
       for(loopa=0;loopa<=loop;loopa++)shortch[loopa]=shortch[loopa]*16;
      }
      if((shortch[0]+shortch[1]+shortch[2]+shortch[3])<addsb){
       Block(40,38,120,53,0);
       TextOut(44,40,"不存在的地址",2);
       Refresh();
       getchar();
       goto L3;
      }
      addlcd=shortch[0]+shortch[1]+shortch[2]+shortch[3];
      add=addlcd-addsb;
      fseek(fp,add,0);
      break;
     }
     if(inp==LEFT&&times>0){
      times--;
      shortadd[times]=0;
      shortch[times]=0;
     }
    }
   }
  }
}
}
//-------------------------------------------------------------------
long hexchtonum(){
char loop,loopa,a;
long shortch[4];
long longnum;
for(loop=0;loop<4;loop++){
  for(a=0;a<16;a++)if(hexb[a]==ch[loop])shortch[loop]=hexd[a];
}
for(loop=0;loop<3;loop++)for(a=0;a<=loop;a++)shortch[a]=shortch[a]*16;
longnum=shortch[0]+shortch[1]+shortch[2]+shortch[3];
return longnum;
}
long decchtonum(){
char loop,loopa;
char chl;
long shortch[6];
long longnum;
for(chl=0;chl<7;chl++)if(ch[chl]<48||ch[chl]>57)break;
chl--;
for(loop=0;loop<chl;loop++){
  for(loopa=0;loopa<=loop;loopa++)shortch[loopa]=(ch[loopa]-48)*10;
}
longnum=shortch[0]+shortch[1]+shortch[2]+shortch[3]+shortch[4];
return longnum;
}
 楼主| 发表于 2005-6-4 09:17:00 | 显示全部楼层
//-------------------------------------------------------------------
void makea(){

if(demo==1)return;
fwrite(&mwd,1,1,makefp);
}
void makeb(){
char ma,mb,mc,md,me,mf;
wrong=0;
if(demo==1)return;
if(ch[maxlength]=='#'){kinnow=2;maxlength++;goto ko;}
if(ch[maxlength]=='$'&&ch[maxlength+4]=='X'){kinnow=4;goto ko;}
if(ch[maxlength]=='$'&&ch[maxlength+4]=='Y'){kinnow=5;goto ko;}
if(ch[maxlength]=='('&&ch[maxlength+6]==')'&&ch[maxlength+5]=='X'){kinnow=6;goto ko;}
if(ch[maxlength]=='('&&ch[maxlength+6]=='Y'){kinnow=7;goto ko;}
if(ch[maxlength]=='$'&&ch[maxlength+6]=='X'){kinnow=9;goto ko;}
if(ch[maxlength]=='$'&&ch[maxlength+6]=='Y'){kinnow=10;goto ko;}
if(ch[maxlength]=='$'&&((ch[maxlength+3]>47&&ch[maxlength+3]<58)||(ch[maxlength+3]>64&&ch[maxlength+3]<71))){kinnow=8;goto ko;}
if(ch[maxlength]=='$'){kinnow=4;goto ko;}
else {
kinnow=0;
}
k
if(kinnow==0){
ma=k[kinnow];
fwrite(&ma,1,1,makefp);
addnow=addnow+1;
return;
}
if(kinnow<8&&kinnow>1){
ma=k[kinnow];
for(md=0;md<16;md++){
  if(ch[maxlength+1]==hexb[md]){mb=hexd[md];break;}
}
for(md=0;md<16;md++){
  if(ch[maxlength+2]==hexb[md]){mc=hexd[md];break;}
}
mc=mb*16+mc;
fwrite(&ma,1,1,makefp);
fwrite(&mc,1,1,makefp);
addnow=addnow+2;
return;
}
else{
ma=k[kinnow];
for(md=0;md<16;md++){
  if(ch[maxlength+1]==hexb[md]){mb=hexd[md];break;}
}
for(md=0;md<16;md++){
  if(ch[maxlength+2]==hexb[md]){mc=hexd[md];break;}
}
mc=mb*16+mc;
for(md=0;md<16;md++){
  if(ch[maxlength+3]==hexb[md]){me=hexd[md];break;}
}
for(md=0;md<16;md++){
  if(ch[maxlength+4]==hexb[md]){mf=hexd[md];break;}
}
mf=me*16+mf;
fwrite(&ma,1,1,makefp);
fwrite(&mf,1,1,makefp);
fwrite(&mc,1,1,makefp);
addnow=addnow+3;
return;
}
}

//makefile-----------------------------------------------------------
void makefile(){
char ptch[100][30];
char bptch[100][30];
char jptch[100][30];
long ptnum[100];
long jnum[100];
long bnum[100];
char pch[30];
char w;
char smallch[60];
char sm;
char ua,ub,us,ut;
long ud;
int uc;
L4:ClearScreen();
demo=1;
TextOut(11,33,"请选择要编译的文本文件:",1);
Refresh();
if(getchar()==27){
  did=0;
  return;
}
fp=openfile();
if(did==0)return;
if(fp==0){
  ClearScreen();
  TextOut(56,31,"无法打开",128);
  Refresh();
  getchar();
  goto L4;
}
ClearScreen();
  TextOut(44,31,"正在仿真编译",1);
  TextOut(44,45,"请稍等......",1);
  Refresh();
  org=0;
L6:
addnow=0;
add=0;
fseek(fp,0,0);
jnums=0;
ptnums=0;
bnums=0;
L5:
for(ua=0;ua<60;ua++)ch[ua]=0;
for(maxlength=0;maxlength<60;maxlength++){
  word=0;
  fread(&word,1,1,fp);
  if(word==0)break;
  add++;
  if(word==0x0d){
   add++;
   enters++;
   fread(&word,1,1,fp);
   break;
  }
  if(isalpha(word))ch[maxlength]=toupper(word);
  else ch[maxlength]=word;
}
if(maxlength==60){
  ClearScreen();
  TextOut(50,31,"文件有问题",128);
  Refresh();
  getchar();
  fclose(fp);
  goto L4;
}
maxlength=0;
if(ch[0]!=32&&ch[0]!=0){
  ua=0;
  for(maxlength=0;maxlength<60;maxlength++){
   if(ch[maxlength]==':'||ch[maxlength]==0){
    pch[ua]=0;
    maxlength++;
    break;
   }
   pch[ua]=ch[maxlength];
   ua++;
  }
  for(ua=0;ua<ptnums;ua++){
   if(strcmp(pch,ptch[ua])==0){
   ClearScreen();
    TextOut(56,33,"标号重复",1);
    Refresh();
    getchar();
    fclose(fp);
    goto L4;
   }
  }
  for(ua=0;ua<30;ua++)ptch[ptnums][ua]=pch[ua];
  ptnum[ptnums]=addnow+org;
  ptnums++;
}
for(maxlength=maxlength;maxlength<60;maxlength++){
  if(ch[maxlength]==0)goto L5;
  if(ch[maxlength]!=32)break;
}
for(ua=0;ua<60;ua++){
  if(ch[maxlength]==32)break;
  smallch[ua]=ch[maxlength];
  maxlength++;
}
smallch[ua]=0;
sm=smallch[0];
if(sm=='P'){
  if(strcmp(smallch,"PHA")==0){
   addnow++;
   mwd=0x48;
   makea();
  }
  else if(strcmp(smallch,"PLA")==0){
   addnow++;
   mwd=0x68;
   makea();
  }
  else if(strcmp(smallch,"PHP")==0){
   addnow++;
   mwd=0x08;
   makea();
  }
  else if(strcmp(smallch,"PLP")==0){
   addnow++;
   mwd=0x28;
   makea();
  }
  else wrong=1;
}
else if(sm=='T'){
  if(strcmp(smallch,"TAX")==0){
   addnow++;
   mwd=0xaa;
   makea();
  }
  else if(strcmp(smallch,"TAY")==0){
   addnow++;
   mwd=0xa8;
   makea();
  }
  else if(strcmp(smallch,"TXA")==0){
   addnow++;
   mwd=0x8a;
   makea();
  }
  else if(strcmp(smallch,"TYA")==0){
   addnow++;
   mwd=0x98;
   makea();
  }
  else if(strcmp(smallch,"TSX")==0){
   addnow++;
   mwd=0xba;
   makea();
  }
  else if(strcmp(smallch,"TXS")==0){
   addnow++;
   mwd=0x98;
   makea();
  }
}
else if(sm=='A'){
  if(strcmp(smallch,"AND")){
   for(ua=0;ua<11;ua++)k[ua]=andkind[ua];
   makeb();
  }
  else if(strcmp(smallch,"ASL")){
   for(ua=0;ua<11;ua++)k[ua]=aslkind[ua];
   makeb();
  }
  else if(strcmp(smallch,"ADC")){
   for(ua=0;ua<11;ua++)k[ua]=adckind[ua];
   makeb();
  }
  else wrong=1;
}
else if(sm=='B'){
  for(maxlength=maxlength+1;maxlength<60;maxlength++){
   if(ch[maxlength]!=32)break;
  }
   bnum[bnums]=addnow+1;
  ua=0;
  for(;maxlength<60;maxlength++){
   if(ch[maxlength]==';'){
    bptch[bnums][ua]=0;
    break;
   }
   if(ch[maxlength]==0){
    bptch[bnums][ua]=0;
    break;
   }
   bptch[bnums][ua]=ch[maxlength];
   ua++;
  }
   bnums++;
  if(strcmp(smallch,"BEQ")==0){w=0xf0;goto koo;}
  if(strcmp(smallch,"BNE")==0){w=0xd0;goto koo;}
  if(strcmp(smallch,"BCC")==0){w=0x90;goto koo;}
  if(strcmp(smallch,"BCS")==0){w=0xb0;goto koo;}
  if(strcmp(smallch,"BPL")==0){w=0x10;goto koo;}
  if(strcmp(smallch,"BMI")==0){w=0x30;goto koo;}
  if(strcmp(smallch,"BVC")==0){w=0x50;goto koo;}
  if(strcmp(smallch,"BVS")==0)w=0x70;
  else wrong=1;
  ko
  addnow=addnow+2;
  if(demo==0)fwrite(&w,1,1,makefp);
  if(demo==0)fwrite(&w,1,1,makefp);
}
else if(sm=='D'){
  if(strcmp(smallch,"DEC")==0){
   for(ua=0;ua<11;ua++)k[ua]=deckind[ua];
   makeb();
  }
  if(strcmp(smallch,"DEX")==0){
   addnow++;
   mwd=0xca;
   makea();
  }
  if(strcmp(smallch,"DEY")==0){
   addnow++;
   mwd=0x88;
   makea();
  }
}
else if(sm=='C'){
if(strcmp(smallch,"CMP")==0){
  for(ua=0;ua<11;ua++)k[ua]=cmpkind[ua];
  makeb();
}
else if(strcmp(smallch,"CPX")==0){
  for(ua=0;ua<11;ua++)k[ua]=cpxkind[ua];
  makeb();
}
else if(strcmp(smallch,"CPY")==0){
  for(ua=0;ua<11;ua++)k[ua]=cpykind[ua];
  makeb();
}
else if(strcmp(smallch,"CLC")==0){
   addnow++;
   mwd=0x18;
   makea();
}
else if(strcmp(smallch,"CLD")==0){
   addnow++;
   mwd=0xd8;
   makea();
}
else if(strcmp(smallch,"CLI")==0){
   addnow++;
   mwd=0x58;
   makea();
}
else if(strcmp(smallch,"CLV")==0){
   addnow++;
   mwd=0xb8;
   makea();
}
else wrong=1;
}
else if(sm=='E'){
  if(strcmp(smallch,"EOR")==0){
   for(ua=0;ua<11;ua++)k[ua]=eorkind[ua];
   makeb();
  }
  else wrong=1;
}
else if(sm=='I'){
  if(strcmp(smallch,"INC")==0){
   for(ua=0;ua<11;ua++)k[ua]=inckind[ua];
   makeb();
  }
  else if(strcmp(smallch,"INT")==0){
   for(ua=0;ua<11;ua++)k[ua]=0;
   makeb();
  }
  else if(strcmp(smallch,"INX")==0){
   addnow++;
   mwd=0xe8;
   makea();
  }
  else if(strcmp(smallch,"INY")==0){
   addnow++;
   mwd=0xc8;
   makea();
  }
  else wrong=1;
}
else if(sm=='J'){
  jnum[jnums]=addnow+1;
  if(strcmp(smallch,"JSR")==0){
   for(maxlength=maxlength+1;maxlength<60;maxlength++){
   if(ch[maxlength]!=32)break;
  }
  ua=0;
  for(maxlength=maxlength;maxlength<60;maxlength++){
   if(ch[maxlength]==';'){
    jptch[jnums][ua]=0;
    break;
   }
   if(ch[maxlength]==0){
    jptch[jnums][ua]=0;
    break;
   }
   jptch[jnums][ua]=ch[maxlength];
   ua++;
  }
  jnums++;
  addnow=addnow+3;
  ua=0x20;
  if(demo==0){
  fwrite(&ua,1,1,makefp);
  fwrite(&ua,1,1,makefp);
  fwrite(&ua,1,1,makefp);
  }
  }
  else if(strcmp(smallch,"JMP")==0){
   jnum[jnums]=addnow+1;
   for(maxlength=maxlength+1;maxlength<30;maxlength++){
   if(ch[maxlength]!=32)break;
  }
  ua=0;
  for(maxlength=maxlength;maxlength<30;maxlength++){
   if(ch[maxlength]==';'){
    jptch[jnums][ua]=0;
    break;
   }
   if(ch[maxlength]==0){
    jptch[jnums][ua]=0;
    break;
   }
   jptch[jnums][ua]=ch[maxlength];
   ua++;
  }
  jnums++;
  ua=0x4c;
  if(ch[maxlength]=='('&&ch[maxlength+6]==')')ua=0x6c;
  addnow=addnow+3;
  
  if(demo==0){
  fwrite(&ua,1,1,makefp);
  fwrite(&ua,1,1,makefp);
  fwrite(&ua,1,1,makefp);
  }
  }
  else wrong=1;
}
else if(sm=='L'){
  if(strcmp(smallch,"LSR")==0){
   for(ua=0;ua<11;ua++)k[ua]=lsrkind[ua];
   makeb();
  }
  else if(strcmp(smallch,"LDA")==0){
   for(ua=0;ua<11;ua++)k[ua]=ldakind[ua];
   makeb();
}
  else if(strcmp(smallch,"LDX")==0){
   for(ua=0;ua<11;ua++)k[ua]=ldxkind[ua];
   makeb();
  }
  else if(strcmp(smallch,"LDY")==0){
   for(ua=0;ua<11;ua++)k[ua]=ldykind[ua];
   makeb();
  }
  else wrong=1;
}
else if(sm=='N'){
  if(strcmp(smallch,"NOP")==0){
   addnow++;
   mwd=0xea;
   makea();
  }
  else wrong=1;
}
else if(sm=='O'){
  if(strcmp(smallch,"ORA")==0){
   for(ua=0;ua<11;ua++)k[ua]=orakind[ua];
   makeb();
  }
else wrong=1;
}
else if(sm=='R'){
  if(strcmp(smallch,"ROL")==0){
   for(ua=0;ua<11;ua++)k[ua]=rolkind[ua];
   makeb();
  }
  if(strcmp(smallch,"ROR")==0){
   for(ua=0;ua<11;ua++)k[ua]=rorkind[ua];
   makeb();
  }
  if(strcmp(smallch,"RTI")==0){
   addnow++;
   mwd=0x40;
   makea();
  }
  if(strcmp(smallch,"RTS")==0){
   addnow++;
   mwd=0x60;
   makea();
  }
  else wrong=1;
}
else if(sm=='S'){
  if(strcmp(smallch,"STA")==0){
   for(ua=0;ua<11;ua++)k[ua]=stakind[ua];
   makeb();
  }
  if(strcmp(smallch,"STX")==0){
   for(ua=0;ua<11;ua++)k[ua]=stxkind[ua];
   makeb();
  }
  if(strcmp(smallch,"STY")==0){
   for(ua=0;ua<11;ua++)k[ua]=stykind[ua];
   makeb();
  }
  if(strcmp(smallch,"SBC")==0){
   for(ua=0;ua<11;ua++)k[ua]=sbckind[ua];
   makeb();
  }
  if(strcmp(smallch,"SEC")==0){
   addnow++;
   mwd=0x38;
   makea();
  }
  if(strcmp(smallch,"SED")==0){
   addnow++;
   mwd=0xf8;
   makea();
  }
  if(strcmp(smallch,"SEI")==0){
   addnow++;
   mwd=0x78;
   makea();
  }
  else wrong=1;
}
else if(sm=='.'){
  if(strcmp(smallch,".DB")==0){
   for(;maxlength<60;maxlength++)if(ch[maxlength]!=32)break;
   for(;maxlength<60;maxlength++){
    if(ch[maxlength]==0)goto L5;
    if(ch[maxlength]==',')maxlength++;
    if(ch[maxlength]=='$'){
     maxlength++;
     for(ua=0;ua<16;ua++)if(ch[maxlength]==hexb[ua])us=hexd[ua];
     maxlength++;
    for(ua=0;ua<16;ua++)if(ch[maxlength]==hexb[ua])ut=hexd[ua];
    ut=us*16+ut;
    if(demo==0)fwrite(&ut,1,1,makefp);
     addnow++;
   }
   if(ch[maxlength]=='"'){
    maxlength++;
    for(;maxlength<60;maxlength++){
     if(ch[maxlength]=='"')break;
     ua=ch[maxlength];
     fwrite(&ua,1,1,makefp);
    }
   }
  }
}
else if(strcmp(smallch,".ORG")==0){
  for(maxlength=maxlength;maxlength<60;maxlength++){
   if(ch[maxlength]=='$'){
    maxlength++;
    break;
   }
  }
  ua=0;
  for(maxlength=maxlength;maxlength<60;maxlength++){
   ch[ua]=ch[maxlength];
   ua++;
  }
  org=hexchtonum();
  if(org>65535){
   ClearScreen();
   TextOut(26,31,"程序开始地址超范围",1);
   Refresh();
   getchar();
   fclose(fp);
   goto L4;
  }
}
}
 楼主| 发表于 2005-6-4 09:18:00 | 显示全部楼层
L7:if(wrong==1){
ClearScreen();
SetScreen(1);
memset(_TEXT,' ',156);
Locate(1,0);
printf("%s",ch);
Locate(2,7);
printf("第%d行有错误",enters);
getchar();
fclose(fp);
goto L4;
}


if(feof(fp)){
  if(bnums>0) {
   for(ua=0;ua<bnums;ua++){
     for(ub=0;ub<ptnums;ub++){
       if(strcmp(bptch[ua],ptch[ub])==0){
         if(bnum[ua]<ptnum[ub]){
           uc=ptnum[ub]-bnum[ua]-1;
           if(uc>0x7f){
             ClearScreen();
             TextOut(56,17,"跳转到",1);
             TextOut(56,31,ptch[ub],1);
             TextOut(56,45,"时,步长超范围",1);
             fclose(fp);
             Refresh();
             getchar();
             goto L4;
           }
           ub=uc;
           if(demo==0){
              fseek(makefp,bnum[ua]-org,0);
              fwrite(&ub,1,1,makefp);
              break;
           }
         }
         else{
           uc=255+ptnum[ub]-bnum[ua];
           
           if(uc<0x80||uc>255){
             ClearScreen();
             TextOut(56,17,"跳转到",1);
             TextOut(56,31,ptch[ub],1);
             TextOut(56,45,"时,步长超范围",1);
             fclose(fp);
             Refresh();
             getchar();
             goto L4;
           }
           ub=uc;
           if(demo==0){
             fseek(makefp,bnum[ua],0);
             fwrite(&ub,1,1,makefp);
             break;
           }
         }
       }
     }
   }
  }   
  if(jnums>0){
  for(ua=0;ua<jnums;ua++){
   for(ub=0;ub<ptnums;ub++){
    if(strcmp(jptch[ua],ptch[ub])==0){
     if(demo==0){
     ud=ptnum[ub];
     us=ud&0x00ff;
     fseek(makefp,jnum[ub],0);
     fwrite(&us,1,1,makefp);
     ud=ptnum[ub]/0x100;
     us=ud;
     fwrite(&us,1,1,makefp);
     break;
     }
    }
   }
  }
  }
}
if(feof(fp)&&demo==1){
demo=0;
ClearScreen();
  TextOut(56,31,"程序无误",128);
  Refresh();
  getchar();
  makefp=savefile();
  if(did==0){
  goto L4;
  }
  if(makefp==0){
   ClearScreen();
   TextOut(56,31,"无法创建",128);
   fclose(fp);
   Refresh();
   getchar();
   goto L4;
  }
  rewind(fp);
  goto L6;

}
if(feof(fp)&&demo==0){
ClearScreen();
  TextOut(56,31,"编译完成",128);
  Refresh();
  fclose(fp);
  fclose(makefp);
  getchar();
  return;
}
goto L5;

}
void main()
{
add=0;
dose=0;
ClearScreen();
SetScreen(1);
TextOut(10,10,"我的6502",128);
TextOut(100,65,"gameghost",1);
Refresh();
getchar();
start:
chose=0;
for(;;){
ClearScreen();
TextOut(56,26,"编译文本",2+(chose==1));
TextOut(50,40,"反汇编文件",2+(chose==0));
Refresh();
inp=getchar();
if(inp==UP||inp==DOWN){
  if(chose==0)chose=1;
  else chose=0;
}
if(inp==27){
  ClearScreen();
  if(dose==0){
  TextOut(80-3*12,30,"你什么都没做",2);
  Refresh();
  getchar();
  }
  exit(0);
}
if(inp==13)break;
}
if(chose==1)lookfile();
if(chose==0)makefile();
goto start;
}

[em10]
发表于 2005-6-4 09:31:00 | 显示全部楼层
你帖这么多代码干什么啊?做个TXT传就是了/

11773_20854_4666.rar

8 KB, 下载次数: 247

11773_20854_4711.rar

5 KB, 下载次数: 267

 楼主| 发表于 2005-6-4 09:43:00 | 显示全部楼层
这里的网吧已经烂到不能新建文件(注:系统烂)!其他的限制也很多(桌面锁了,鼠标右键也锁了。。。。。)!
所以程序就搁浅了!
我这些东西也是被迫存才QQ硬盘上的,实在没法弄TXT。
上次通宵改的时候是坐了30分钟的公车才到的一个网吧改的。
实在看不惯的好心人就做个TXT传上来吧。

11774_20855_4667.rar

20 KB, 下载次数: 254

发表于 2005-6-4 22:23:00 | 显示全部楼层
辛苦了!!
 楼主| 发表于 2005-6-5 20:24:00 | 显示全部楼层
又看了看79楼cc90042938的帖子,越看越不爽!
cc90042938你是什么意思啊!
我发贴同时是为了让大家方便看啊!
就因为你不想看就传文件?
都像你一样下载啊!
发文本和传文件占的空间不都是40多k吗?
从来没见过你这样的贴!
[em13][em16]
发表于 2005-6-5 22:06:00 | 显示全部楼层
咳咳~行了,不要吵,大家都注意点。
楼主,你似乎有点太敏感了吧,他那句话没有什么其他意思啊!
还有,谷虫也注意点,楼主也是方便大家学习的。
握手言和啦!!!
 楼主| 发表于 2005-6-5 22:53:00 | 显示全部楼层
呵呵
我也觉得有些过分了,主要是弄这些东西太辛苦了。
不好意思。
[em09][em08][em31][em45]
发表于 2005-6-6 17:59:00 | 显示全部楼层
以下是引用gameghost在2005-6-4 9:43:24的发言:

这里的网吧已经烂到不能新建文件(注:系统烂)!其他的限制也很多(桌面锁了,鼠标右键也锁了。。。。。)!

所以程序就搁浅了!

我这些东西也是被迫存才QQ硬盘上的,实在没法弄TXT。

上次通宵改的时候是坐了30分钟的公车才到的一个网吧改的。

实在看不惯的好心人就做个TXT传上来吧。


上次通宵改的时候是坐了30分钟的公车才到的一个网吧改的。.....辛苦辛苦啊...对了,你几岁了?

         30分钟.坐车到一个网吧写程序?!真有你的,真幽默啊...!

                    自家没有电脑?怎么编译?网吧连新建文件的功能都没有,怎么编译成.lav??

厉害,真是兴趣影响一"带"人

====================================================================

ohoh!飘走,正如我轻轻的飘来,忽然,帖子又顶上去了!
发表于 2005-6-6 18:05:00 | 显示全部楼层
呵呵~大家和和气气多好啊。不要吵架,都有共同的爱好嘛!
 楼主| 发表于 2005-6-7 17:32:00 | 显示全部楼层
以下是引用Mrzeng在2005-6-6 17:59:24的发言:
>

上次通宵改的时候是坐了30分钟的公车才到的一个网吧改的。.....辛苦辛苦啊...对了,你几岁了?

         30分钟.坐车到一个网吧写程序?!真有你的,真幽默啊...!

                    自家没有电脑?怎么编译?网吧连新建文件的功能都没有,怎么编译成.lav??

厉害,真是兴趣影响一"带"人

====================================================================

ohoh!飘走,正如我轻轻的飘来,忽然,帖子又顶上去了!

呵呵!没听懂吧!还不信!
我编程序的网吧就是坐30分钟才去的地方,编完就存在QQ硬盘或MP3上。
而我发程序的地方才是什么都限制的地方,连MP3都不能用,所以发了个以前的,还是从QQ硬盘上的“网络记事本”中“复制”+“粘贴”上来的,明白了吗?
因为最近事情多,没时间去编了,所以就在学校外面的网吧先发上来了,OK?
以为我骗人啊,呵呵。
您需要登录后才可以回帖 登录 | 加入易码

本版积分规则

Archiver|手机版|小黑屋|EMAX Studio

GMT+8, 2025-6-18 20:21 , Processed in 0.019834 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表