Advertisement
Guest User

jake smells v2

a guest
Feb 21st, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.09 KB | None | 0 0
  1. case 0xF0: // BRA
  2.  
  3. LB = fetch();
  4. offset = (WORD)LB;
  5. if ((offset & 0x80) != 0)
  6. {
  7. offset = offset + 0xFF00;
  8. }
  9. address = ProgramCounter + offset;
  10. ProgramCounter = address;
  11.  
  12. break;
  13.  
  14. case 0xF1: //BCC
  15.  
  16. LB = fetch();
  17. offset = (WORD)LB;
  18. if ((offset & 0x80) != 0)
  19. {
  20. offset = offset + 0xFF00;
  21. }
  22. address = ProgramCounter + offset;
  23. if (address >= 0 && address < MEMORY_SIZE)
  24. {
  25. if ((Flags & FLAG_C) == 0)
  26. {
  27. ProgramCounter = address;
  28. }
  29. }
  30.  
  31. break;
  32.  
  33. case 0xF2: //BCS
  34.  
  35. LB = fetch();
  36. offset = (WORD)LB;
  37. if ((offset & 0x80) != 0)
  38. {
  39. offset = offset + 0xFF00;
  40. }
  41. address = ProgramCounter + offset;
  42. if (address >= 0 && address < MEMORY_SIZE)
  43. {
  44. if ((Flags & FLAG_C) != 0)
  45. {
  46. ProgramCounter = address;
  47. }
  48. }
  49.  
  50. break;
  51.  
  52. case 0xF3: // BNE
  53.  
  54. LB = fetch();
  55. offset = (WORD)LB;
  56. if ((offset & 0x80) != 0)
  57. {
  58. offset = offset + 0xFF00;
  59. }
  60. address = ProgramCounter + offset;
  61. if (Registers[REGISTER_A] != 0)
  62. {
  63. ProgramCounter = address;
  64. }
  65.  
  66. break;
  67.  
  68. case 0xF4: // BEQ
  69.  
  70. LB = fetch();
  71. offset = (WORD)LB;
  72. if ((offset & 0x80) != 0)
  73. {
  74. offset = offset + 0xFF00;
  75. }
  76. address = ProgramCounter + offset;
  77. if (Registers[REGISTER_A] == 0)
  78. {
  79. ProgramCounter = address;
  80. }
  81.  
  82. break;
  83.  
  84. case 0xF5: // BVC
  85.  
  86. LB = fetch();
  87. offset = (WORD)LB;
  88. if ((offset & 0x80) != 0)
  89. {
  90. offset = offset + 0xFF00;
  91. }
  92. address = ProgramCounter + offset;
  93. if (address >= 0 && address < MEMORY_SIZE)
  94. {
  95. if ((Flags & FLAG_V) == 0)
  96. {
  97. ProgramCounter = address;
  98. }
  99. }
  100.  
  101. break;
  102.  
  103. case 0xF6: // BVS
  104.  
  105. LB = fetch();
  106. offset = (WORD)LB;
  107. if ((offset & 0x80) != 0)
  108. {
  109. offset = offset + 0xFF00;
  110. }
  111. address = ProgramCounter + offset;
  112. if (address >= 0 && address < MEMORY_SIZE)
  113. {
  114. if ((Flags & FLAG_V) != 0)
  115. {
  116. ProgramCounter = address;
  117. }
  118. }
  119.  
  120. break;
  121.  
  122. case 0xF7: // BMI
  123.  
  124. LB = fetch();
  125. offset = (WORD)LB;
  126. if ((offset & 0x80) != 0)
  127. {
  128. offset += 0xFF00;
  129. }
  130. address = ProgramCounter + offset;
  131. if (address >= 0 && address < MEMORY_SIZE)
  132. {
  133. if ((Flags & FLAG_N) != 0)
  134. {
  135. ProgramCounter = address;
  136. }
  137. }
  138.  
  139. break;
  140.  
  141. case 0xF8: // BPL
  142.  
  143. LB = fetch();
  144. offset = (WORD)LB;
  145. if ((offset & 0x80) != 0)
  146. {
  147. offset += 0xFF00;
  148. }
  149. address = ProgramCounter + offset;
  150. if (address >= 0 && address < MEMORY_SIZE)
  151. {
  152. if ((Flags & FLAG_N) == 0)
  153. {
  154. ProgramCounter = address;
  155. }
  156. }
  157.  
  158. break;
  159.  
  160. case 0xF9: // BGE
  161.  
  162. LB = fetch();
  163. offset = (WORD)LB;
  164. if ((offset & 0x80) != 0)
  165. {
  166. offset = offset + 0xFF00;
  167. }
  168. address = ProgramCounter + offset;
  169. if (address >= 0 && address < MEMORY_SIZE)
  170. {
  171. if (!(((Flags & FLAG_N) == 0) ^ ((Flags & FLAG_V) == 0)))
  172. {
  173. ProgramCounter = address;
  174. }
  175. }
  176.  
  177. break;
  178.  
  179. case 0xFA: // BLE
  180.  
  181. LB = fetch();
  182. offset = (WORD)LB;
  183. if ((offset & 0x80) != 0)
  184. {
  185. offset = offset + 0xFF00;
  186. }
  187. address = ProgramCounter + offset;
  188. if (address >= 0 && address < MEMORY_SIZE)
  189. {
  190. if ((((Flags & FLAG_N) == 0) || ((Flags & FLAG_Z) != 0)) ^ ((Flags & FLAG_V) == 0))
  191. {
  192. ProgramCounter = address;
  193. }
  194. }
  195. break;
  196.  
  197. case 0xFB: // BGT
  198.  
  199. LB = fetch();
  200. offset = (WORD)LB;
  201. if ((offset & 0x80) != 0)
  202. {
  203. offset = offset + 0xFF00;
  204. }
  205. address = ProgramCounter + offset;
  206. if (address >= 0 && address < MEMORY_SIZE)
  207. {
  208. if (!((((Flags & FLAG_N) == 0) || ((Flags & FLAG_Z) != 0)) ^ ((Flags & FLAG_V) == 0)))
  209. {
  210. ProgramCounter = address;
  211. }
  212. }
  213.  
  214. break;
  215.  
  216. case 0xFC: // BLT
  217.  
  218. LB = fetch();
  219. offset = (WORD)LB;
  220. if ((offset & 0x80) != 0)
  221. {
  222. offset = offset + 0xFF00;
  223. }
  224. address = ProgramCounter + offset;
  225. if (address >= 0 && address < MEMORY_SIZE)
  226. {
  227. if (((Flags & FLAG_N) == 0) ^ ((Flags & FLAG_V) == 0))
  228. {
  229. ProgramCounter = address;
  230. }
  231. }
  232.  
  233. break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement