/[gxemul]/trunk/src/cpus/cpu_rca180x_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_rca180x_instr.c

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

revision 33 by dpavlin, Mon Oct 8 16:20:58 2007 UTC revision 34 by dpavlin, Mon Oct 8 16:21:17 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2006  Anders Gavare.  All rights reserved.   *  Copyright (C) 2006-2007  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: cpu_rca180x_instr.c,v 1.1 2006/08/28 16:25:59 debug Exp $   *  $Id: cpu_rca180x_instr.c,v 1.3 2006/12/30 13:30:55 debug Exp $
29   *   *
30   *  RCA180X instructions.   *  RCA180X instructions.
31   *   *
# Line 250  X(jsr) Line 250  X(jsr)
250    
251          /*  Push return address to the stack:  */          /*  Push return address to the stack:  */
252          cpu->cd.rca180x.sp -= sizeof(uint16_t);          cpu->cd.rca180x.sp -= sizeof(uint16_t);
253          cpu->memory_rw(cpu, cpu->mem, cpu->cd.rca180x.sp, (unsigned char *)&pc12,          cpu->memory_rw(cpu, cpu->mem, cpu->cd.rca180x.sp,
254              sizeof(pc12), MEM_WRITE, PHYSICAL);              (unsigned char *)&pc12, sizeof(pc12), MEM_WRITE, PHYSICAL);
255    
256          cpu->cd.rca180x.next_ic = (struct rca180x_instr_call *) ic->arg[0];          cpu->cd.rca180x.next_ic = (struct rca180x_instr_call *) ic->arg[0];
257  }  }
# Line 265  X(rts) Line 265  X(rts)
265          uint16_t pc12;          uint16_t pc12;
266    
267          /*  Pop return address to the stack:  */          /*  Pop return address to the stack:  */
268          cpu->memory_rw(cpu, cpu->mem, cpu->cd.rca180x.sp, (unsigned char *)&pc12,          cpu->memory_rw(cpu, cpu->mem, cpu->cd.rca180x.sp,
269              sizeof(pc12), MEM_READ, PHYSICAL);              (unsigned char *)&pc12, sizeof(pc12), MEM_READ, PHYSICAL);
270          cpu->cd.rca180x.sp += sizeof(uint16_t);          cpu->cd.rca180x.sp += sizeof(uint16_t);
271    
272          cpu->pc = pc12 & 0xfff;          cpu->pc = pc12 & 0xfff;
# Line 380  X(str) Line 380  X(str)
380          int r;          int r;
381          for (r=0; r<=ic->arg[0]; r++) {          for (r=0; r<=ic->arg[0]; r++) {
382                  cpu->memory_rw(cpu, cpu->mem, cpu->cd.rca180x.index++,                  cpu->memory_rw(cpu, cpu->mem, cpu->cd.rca180x.index++,
383                      &cpu->cd.rca180x.v[r], sizeof(uint8_t), MEM_WRITE, PHYSICAL);                      &cpu->cd.rca180x.v[r], sizeof(uint8_t), MEM_WRITE,
384                        PHYSICAL);
385          }          }
386  }  }
387    
# Line 436  X(end_of_page) Line 437  X(end_of_page)
437  /*  /*
438   *  rca180x_instr_to_be_translated():   *  rca180x_instr_to_be_translated():
439   *   *
440   *  Translate an instruction word into an rca180x_instr_call. ic is filled in with   *  Translate an instruction word into an rca180x_instr_call. ic is filled in
441   *  valid data for the translated instruction, or a "nothing" instruction if   *  with valid data for the translated instruction, or a "nothing" instruction
442   *  there was a translation failure. The newly translated instruction is then   *  if there was a translation failure. The newly translated instruction is
443   *  executed.   *  then executed.
444   */   */
445  X(to_be_translated)  X(to_be_translated)
446  {  {

Legend:
Removed from v.33  
changed lines
  Added in v.34

  ViewVC Help
Powered by ViewVC 1.1.26