Advertisement
Guest User

Untitled

a guest
Jul 26th, 2015
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.54 KB | None | 0 0
  1. module common.rp6502.alu;
  2.  
  3.  
  4. class ALU
  5. {
  6.     public ubyte c;
  7.     public ubyte v;
  8.  
  9.     public ubyte shl(ubyte value, int carry = 0)
  10.     {
  11.         asm
  12.         {
  13.             ror carry, 1;
  14.             rcl value, 1;
  15.             mov ECX, this;
  16.             setc c[ECX];
  17.         }
  18.  
  19.         return value;
  20.     }
  21.  
  22.     public ubyte shr(ubyte value, int carry = 0)
  23.     {
  24.         asm
  25.         {
  26.             ror carry, 1;
  27.             rcr carry, 1;
  28.             mov ECX, this;
  29.             setc c[ECX];
  30.         }
  31.  
  32.         return value;
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement