home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 9 / FreshFishVol9-CD2.bin / bbs / gnu / gdb-4.14-src.lha / gdb-4.14 / sim / z8k / support.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-29  |  14.7 KB  |  764 lines

  1. /* support routines for interpreted instructions
  2.    Copyright (C) 1992, 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of Z8KSIM
  5.  
  6. Z8KSIM is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. Z8KSIM is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with Z8KSIM; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. #include <ansidecl.h>
  21. #include <signal.h>
  22.  
  23. #include "sysdep.h"
  24. #include "tm.h"
  25. #include "sim.h"
  26. #include "mem.h"
  27. #include <sys/times.h>
  28. #include <sys/param.h>
  29. #include "remote-sim.h"
  30. #include "syscall.h"
  31.  
  32. static int get_now PARAMS ((void));
  33. static int now_persec PARAMS ((void));
  34. static int put_long PARAMS ((sim_state_type * context, int ptr, int value));
  35. static int put_short PARAMS ((sim_state_type * context, int ptr, int value));
  36.  
  37. int sim_z8001_mode;
  38.  
  39. static int
  40. get_now ()
  41. {
  42.   struct tms b;
  43.  
  44.   times (&b);
  45.   return b.tms_utime + b.tms_stime;
  46. }
  47.  
  48. static int
  49. now_persec ()
  50. {
  51.   return 50;
  52. }
  53.  
  54.  
  55. /* #define LOG /* define this to print instruction use counts */
  56.  
  57. #ifdef __GNUC__
  58. #define INLINE __inline__
  59. #include "inlines.h"
  60. #else
  61. #include "inlines.h"
  62. #endif
  63.  
  64. /* This holds the entire cpu context */
  65. static sim_state_type the_state;
  66.  
  67. int
  68. fail (context, dummy)
  69.      sim_state_type *context;
  70.      int dummy;
  71. {
  72.   context->exception = SIM_BAD_INST;
  73.   return 1;
  74. }
  75.  
  76. void
  77. sfop_bad1 (context)
  78.      sim_state_type *context;
  79. {
  80.   context->exception
  81.     = SIM_BAD_INST;
  82. }
  83.  
  84. void
  85. bfop_bad1 (context)
  86.      sim_state_type *context;
  87. {
  88.   context->exception
  89.     = SIM_BAD_INST;
  90. }
  91.  
  92. void
  93. fop_bad (context)
  94.      sim_state_type *context;
  95. {
  96.   context->exception =
  97.     SIM_BAD_INST;
  98. }
  99.  
  100. /* Table of bit counts for all byte values */
  101.  
  102. char the_parity[256] =
  103. {
  104.   0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3,
  105.   4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4,
  106.   4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2,
  107.   3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5,
  108.   4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4,
  109.   5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3,
  110.   3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2,
  111.   3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6,
  112.   4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5,
  113.   6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5,
  114.   5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6,
  115.   7, 7, 8};
  116.  
  117.  
  118. int read ();
  119. int write ();
  120. int open ();
  121. int close ();
  122. int open ();
  123. int close ();
  124. int creat ();
  125. int link ();
  126. int fstat ();
  127.  
  128. static int
  129. put_short (context, ptr, value)
  130.      sim_state_type *context;
  131.      int ptr;
  132.      int value;
  133. {
  134.   put_word_mem_da (context, ptr, value);
  135.   return ptr + 2;
  136. }
  137.  
  138. static int
  139. put_long (context, ptr, value)
  140.      sim_state_type *context;
  141.      int
  142.        ptr;
  143.      int value;
  144. {
  145.   put_long_mem_da (context, ptr, value);
  146.   return ptr + 4;
  147. }
  148.  
  149. #define aptr(x) ((sitoptr(x)) + (char *)(context->memory))
  150.  
  151. static int args[3];
  152. static int arg_index;        /* Translate a z8k system call into a host system call */
  153. void
  154. support_call (context, sc)
  155.      sim_state_type *context;
  156.      int sc;
  157. {
  158.   extern int errno;
  159.   int ret;
  160.   int retnext = 0;
  161.   int fd;
  162.  
  163.   int olderrno = errno;
  164.   errno = 0;
  165.   switch (sc)
  166.     {
  167.     case SYS_ARG:
  168.       args[arg_index++] = context->regs[0].word << 16 | context->regs[1].word;
  169.       break;
  170.     case SYS_exit:
  171.       context->exception = SIM_DONE;
  172.       arg_index = 0;
  173.       break;
  174.     case SYS_close:
  175.       ret = close ((int) (args[0]));
  176.       arg_index = 0;
  177.       break;
  178.     case SYS_creat:
  179.       ret = creat (aptr (args[0]), args[1]);
  180.       arg_index = 0;
  181.       break;
  182.     case SYS_isatty:
  183.       ret =
  184.     isatty (args[0]);
  185.       arg_index = 0;
  186.       break;
  187.     case SYS_open:
  188.       ret = open (aptr (args[0]), args[1], args[2]);
  189.       arg_index = 0;
  190.       break;
  191.       case
  192.     SYS_lseek:
  193.       ret = lseek (args[0], (off_t) args[1], args[2]);
  194.       arg_index =
  195.     0;
  196.       break;
  197.     case SYS_read:
  198.       ret = read (args[0], aptr (args[1]), args[2]);
  199.       arg_index = 0;
  200.       break;
  201.     case SYS_write:
  202.       ret = write (args[0],aptr (args[1]), args[2]);
  203.       arg_index = 0;
  204.       break;
  205.     case SYS_time:
  206.       {
  207.     int
  208.       dst = args[0];
  209.  
  210.     ret = time (0);
  211.     if (dst)
  212.       {
  213.         put_long_mem_da (context,
  214.                  sitoptr (dst), ret);
  215.       }
  216.     retnext = ret;
  217.     ret = retnext >> 16;
  218.     arg_index =
  219.       0;
  220.       }
  221.       break;
  222.     case SYS_fstat:
  223.       {
  224.     int buf;
  225.     struct stat host_stat;
  226.     fd =
  227.       args[0];
  228.     buf = sitoptr (args[1]);
  229.     ret = fstat (fd, &host_stat);
  230.     buf = put_short (context, buf, host_stat.st_dev);
  231.     buf = put_short (context, buf, host_stat.st_ino);
  232.     buf = put_short (context, buf, host_stat.st_mode);
  233.     buf = put_short (context, buf, host_stat.st_nlink);
  234.     buf = put_short (context, buf, host_stat.st_uid);
  235.     buf = put_short (context, buf, host_stat.st_uid);
  236.     buf = put_short (context, buf, host_stat.st_rdev);
  237.     buf = put_long (context, buf, host_stat.st_size);
  238.     buf = put_long (context, buf, host_stat.st_atime);
  239.     arg_index = 0;
  240.       } break;
  241.     default:
  242.     case SYS_link:
  243.       context->exception = SIM_BAD_SYSCALL;
  244.       arg_index = 0;
  245.       break;
  246.     }
  247.   context->regs[2].word = ret;
  248.   context->regs[3].word = retnext;
  249.   context->regs[5].word = errno;
  250.   errno = olderrno;
  251. }
  252.  
  253. #undef get_word_mem_da
  254.  
  255. int
  256. get_word_mem_da (context, addr)
  257.      sim_state_type *context;
  258.      int addr;
  259. {
  260.   return (get_byte_mem_da (context, addr) << 8) | (get_byte_mem_da (context, addr + 1));
  261.  
  262. }
  263.  
  264. #undef get_word_reg
  265. int 
  266. get_word_reg (context, reg) sim_state_type
  267. * context;
  268.      int reg;
  269. {
  270.   return context->regs[reg].word;
  271. }
  272.  
  273. #ifdef LOG
  274. int log[64 * 1024];
  275.  
  276. #endif
  277.  
  278. void
  279. tm_store_register (regno, value)
  280.      int regno;
  281.      int value;
  282. {
  283.   switch
  284.     (regno)
  285.     {
  286.     case REG_PC:
  287.       the_state.sometimes_pc = value;
  288.       break;
  289.  
  290.     default:
  291.       put_word_reg (&the_state, regno, value);
  292.     }
  293. }
  294.  
  295. void
  296. swap_long (buf, val)
  297.      char *buf;
  298.      int val;
  299. {
  300.   buf[0] = val >> 24;
  301.   buf[1] = val >> 16;
  302.   buf[2] = val >> 8;
  303.   buf[3] = val >> 0;
  304. }
  305.  
  306. void
  307. swap_word (buf, val)
  308.      char *buf;
  309.      int val;
  310. {
  311.   buf[0] = val >> 8;
  312.   buf[1] = val >> 0;
  313. }
  314.  
  315. void
  316. tm_fetch_register (regno, buf)
  317.      int regno;
  318.      char *buf;
  319. {
  320.   switch
  321.     (regno)
  322.     {
  323.     case REG_CYCLES:
  324.       swap_long (buf, the_state.cycles);
  325.       break;
  326.     case REG_INSTS:
  327.       swap_long (buf, the_state.insts);
  328.       break;
  329.       case
  330.     REG_TIME:
  331.       swap_long (buf, the_state.ticks);
  332.       break;
  333.     case REG_PC:
  334.       swap_long (buf, the_state.sometimes_pc);
  335.       break;
  336.     case REG_SP:
  337.       {
  338.     if (sim_z8001_mode)
  339.       {
  340.         swap_long (buf, get_long_reg (&the_state, 14));
  341.       }
  342.     else
  343.       {
  344.         swap_long (buf, get_word_reg (&the_state, 15));
  345.       }
  346.       }
  347.       break;
  348.       case
  349.     REG_FP:
  350.       {
  351.     if (sim_z8001_mode)
  352.       {
  353.         swap_long (buf, get_long_reg
  354.                (&the_state, 10));
  355.       }
  356.     else
  357.       {
  358.         swap_long (buf,
  359.                get_word_reg (&the_state, 10));
  360.       }
  361.       }
  362.       break;
  363.     default:
  364.       {
  365.     swap_word (buf,
  366.            get_word_reg (&the_state, regno));
  367.       }
  368.     }
  369. }
  370.  
  371. void
  372. tm_resume (step)
  373.      int step;
  374. {
  375.   int now = get_now ();
  376.   struct op_info
  377.    *p;
  378.   int word;
  379.   int pc;
  380.   extern int (*(sfop_table[])) ();
  381.   extern int (*(bfop_table[])) ();
  382.   int (*((*table))) ();
  383.   sim_state_type *context = &the_state;
  384.  
  385.   if (step)
  386.     {
  387.       context->exception = SIM_SINGLE_STEP;
  388.     }
  389.   else
  390.     {
  391.       context->exception = 0;
  392.     }
  393.  
  394.   pc = context->sometimes_pc;
  395.   if (sim_z8001_mode)
  396.     {
  397.       table = bfop_table;
  398.       pc = MAP_PHYSICAL_TO_LOGICAL (pc);
  399.     }
  400.   else
  401.     {
  402.       table = sfop_table;
  403.     }
  404.  
  405.  
  406.   do
  407.     {
  408.       word = get_word_mem_da (context, pc);
  409.       p = op_info_table + word;
  410.  
  411. #ifdef LOG
  412.       log[word]++;
  413. #endif
  414.       pc = table[p->exec] (context, pc, word);
  415.       context->insts++;
  416.  
  417.     }
  418.   while (!context->exception);
  419.  
  420.  
  421.  
  422.   context->sometimes_pc = MAP_LOGICAL_TO_PHYSICAL (pc);
  423.   context->ticks += get_now () - now;
  424. }
  425.  
  426. int
  427. tm_signal ()
  428. {
  429.   return the_state.exception;
  430. }
  431.  
  432. void
  433. tm_info_print (x)
  434.      sim_state_type *x;
  435. {
  436.   double timetaken = (double) x->ticks / (double) now_persec ();
  437.   double virttime = x->cycles / 4.0e6;
  438.  
  439.   printf ("instructions executed            : %9d\n", x->insts);
  440.   printf ("cycles counted                   : %9d \n", x->cycles);
  441.   printf ("cycles / inst                    : %9.1f \n", (double) x->cycles / (double) x->insts);
  442.   printf ("virtual time taked (at 4 Mhz)    : %9.1f \n", virttime);
  443.   printf ("real time taken                  : %9.1f \n", timetaken);
  444.  
  445.   if (timetaken)
  446.     {
  447.       printf ("virtual instructions per second  : %9.1f\n", x->insts / timetaken);
  448.       printf ("emulation speed                  : %9.1f%%\n", virttime / timetaken * 100.0);
  449.     }
  450. #ifdef LOG
  451.   {
  452.     extern int quick[];
  453.  
  454.     for (i = 0; quick[i]; i++)
  455.       {
  456.     log[quick[i]] += 100000;
  457.       }
  458.   }
  459.  
  460.   for (i = 0; i < 64 * 1024; i++)
  461.     {
  462.       if (log[i])
  463.     {
  464.       printf ("            /*%7d*/ 0x%x,\n", log[i], i);
  465.     }
  466.     }
  467. #endif
  468.  
  469. }
  470.  
  471. int
  472. sim_trace ()
  473. {
  474.   int i;
  475.   char buffer[10];
  476.   int r;
  477.  
  478.   printf ("\n");
  479.   for (r = 0; r < 16; r++)
  480.     {
  481.       int m;
  482.  
  483.       printf ("r%2d", r);
  484.       printf ("=%04x ", get_word_reg (&the_state,
  485.                       r));
  486.       for (m = -4; m < 8; m++)
  487.     {
  488.       if (m == 0)
  489.         printf (">");
  490.       printf ("%04x ",
  491.           get_word_mem_da (&the_state, (0xfffe & get_word_reg (&the_state, r)) + m * 2));
  492.     }
  493.       printf ("\n");
  494.     }
  495.  
  496.   printf ("\n");
  497.   printf ("%9d %9d %08x ", the_state.cycles,
  498.       the_state.insts, the_state.sometimes_pc);
  499.  
  500.   for (i = 0; i < 6; i++)
  501.     {
  502.       buffer[i] = get_byte_mem_da (&the_state,
  503.                    the_state.sometimes_pc + i);
  504.     }
  505.  
  506.   print_insn_z8001 (the_state.sometimes_pc, buffer, stdout);
  507.   printf
  508.     ("\n");
  509.   tm_resume (1);
  510.   if (the_state.exception != SIM_SINGLE_STEP)
  511.     return 1;
  512.   return 0;
  513. }
  514.  
  515. void
  516. tm_state (x)
  517.      sim_state_type *x;
  518. {
  519.   *x = the_state;
  520. }
  521.  
  522. void
  523. tm_exception (x)
  524.      int x;
  525. {
  526.   the_state.exception = x;
  527. }
  528.  
  529. int
  530. tm_read_byte (x)
  531.      int x;
  532. {
  533.   x &= 0x3f00ffff;
  534.   return sim_read_byte (&the_state, x);
  535. }
  536.  
  537. void
  538. tm_write_byte (x, y)
  539.      int x, y;
  540. {
  541.   x &= 0x3f00ffff;
  542.   sim_write_byte (&the_state, x, y);
  543. }
  544.  
  545. #define SIGN(x) ((x) & MASK)
  546. normal_flags_32(context,d,sa,sb,sub)
  547. sim_state_type *context;
  548. unsigned int d;
  549. unsigned int sa;
  550. unsigned int sb;
  551. unsigned int sub;
  552. {
  553. #define MASK (1<<31)
  554.   context->broken_flags = 0;    
  555.   if (sub)                        
  556.     PSW_CARRY = sa < sb;         
  557.   else                 
  558.     PSW_CARRY = d < sa;         
  559.   if (sub)
  560.     PSW_OVERFLOW = (SIGN(sa) != SIGN(sb)) && (SIGN(d) == SIGN(sb));
  561.   else
  562.     PSW_OVERFLOW = (SIGN(sa) == SIGN(sb)) && (SIGN(d) != SIGN(sb));
  563.  
  564.   PSW_SIGN = ((int)d) <0; 
  565.   PSW_ZERO = d == 0;
  566. }
  567.  
  568. normal_flags_16(context,d,sal,sbl,sub)
  569. sim_state_type *context;
  570. unsigned short int d;
  571. unsigned  int sal;
  572. unsigned  int sbl;
  573. unsigned short int sub;
  574. {
  575. unsigned short sa = sal;
  576. unsigned short sb = sbl;
  577. #define MASK (1<<15)
  578.   context->broken_flags = 0;    
  579.   if (sub)                        
  580.     PSW_CARRY = sal < sbl;         
  581.   else                 
  582.     PSW_CARRY = d < sa;         
  583.  
  584.   if (sub)
  585.     PSW_OVERFLOW = (SIGN(sa) != SIGN(sb)) && (SIGN(d) == SIGN(sb));
  586.   else
  587.     PSW_OVERFLOW = (SIGN(sa) == SIGN(sb)) && (SIGN(d) != SIGN(sb));
  588.  
  589.   PSW_SIGN = ((short int)d) <0; 
  590.   PSW_ZERO = d == 0;
  591. }
  592.  
  593. normal_flags_8(context,d,sa,sb,sub)
  594. sim_state_type *context;
  595. unsigned char d;
  596. unsigned char sa;
  597. unsigned char sb;
  598. unsigned char sub;
  599. {
  600. #define MASK (1<<7)
  601.   context->broken_flags = 0;    
  602.   if (sub)                        
  603.     PSW_CARRY = sa < sb;         
  604.   else                 
  605.     PSW_CARRY = d < sa;         
  606.   if (sub)
  607.     PSW_OVERFLOW = (SIGN(sa) != SIGN(sb)) && (SIGN(d) == SIGN(sb));
  608.   else
  609.     PSW_OVERFLOW = (SIGN(sa) == SIGN(sb)) && (SIGN(d) != SIGN(sb));
  610.   PSW_SIGN = ((char)d) <0; 
  611.   PSW_ZERO = d == 0;
  612. }
  613.  
  614.  
  615. static int
  616. is_cond_true (context, c)
  617.      sim_state_type *context;
  618.      int c;
  619. {
  620.   switch (c)
  621.     {
  622.     case T:
  623.       return 1;
  624.     case F:
  625.       return 0;            /* F */
  626.     case LE:
  627.       return (PSW_ZERO | (PSW_SIGN ^ PSW_OVERFLOW)) & 1;    /*LE */
  628.     case GT:
  629.       return (~(PSW_ZERO | (PSW_SIGN ^ PSW_OVERFLOW))) & 1;    /*GT */
  630.     case 0x5:
  631.       return (PSW_SIGN & 1);    /* sign */
  632.     case 0xd:
  633.       return (~(PSW_SIGN)) & 1;    /* not sign */
  634.     case 0x3:
  635.       return ((PSW_CARRY | PSW_ZERO) & 1);    /* ule*/
  636.     case UGT:
  637.       return ((~(PSW_CARRY | PSW_ZERO)) & 1);    /* ugt */
  638.     case 0x4:
  639.       return (PSW_OVERFLOW & 1);/* overflow */
  640.     case 0xc:
  641.       return (~(PSW_OVERFLOW)) & 1;    /* not overflow */
  642.     case LT:
  643.       return (PSW_SIGN ^ PSW_OVERFLOW) & 1;    /* LT */
  644.     case GE:
  645.       return (~(PSW_SIGN ^ PSW_OVERFLOW)) & 1;    /* GE */
  646.     case EQ:
  647.       return (PSW_ZERO) & 1;    /* zero */
  648.     case NE:
  649.       return ((~PSW_ZERO) & 1);    /* not zero */
  650.     case 0x7:
  651.       return (PSW_CARRY) & 1;    /* carry */
  652.     case 0xf:
  653.       return (~PSW_CARRY) & 1;    /* not carry */
  654.     default:
  655.       abort ();
  656.     }
  657. }
  658.  
  659. int
  660. COND (context, c)
  661.      sim_state_type *context;
  662.      int c;
  663. {
  664.   if (c == 8)
  665.     return 1;
  666.  
  667.   /* We can calculate what the flags would have been by
  668.      looking at the src and dst and size of the operation */
  669.  
  670.   if (context->broken_flags)
  671.     {
  672.       int slow = 0;
  673.       int size;
  674.       int dst;
  675.       int srca;
  676.       int srcb;
  677.       int mask;
  678.       int ans;
  679.  
  680.       /* see if we can short-cut the nasty flag calcs */
  681.  
  682.       switch (size = context->size)
  683.     {
  684.      default:
  685.       abort();
  686.       return 0;
  687.     case 8:
  688.       srca = (char) (context->srca);
  689.       srcb = (char) (context->srcb);
  690.       dst = (char) (context->dst);
  691.       mask = 0xff;
  692.       break;
  693.     case 16:
  694.       srca = (short) (context->srca);
  695.       srcb = (short) (context->srcb);
  696.       dst = (short) (context->dst);
  697.       mask = 0xffff;
  698.       break;
  699.     case 32:
  700.       srca = (long) (context->srca);
  701.       srcb = (long) (context->srcb);
  702.       dst = (long) (context->dst);
  703.       mask = 0xffffffff;
  704.       break;
  705.     }
  706.  
  707.       switch (c)
  708.     {
  709.     case T:
  710.       return 1;
  711.     case F:
  712.       return 0;
  713.     case EQ:
  714.       return !dst;
  715.     case NE:
  716.       return dst;
  717.     case GT:
  718.       ans = ((dst)) > 0;
  719.       if (slow)
  720.         {
  721.           if (is_cond_true (context, c) != ans)
  722.         abort ();
  723.         }
  724.       return ans;
  725.     case LE:
  726.       ans = ((dst)) <= 0;
  727.       if (slow)
  728.         {
  729.           if (is_cond_true (context, c) != ans)
  730.         abort ();
  731.         }
  732.       return ans;
  733.     case GE:
  734.       ans = ((dst)) >= 0;
  735.       if (slow)
  736.         {
  737.           if (is_cond_true (context, c) != ans)
  738.         abort ();
  739.         }
  740.       return ans;
  741.     case LT:
  742.       ans = ((dst)) < 0;
  743.       if (slow)
  744.         {
  745.           if (is_cond_true (context, c) != ans)
  746.         abort ();
  747.         }
  748.       return ans;
  749.     default:
  750.       break;
  751.     }
  752.  
  753.       /* Can't fake it, we'll have to work out the flags the
  754.          hard way */
  755.  
  756.       makeflags (context, mask);
  757.     }
  758.  
  759.   /* don't know how to fake a test, inspect the flags
  760.      the hard way */
  761.  
  762.   return is_cond_true (context, c);
  763. }
  764.