OSDN Git Service

updated copyleft and need to test and fix newer version of open watcom
[proj16/16.git] / src / lib / 16_head.c
index aed1250..593d572 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~\r
- * Copyright (C) 2012-2019 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ * Copyright (C) 2012-2022 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
  *\r
  * This file is part of Project 16.\r
  *\r
@@ -224,14 +224,19 @@ void regidump()
 {\r
        //GENERAL PURPOSE\r
        unsigned short _ax,_bx,_cx,_dx;\r
+#ifndef __BORLANDC__\r
        unsigned short _cflag;\r
+#endif\r
        unsigned char _al,_ah,_bl,_bh,_cl,_ch,_dl,_dh;\r
 \r
        unsigned short _bp,_si,_di,_sp;\r
 \r
-       unsigned short _cs,_ds,_es,_ss; //SEGMENT\r
+       unsigned short _cs_,_ds_,_es_,_ss_;     //SEGMENT\r
 //     unsigned short _ip;     //SPECIAL PURPOSE\r
-       _ax=_bx=_cx=_dx=_si=_di=_bp=_sp=_cs=_ds=_es=_ss=_cflag=0;\r
+       _ax=_bx=_cx=_dx=_si=_di=_bp=_sp=_cs_=_ds_=_es_=_ss_=0;\r
+#ifndef __BORLANDC__\r
+       _cflag=0;\r
+#endif\r
        _ah=_al=_bh=_bl=_ch=_cl=_dh=_dl=0;\r
 \r
 #ifndef REGIDUMP_USE_CAPS\r
@@ -255,6 +260,14 @@ void regidump()
                mov _if,if\r
                mov _df,df\r
                mov _of,of*/\r
+               mov _ah,ah\r
+               mov _al,al\r
+               mov _bh,bh\r
+               mov _bl,bl\r
+               mov _ch,ch\r
+               mov _cl,cl\r
+               mov _dh,dh\r
+               mov _dl,dl\r
        }\r
 #else\r
 _ax=_AX;\r
@@ -274,15 +287,17 @@ _cl=_CL;
 _dh=_DH;\r
 _dl=_DL;\r
 #endif\r
+#ifndef __BORLANDC__\r
        _cflag=_CFLAG;\r
+#endif\r
        __asm {\r
                mov _bp,bp\r
                mov _sp,sp\r
 \r
-               mov _cs,cs\r
-               mov _ds,ds\r
-               mov _es,es\r
-               mov _ss,ss\r
+               mov _cs_,cs\r
+               mov _ds_,ds\r
+               mov _es_,es\r
+               mov _ss_,ss\r
        }\r
 //     printf("integer values: ax=%04d bx=%04d cx=%04d dx=%04d\n", a, b, c, d);\r
 //     printf("unsigned values:ax=%04u bx=%04u cx=%04u dx=%04u\n", a, b, c, d);\r
@@ -303,14 +318,16 @@ _dl=_DL;
 \r
        printf("segment:\n");\r
 #ifndef REGIDUMP_HEX\r
-       printf("        cs=%04u\n       ds=%04u\n       es=%04u\n       ss=%04u\n", _cs, _ds, _es, _ss);\r
+       //printf("      cs=%04u\n       ds=%04u\n       es=%04u\n       ss=%04u\n", _cs_, _ds, _es_, _ss_);\r
+       printf("        cs=%04u\n", _cs_);      printf("        ds=%04u\n", _ds_);      printf("        es=%04u\n", _es_);      printf("        ss=%04u\n", _ss_);\r
 #else\r
-       printf("        cs=%04x\n       ds=%04x\n       es=%04x\n       ss=%04x\n", _cs, _ds, _es, _ss);\r
+       //printf("      cs=%04x\n       ds=%04x\n       es=%04x\n       ss=%04x\n", _cs_, _ds_, _es_, _ss_);\r
+       printf("        cs=%04x\n", _cs_);      printf("        ds=%04x\n", _ds_);      printf("        es=%04x\n", _es_);      printf("        ss=%04x\n", _ss_);\r
 #endif\r
        printf("                ---------------------------------------\n");\r
 \r
 \r
-\r
+#ifndef __BORLANDC__\r
        printf("cflags:\n");\r
 /*     printf("        ip=%04u\n\n", _ip);\r
        printf("        cf=%04u\npf=%04u\naf=%04u\nzf=%04u\nsf=%04u\ntf=%04u\nif=%04u\ndf=%04u\nof=%04u\n", _cf, _pf, _af, _zf, _sf, _tf, _if, _df, _of);\r
@@ -325,6 +342,7 @@ _dl=_DL;
 //     printf("        ip=%04x\n\n", _IP);\r
 //     printf("        cf=%04x\npf=%04x\naf=%04x\nzf=%04x\nsf=%04x\ntf=%04x\nif=%04x\ndf=%04x\nof=%04x\n", _CF, _PF, _AF, _ZF, _SF, _TF, _IF, _DF, _OF);\r
        printf("cflag: %016x\n",(_cflag));\r
+       printf("        ahl=%016x", _al|(_ah<<4));\r
 #endif\r
        printf("testing\n");\r
 //     printf("dx: "NIBBLE_TO_BINARY_PATTERN""NIBBLE_TO_BINARY_PATTERN"\n",            NIBBLE_TO_BINARY(_dx>>4), NIBBLE_TO_BINARY(_dx));\r
@@ -332,6 +350,7 @@ _dl=_DL;
        printf("dx: "WORD_TO_BINARY_PATTERN"\n",                WORD_TO_BINARY(_dx));\r
        printf("                ---------------------------------------\n");\r
 #endif\r
+#endif\r
 \r
        printf("for more info see\n     http://stackoverflow.com/questions/9130349/how-many-registers-are-there-in-8086-8088\n");\r
        printf("================================================================================");\r