Hi,

I've just found an ugly bug in TYA.
It is related to an optimzation in division by 2, 
unfortunately introduced in TYA 1.4 (TYA 1.3x was still okay).

If you detect some TYA caused problems, apply this patch:

------------------------------------------------------------------
--- tyarecode.c~        Sat Jun 19 19:29:23 1999
+++ tyarecode.c Fri Aug 20 18:33:13 1999
@@ -105,7 +105,7 @@
        }
        break;
       case 0x05:       // iconst_2
-#ifdef COMBINEOP       
+#if 0  //ifdef COMBINEOP       /*Fri Aug 20 18:31:05 1999*/
        n=*(cinfo->bptr+j);
        if ((n==0x6C || n== 0x68) && (cinfo->mb->CompiledCodeFlags & CCF_COMBOK))
        {
@@ -693,7 +693,7 @@
        }
        break;
       case 0x68:       // imul
-#ifdef COMBINEOP
+#if 0 //ifdef COMBINEOP
        if (GET_OPTFLAG(DF_const2))
        {
           CW(ADD_AXAX);
@@ -773,10 +773,10 @@
        }
        break;
       case 0x6c:       // idiv
-#ifdef COMBINEOP
+#if 0 //ifdef COMBINEOP
        if (GET_OPTFLAG(DF_const2))
        {
-          CW(SHR_AX);
+          CW(SHR_AX);  // should be SAR, and has a rounding problem
           CB(1);
           break;
        }
-------------------------------------------------

Cheers,
Albrecht


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to