int main(int argc, char *argv[]) { union { char c[4]; int i; } endian; printf("/* Automatically created file --- do not edit */\n\n"); dotype(8); dotype(16); dotype(32); endian.i = 0; endian.c[0] = 1; if (endian.i == 1) printf("#define PCEMU_LITTLE_ENDIAN\n"); else printf("#define PCEMU_BIG_ENDIAN\n"); return 0; }
/*this is the main routine*/ void doshell() { char line[80]; /*run forever - the shell shouldn't end*/ while(1==1) { /*read in a line*/ printstring("SHELL>\0"); readstring(line); /*match it against each possible command*/ /*if the user presses return, ignore it*/ if (line[0]==0xd) continue; else if (iscommand(line,"CLS\0")==1) doclear(); else if (iscommand(line,"cls\0")==1) doclear(); else if (iscommand(line,"COPY\0")==1) docopy(); else if (iscommand(line,"copy\0")==1) docopy(); else if (iscommand(line,"CREATE \0")==1) docreate(line); else if (iscommand(line,"create \0")==1) docreate(line); else if (iscommand(line,"DELETE \0")==1) dodelete(line); else if (iscommand(line,"delete \0")==1) dodelete(line); else if (iscommand(line,"DIR\0")==1) dodir(); else if (iscommand(line,"dir\0")==1) dodir(); else if (iscommand(line,"EXEC \0")==1) doexecute(line,1); else if (iscommand(line,"exec \0")==1) doexecute(line,1); else if (iscommand(line,"EXECBACK \0")==1) doexecute(line,0); else if (iscommand(line,"execback \0")==1) doexecute(line,0); else if (iscommand(line,"HELP\0")==1) dohelp(); else if (iscommand(line,"help\0")==1) dohelp(); else if (line[0]=='?') dohelp(); else if (iscommand(line,"TYPE \0")==1) dotype(line); else if (iscommand(line,"type \0")==1) dotype(line); else if (iscommand(line,"KILL \0")==1) dokill(line); else if (iscommand(line,"kill \0")==1) dokill(line); else if (iscommand(line,"mkdir \0")==1) domkdir(line); else if (iscommand(line,"MKDIR\0")==1) domkdir(line); else if (iscommand(line,"FORMAT\0")==1) doFormat(); else if (iscommand(line,"format\0")==1) doFormat(); else if (iscommand(line,"remove\0")==1) doRemove(line); else if (iscommand(line,"REMOVE\0")==1) doRemove(line); else if (iscommand(line,"list\0")==1) doList(); else if (iscommand(line,"LIST\0")==1) doList(); else if (iscommand(line,"count\0")==1) doCount(line); else if (iscommand(line,"WRITE\0")==1) doCreateFile(line); else if (iscommand(line,"write\0")==1) doCreateFile(line); else if (iscommand(line,"READ\0")==1) doEcho(line); else if (iscommand(line,"read\0")==1) doEcho(line); else printstring("Command not found\r\n\0"); printstring("\r\n\0"); } }