/[gxemul]/trunk/src/cpus/cpu_m68k_instr.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/cpus/cpu_m68k_instr.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 14 by dpavlin, Mon Oct 8 16:18:51 2007 UTC revision 20 by dpavlin, Mon Oct 8 16:19:23 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_m68k_instr.c,v 1.2 2005/09/17 17:14:27 debug Exp $   *  $Id: cpu_m68k_instr.c,v 1.3 2005/11/06 22:41:12 debug Exp $
29   *   *
30   *  Motorola 68K instructions.   *  Motorola 68K instructions.
31   *   *
32   *  Individual functions should keep track of cpu->n_translated_instrs. Since   *  Individual functions should keep track of cpu->n_translated_instrs.
  *  M68K uses variable length instructions, cpu->cd.m68k.next_ic must also be  
  *  increased by the number of "instruction slots" that were executed. (I.e.  
  *  if an instruction occupying 6 bytes was executed, then next_ic should be  
  *  increased by 3.)  
  *  
33   *  (n_translated_instrs is automatically increased by 1 for each function   *  (n_translated_instrs is automatically increased by 1 for each function
34   *  call. If no instruction was executed, then it should be decreased. If, say,   *  call. If no instruction was executed, then it should be decreased. If, say,
35   *  4 instructions were combined into one function and executed, then it should   *  4 instructions were combined into one function and executed, then it should
# Line 47  Line 42 
42   */   */
43  X(nop)  X(nop)
44  {  {
         cpu->cd.m68k.next_ic ++;  
45  }  }
46    
47    
# Line 72  X(end_of_page) Line 66  X(end_of_page)
66    
67    
68  /*  /*
  *  m68k_combine_instructions():  
  *  
  *  Combine two or more instructions, if possible, into a single function call.  
  */  
 void m68k_combine_instructions(struct cpu *cpu, struct m68k_instr_call *ic,  
         uint32_t addr)  
 {  
         int n_back;  
         n_back = (addr >> 1) & (M68K_IC_ENTRIES_PER_PAGE-1);  
   
         if (n_back >= 1) {  
                 /*  TODO  */  
         }  
   
         /*  TODO: Combine forward as well  */  
 }  
   
   
 /*****************************************************************************/  
   
   
 /*  
69   *  m68k_instr_to_be_translated():   *  m68k_instr_to_be_translated():
70   *   *
71   *  Translate an instruction word into an m68k_instr_call. ic is filled in with   *  Translate an instruction word into an m68k_instr_call. ic is filled in with
# Line 108  X(to_be_translated) Line 80  X(to_be_translated)
80          unsigned char *page;          unsigned char *page;
81          unsigned char ib[2];          unsigned char ib[2];
82          int main_opcode;          int main_opcode;
83          void (*samepage_function)(struct cpu *, struct m68k_instr_call *);          /* void (*samepage_function)(struct cpu *, struct m68k_instr_call *);*/
84    
85          /*  Figure out the (virtual) address of the instruction:  */          /*  Figure out the (virtual) address of the instruction:  */
86          low_pc = ((size_t)ic - (size_t)cpu->cd.m68k.cur_ic_page)          low_pc = ((size_t)ic - (size_t)cpu->cd.m68k.cur_ic_page)

Legend:
Removed from v.14  
changed lines
  Added in v.20

  ViewVC Help
Powered by ViewVC 1.1.26