Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 0xF0: // BRA
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- ProgramCounter = address;
- break;
- case 0xF1: //BCC
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((Flags & FLAG_C) == 0)
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xF2: //BCS
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((Flags & FLAG_C) != 0)
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xF3: // BNE
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (Registers[REGISTER_A] != 0)
- {
- ProgramCounter = address;
- }
- break;
- case 0xF4: // BEQ
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (Registers[REGISTER_A] == 0)
- {
- ProgramCounter = address;
- }
- break;
- case 0xF5: // BVC
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((Flags & FLAG_V) == 0)
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xF6: // BVS
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((Flags & FLAG_V) != 0)
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xF7: // BMI
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset += 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((Flags & FLAG_N) != 0)
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xF8: // BPL
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset += 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((Flags & FLAG_N) == 0)
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xF9: // BGE
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if (!(((Flags & FLAG_N) == 0) ^ ((Flags & FLAG_V) == 0)))
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xFA: // BLE
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if ((((Flags & FLAG_N) == 0) || ((Flags & FLAG_Z) != 0)) ^ ((Flags & FLAG_V) == 0))
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xFB: // BGT
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if (!((((Flags & FLAG_N) == 0) || ((Flags & FLAG_Z) != 0)) ^ ((Flags & FLAG_V) == 0)))
- {
- ProgramCounter = address;
- }
- }
- break;
- case 0xFC: // BLT
- LB = fetch();
- offset = (WORD)LB;
- if ((offset & 0x80) != 0)
- {
- offset = offset + 0xFF00;
- }
- address = ProgramCounter + offset;
- if (address >= 0 && address < MEMORY_SIZE)
- {
- if (((Flags & FLAG_N) == 0) ^ ((Flags & FLAG_V) == 0))
- {
- ProgramCounter = address;
- }
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement