/* 1. Compiler: TC 2.0 2. Mode: Large 3. Project: Hello2.prj Hello2.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: (1). To detect the current operation system. (2). If you used this program in minios7,it will show 8831's version , "Hello 8831!" and "1+2=3". (3). If you used this program in pure dos or dos-box in win98, it will show "Hello PC!, this program is not run under 8831." 5. Hordware: 8831 It's compiled by Tony ----------------------------------------------------------------------------------- */ #include #include #include #include #include #include"..\LIB\8000.h" #include"..\LIB\vxcomm.h" /*----------------------------------------------------------------------------------*/ int Add(int a,int b) { return a+b; } void main(int argc,char *argv[]) { int type; /*detect the current operation system*/ if((!(Is8000()))){ /*if it's used in dos*/ Print("Hello PC!, this program is not run under 8831."); return; } type=Is8000(); /*if it's used in minios7*/ Print("Hello 8831! (Flash memory is %d K)\n\r",type); Print("1+2=%d\n\r",Add(1,2)); }