Advertisement
Guest User

Untitled

a guest
Feb 20th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. case 0x96: //ASL (abs)
  2. HB = fetch();
  3. LB = fetch();
  4. address += (WORD)((WORD)HB << 8) + LB;
  5. temp_word = Memory[address];
  6. if (address >= 0 && address < MEMORY_SIZE) {
  7. if ((temp_word & 0x80) != 0) {
  8. Flags |= FLAG_C;
  9. }
  10. else {
  11. Flags &= (0xFF - FLAG_C);
  12. }
  13. temp_word <<= 1;
  14. if ((temp_word & 0x40) != 0) {
  15. temp_word += 0xFE;
  16. }
  17. }
  18. set_flag_z(temp_word);
  19. set_flag_n(temp_word);
  20. Memory[address] = (BYTE)temp_word;
  21.  
  22. break;
  23.  
  24. case 0xA6: //ASL Absolute X
  25. address += Index_Registers[REGISTER_X];
  26. HB = fetch();
  27. LB = fetch();
  28. address += (WORD)((WORD)HB << 8) + LB;
  29. temp_word = Memory[address];
  30. if (address >= 0 && address < MEMORY_SIZE) {
  31. if ((temp_word & 0x80) != 0) {
  32. Flags |= FLAG_C;
  33. }
  34. else {
  35. Flags &= (0xFF - FLAG_C);
  36. }
  37. temp_word <<= 1;
  38. if ((temp_word & 0x40) != 0) {
  39. temp_word += 0xFE;
  40. }
  41. }
  42. set_flag_z(temp_word);
  43. set_flag_n(temp_word);
  44. Memory[address] = (BYTE)temp_word;
  45.  
  46. break;
  47.  
  48. case 0xB6: //ASL Absolute Y
  49. address += Index_Registers[REGISTER_Y];
  50. HB = fetch();
  51. LB = fetch();
  52. address += (WORD)((WORD)HB << 8) + LB;
  53. temp_word = Memory[address];
  54. if (address >= 0 && address < MEMORY_SIZE) {
  55. if ((temp_word & 0x80) != 0) {
  56. Flags |= FLAG_C;
  57. }
  58. else {
  59. Flags &= (0xFF - FLAG_C);
  60. }
  61. temp_word <<= 1;
  62. if ((temp_word & 0x40) != 0) {
  63. temp_word += 0xFE;
  64. }
  65. }
  66. set_flag_z(temp_word);
  67. set_flag_n(temp_word);
  68. Memory[address] = (BYTE)temp_word;
  69.  
  70. break;
  71.  
  72. case 0xC6: //ASL Absolute XY
  73. address += (WORD)((WORD)Index_Registers[REGISTER_Y] << 8)
  74. + Index_Registers[REGISTER_X];
  75. HB = fetch();
  76. LB = fetch();
  77. address += (WORD)((WORD)HB << 8) + LB;
  78. temp_word = Memory[address];
  79. if (address >= 0 && address < MEMORY_SIZE) {
  80. if ((temp_word & 0x80) != 0) {
  81. Flags |= FLAG_C;
  82. }
  83. else {
  84. Flags &= (0xFF - FLAG_C);
  85. }
  86. temp_word <<= 1;
  87. if ((temp_word & 0x40) != 0) {
  88. temp_word += 0xFE;
  89. }
  90. }
  91. set_flag_z(temp_word);
  92. set_flag_n(temp_word);
  93. Memory[address] = (BYTE)temp_word;
  94.  
  95. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement