1 // license:BSD-3-Clause 2 // copyright-holders:Farfetch'd, R. Belmont 3 /* 4 FULLY TRUSTED 5 */ 6 opBGT8()7uint32_t v60_device::opBGT8() /* TRUSTED */ 8 { 9 NORMALIZEFLAGS(); 10 11 if (!((_S ^ _OV) | _Z)) 12 { 13 PC += (int8_t)OpRead8(PC + 1); 14 return 0; 15 } 16 17 return 2; 18 } 19 opBGT16()20uint32_t v60_device::opBGT16() /* TRUSTED */ 21 { 22 NORMALIZEFLAGS(); 23 24 if (!((_S ^ _OV) | _Z)) 25 { 26 PC += (int16_t)OpRead16(PC + 1); 27 return 0; 28 } 29 30 return 3; 31 } 32 33 opBGE8()34uint32_t v60_device::opBGE8() /* TRUSTED */ 35 { 36 NORMALIZEFLAGS(); 37 38 if (!(_S ^ _OV)) 39 { 40 PC += (int8_t)OpRead8(PC + 1); 41 return 0; 42 } 43 44 return 2; 45 } 46 opBGE16()47uint32_t v60_device::opBGE16() /* TRUSTED */ 48 { 49 NORMALIZEFLAGS(); 50 51 if (!(_S ^ _OV)) 52 { 53 PC += (int16_t)OpRead16(PC + 1); 54 return 0; 55 } 56 57 return 3; 58 } 59 opBLT8()60uint32_t v60_device::opBLT8() /* TRUSTED */ 61 { 62 NORMALIZEFLAGS(); 63 64 if ((_S ^ _OV)) 65 { 66 PC += (int8_t)OpRead8(PC + 1); 67 return 0; 68 } 69 70 return 2; 71 } 72 opBLT16()73uint32_t v60_device::opBLT16() /* TRUSTED */ 74 { 75 NORMALIZEFLAGS(); 76 77 if ((_S ^ _OV)) 78 { 79 PC += (int16_t)OpRead16(PC + 1); 80 return 0; 81 } 82 83 return 3; 84 } 85 86 opBLE8()87uint32_t v60_device::opBLE8() /* TRUSTED */ 88 { 89 NORMALIZEFLAGS(); 90 91 if (((_S ^ _OV) | _Z)) 92 { 93 PC += (int8_t)OpRead8(PC + 1); 94 return 0; 95 } 96 97 return 2; 98 } 99 opBLE16()100uint32_t v60_device::opBLE16() /* TRUSTED */ 101 { 102 NORMALIZEFLAGS(); 103 104 if (((_S ^ _OV) | _Z)) 105 { 106 PC += (int16_t)OpRead16(PC + 1); 107 return 0; 108 } 109 110 return 3; 111 } 112 opBH8()113uint32_t v60_device::opBH8() /* TRUSTED */ 114 { 115 if (!(_CY | _Z)) 116 { 117 PC += (int8_t)OpRead8(PC + 1); 118 return 0; 119 } 120 121 return 2; 122 } 123 opBH16()124uint32_t v60_device::opBH16() /* TRUSTED */ 125 { 126 if (!(_CY | _Z)) 127 { 128 PC += (int16_t)OpRead16(PC + 1); 129 return 0; 130 } 131 132 return 3; 133 } 134 opBNH8()135uint32_t v60_device::opBNH8() /* TRUSTED */ 136 { 137 if ((_CY | _Z)) 138 { 139 PC += (int8_t)OpRead8(PC + 1); 140 return 0; 141 } 142 143 return 2; 144 } 145 opBNH16()146uint32_t v60_device::opBNH16() /* TRUSTED */ 147 { 148 if ((_CY | _Z)) 149 { 150 PC += (int16_t)OpRead16(PC + 1); 151 return 0; 152 } 153 154 return 3; 155 } 156 opBNL8()157uint32_t v60_device::opBNL8() /* TRUSTED */ 158 { 159 if (!(_CY)) 160 { 161 PC += (int8_t)OpRead8(PC + 1); 162 return 0; 163 } 164 165 return 2; 166 } 167 opBNL16()168uint32_t v60_device::opBNL16() /* TRUSTED */ 169 { 170 if (!(_CY)) 171 { 172 PC += (int16_t)OpRead16(PC + 1); 173 return 0; 174 } 175 176 return 3; 177 } 178 opBL8()179uint32_t v60_device::opBL8() /* TRUSTED */ 180 { 181 if ((_CY)) 182 { 183 PC += (int8_t)OpRead8(PC + 1); 184 return 0; 185 } 186 187 return 2; 188 } 189 opBL16()190uint32_t v60_device::opBL16() /* TRUSTED */ 191 { 192 if ((_CY)) 193 { 194 PC += (int16_t)OpRead16(PC + 1); 195 return 0; 196 } 197 198 return 3; 199 } 200 opBNE8()201uint32_t v60_device::opBNE8() /* TRUSTED */ 202 { 203 if (!(_Z)) 204 { 205 PC += (int8_t)OpRead8(PC + 1); 206 return 0; 207 } 208 209 return 2; 210 } 211 opBNE16()212uint32_t v60_device::opBNE16() /* TRUSTED */ 213 { 214 if (!(_Z)) 215 { 216 PC += (int16_t)OpRead16(PC + 1); 217 return 0; 218 } 219 220 return 3; 221 } 222 opBE8()223uint32_t v60_device::opBE8() /* TRUSTED */ 224 { 225 if ((_Z)) 226 { 227 PC += (int8_t)OpRead8(PC + 1); 228 return 0; 229 } 230 231 return 2; 232 } 233 opBE16()234uint32_t v60_device::opBE16() /* TRUSTED */ 235 { 236 if ((_Z)) 237 { 238 PC += (int16_t)OpRead16(PC + 1); 239 return 0; 240 } 241 242 return 3; 243 } 244 opBNV8()245uint32_t v60_device::opBNV8() /* TRUSTED */ 246 { 247 if (!(_OV)) 248 { 249 PC += (int8_t)OpRead8(PC + 1); 250 return 0; 251 } 252 253 return 2; 254 } 255 opBNV16()256uint32_t v60_device::opBNV16() /* TRUSTED */ 257 { 258 if (!(_OV)) 259 { 260 PC += (int16_t)OpRead16(PC + 1); 261 return 0; 262 } 263 264 return 3; 265 } 266 opBV8()267uint32_t v60_device::opBV8() /* TRUSTED */ 268 { 269 if ((_OV)) 270 { 271 PC += (int8_t)OpRead8(PC + 1); 272 return 0; 273 } 274 275 return 2; 276 } 277 opBV16()278uint32_t v60_device::opBV16() /* TRUSTED */ 279 { 280 if ((_OV)) 281 { 282 PC += (int16_t)OpRead16(PC + 1); 283 return 0; 284 } 285 286 return 3; 287 } 288 opBP8()289uint32_t v60_device::opBP8() /* TRUSTED */ 290 { 291 if (!(_S)) 292 { 293 PC += (int8_t)OpRead8(PC + 1); 294 return 0; 295 } 296 297 return 2; 298 } 299 opBP16()300uint32_t v60_device::opBP16() /* TRUSTED */ 301 { 302 if (!(_S)) 303 { 304 PC += (int16_t)OpRead16(PC + 1); 305 return 0; 306 } 307 308 return 3; 309 } 310 opBN8()311uint32_t v60_device::opBN8() /* TRUSTED */ 312 { 313 if ((_S)) 314 { 315 PC += (int8_t)OpRead8(PC + 1); 316 return 0; 317 } 318 319 return 2; 320 } 321 opBN16()322uint32_t v60_device::opBN16() /* TRUSTED */ 323 { 324 if ((_S)) 325 { 326 PC += (int16_t)OpRead16(PC + 1); 327 return 0; 328 } 329 330 return 3; 331 } 332 opBR8()333uint32_t v60_device::opBR8() /* TRUSTED */ 334 { 335 PC += (int8_t)OpRead8(PC + 1); 336 return 0; 337 } 338 opBR16()339uint32_t v60_device::opBR16() /* TRUSTED */ 340 { 341 PC += (int16_t)OpRead16(PC + 1); 342 return 0; 343 } 344 opBSR()345uint32_t v60_device::opBSR() /* TRUSTED */ 346 { 347 // Save Next PC onto the stack 348 SP -= 4; 349 m_program->write_dword_unaligned(SP, PC + 3); 350 351 // Jump to subroutine 352 PC += (int16_t)OpRead16(PC + 1); 353 return 0; 354 } 355