/[VRac]/M6502/M6502.pm
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 /M6502/M6502.pm

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

revision 35 by dpavlin, Mon Jul 30 21:53:04 2007 UTC revision 38 by dpavlin, Mon Jul 30 23:28:25 2007 UTC
# Line 23  our @mem = (0xff) x 0x10000;   # 64M Line 23  our @mem = (0xff) x 0x10000;   # 64M
23  # program counter  # program counter
24  our $PC = 0xbeef;  our $PC = 0xbeef;
25  # CPU registars  # CPU registars
26  our ( $A, $P, $X, $Y, $S ) = (0x42) x 5;  our ( $A, $P, $X, $Y, $S ) = (0) x 5;
27  # Set IPeriod to number of CPU cycles between calls to Loop6502  # Set IPeriod to number of CPU cycles between calls to Loop6502
28  our $IPeriod = 1;  our $IPeriod = 1;
29    
# Line 116  sub ram { Line 116  sub ram {
116          confess "no from address";          confess "no from address";
117  }  }
118    
119    =head2 push_R
120    
121    called by C<perl.c> to push changes in registars back to perl variables
122    
123    =cut
124    
125    sub push_R {
126            warn "push_R(",dump(@_),")\n";
127            my ( $a, $p, $x, $y, $s, $pc ) = @_;
128            $PC = $pc;
129            $S=$s; $X=$x; $Y=$y; $P=$p; $A=$a;
130            dump_R();
131    }
132    
133    =head2 dump_R
134    
135    helper function which dumps registers
136    
137    =cut
138    
139    sub dump_R {
140            warn sprintf("PC: %04x A:%02x P:%02x X:%02x Y:%02x S:%02x\n", $PC, $A, $P, $X, $Y, $S);
141    }
142    
143  1;  1;

Legend:
Removed from v.35  
changed lines
  Added in v.38

  ViewVC Help
Powered by ViewVC 1.1.26