Function that execute the current instruction in the ROM.
575 {
576
578
581 break;
582
585 break;
586
589 break;
590
593 break;
594
597 break;
598
601 break;
602
605 break;
606
609 break;
610
613 break;
614
617 break;
618
621 break;
622
625 break;
626
629 break;
630
633 break;
634
637 break;
638
641 break;
642
645 break;
646
649 break;
650
653 break;
654
657 break;
658
661 break;
662
665 break;
666
669 break;
670
673 break;
674
677 break;
678
681 break;
682
685 break;
686
689 break;
690
693 break;
694
697 break;
698
701 break;
702
705 break;
706
709 break;
710
713 break;
714
717 break;
718
721 break;
722
725 break;
726
729 break;
730
733 break;
734
737 break;
738
741 break;
742
745 break;
746
749 break;
750
753 break;
754
757 break;
758
761 break;
762
765 break;
766
769 break;
770
773 break;
774
777 break;
778
781 break;
782
785 break;
786
789 break;
790
793 break;
794
797 break;
798
801 break;
802
805 break;
806
809 break;
810
813 break;
814
817 break;
818
821 break;
822
825 break;
826
829 break;
830
833 break;
834
837 break;
838
841 break;
842
845 break;
846
849 break;
850
853 break;
854
857 break;
858
861 break;
862
865 break;
866
869 break;
870
873 break;
874
877 break;
878
881 break;
882
885 break;
886
889 break;
890
893 break;
894
897 break;
898
901 break;
902
905 break;
906
909 break;
910
913 break;
914
917 break;
918
921 break;
922
925 break;
926
929 break;
930
933 break;
934
937 break;
938
941 break;
942
945 break;
946
949 break;
950
953 break;
954
957 break;
958
961 break;
962
964 break;
965
968 break;
969
972 break;
973
976 break;
977
980 break;
981
984 break;
985
988 break;
989
992 break;
993
996 break;
997
1000 break;
1001
1004 break;
1005
1008 break;
1009
1012 break;
1013
1016 break;
1017
1020 break;
1021
1024 break;
1025
1028 break;
1029
1032 break;
1033
1036 break;
1037
1040 break;
1041
1044 break;
1045
1048 break;
1049
1052 break;
1053
1056 break;
1057
1060 break;
1061
1064 break;
1065
1068 break;
1069
1072 break;
1073
1076 break;
1077
1080 break;
1081
1084 break;
1085
1088 break;
1089
1092 break;
1093
1096 break;
1097
1100 break;
1101
1104 break;
1105
1108 break;
1109
1112 break;
1113
1116 break;
1117
1120 break;
1121
1124 break;
1125
1128 break;
1129
1132 break;
1133
1136 break;
1137
1140 break;
1141
1144 break;
1145
1148 break;
1149
1152 break;
1153
1156 break;
1157
1160 break;
1161
1164 break;
1165
1168 break;
1169
1172 break;
1173
1176 break;
1177
1180 break;
1181
1182 default:
1184 break;
1185 }
1186
1187 return 0;
1188}
#define ADD_indexed_indirect(processor, addr, offset)
Procedure that perform a ADD with the carry flag (A,Z,C,N=A+M+C) with indexed indirect addressing mod...
#define STR_absolute_X(processor, addr)
Procedure that store the X register value to a memory address.
#define COMPARE_indexed_indirect_ACC(processor, addr, offset)
Procedure that performs a CMP operation (Z, C, N = A - M) with an indexed indirect addressing mode.
#define COMPARE_Immediate_ACC(processor, value)
Procedure that performs a CMP operation (Z,C,N = A - M) with an immediate value.
#define TR_ACC_X(processor)
Procedure that store the value in the accumulator in the X register.
#define OR_indexed_indirect(processor, addr, offset)
Procedure that perform a OR with the carry flag (A,Z,C,N=A+M+C) with indexed indirect addressing mode...
#define PULL_FLAGS(processor)
Procedure that pop the top value of the stack and return it to the flags register.
#define COMPARE_absolute_Y(processor, addr)
Procedure that performs a CMP operation (Z, C, N = Y - M) with an indirect indexed addressing mode.
#define OR_absolute(processor, addr)
Procedure that performs a bitwise logic OR (A,Z,N = A&M) using absolute addressing mode.
#define BRANCH_If_Minus(processor, offset)
Procedure that performs a BMI (branch if positive, if the N flag is clear)
#define AND_indirect_indexed(processor, addr, offset)
Procedure that perform a AND with the carry flag (A,Z,C,N=A+M+C) with indirect indexed.
#define TR_ACC_Y(processor)
Procedure that store the value in accumulator in the Y register.
#define ROTATION_RIGHT_absolute(processor, addr)
Procedure that performs a bit shift with rotation to the right (ROR operation) at the memory address ...
#define ROTATION_RIGHT_offset(processor, addr, offset)
Procedure that performs a bit shift with rotation to the right (ROR operation) at the memory address ...
#define ADD_immediate(processor, data)
Procedure that perform a ADD with the carry flag (A,Z,C,N=A+data+C) with an immediate.
#define SHIFT_RIGHT_absolute(processor, addr)
Procedure that performs a bitshift to the right (LSR operation) at the address addr and place the 0th...
#define ROTATION_RIGHT_ACC(processor)
Procedure that performs a bit shift with rotation to the right (ROR operation) on the accumulator....
#define TR_X_SP(processor)
Procedure that store the value in the X register in the stack pointer.
#define STR_offset_ACC(processor, addr, offset)
Procedure that store the accumulator value to a memory address + offset.
#define XOR_immediate(processor, data)
Procedure that performs a bitwise logic XOR (A,Z,N = A & data)
#define DEC_Y(processor)
Procedure that decrements the Y register.
#define XOR_indexed_indirect(processor, addr, offset)
Procedure that perform a XOR with the carry flag (A,Z,C,N=A+M+C) with indexed indirect addressing mod...
#define get_address(cpu)
Macro to recreate the current address pointed by pc + 1.
#define STR_offset_X(processor, addr, offset)
Procedure that store the X register value to a memory address + offset.
#define DEC_offset(processor, addr, offset)
Procedure that decrement a specific memory location.
#define STR_absolute_ACC(processor, addr)
Procedure that store the accumulator value to a memory address.
#define LD_indirect_indexed_ACC(processor, addr, offset)
Procedure that loads to the accmulator using Inderect Indexed.
#define COMPARE_indirect_indexed_ACC(processor, addr, offset)
Procedure that performs a CMP operation (Z, C, N = A - M) with an indirect indexed addressing mode.
#define OR_immediate(processor, data)
Procedure that performs a bitwise logic OR (A,Z,N = A & data)
#define ADD_indirect_indexed(processor, addr, offset)
Procedure that perform a ADD with the carry flag (A,Z,C,N=A+M+C) with indirect indexed.
#define AND_absolute(processor, addr)
Procedure that performs a bitwise logic AND (A,Z,N = A&M) using absolute addressing mode.
#define BRANCH_Carry_S(processor, offset)
Procedure that performs a BCS (branch if positive, if the N flag is clear)
#define AND_indexed_indirect(processor, addr, offset)
Procedure that perform a AND with the carry flag (A,Z,C,N=A+M+C) with indexed indirect addressing mod...
#define COMPARE_Immediate_X(processor, value)
Procedure that performs a CMP operation (Z, C, N = X - M) with a value addressing mode.
#define BRANCH_Not_Equal(processor, offset)
Procedure that performs a BNE (if the Z flag is clear)
#define BRANCH_If_Positive(processor, offset)
Procedure that performs a BPL (branch if positive, if the N flag is clear)
#define STR_indirect_indexed_ACC(processor, addr, offset)
Procedure that store the accumulator value to a memory address using indirect indexed addressing mode...
#define INC_offset(processor, addr, offset)
Procedure that increment a specific memory location.
#define COMPARE_offset_ACC(processor, addr, offset)
Procedure that performs a CMP operation (Z, C, N = A - M) with an absolute + offset addressing mode.
#define STR_offset_Y(processor, addr, offset)
Procedure that store the Y register value to a memory address + offset.
#define DEC_X(processor)
Procedure that decrements the X register.
#define BREAK(processor)
Procedure that performs a break instruction (forces an interrupt).
#define RETURN_Subroutine(processor)
Procedure that performs a return from subroutine (RTS instruction) by pulling the top two elements of...
#define LD_absolute_X(processor, addr)
Procedure that loads a value from memory at the address addr to the X register.
#define LD_immediate_ACC(processor, d)
Procedure that loads an immediate (const value) in the accumulator.
#define LD_immediate_X(processor, d)
Procedure that loads an immediate (const value) in the X register.
#define SHIFT_LEFT_ACC(processor)
Procedure that performs a bitshift to the left (ASL operation) on the accumulator and place the 7th b...
#define BIT_TEST(processor, addr)
Procedure that performs a BIT test (A & M, N = M7, V = M6)
#define ADD_offset(processor, addr, offset)
Procedure that perform a ADD with the carry flag (A,Z,C,N=A+M+C) with absolute+offset addressing addr...
#define PUSH_ACC(processor)
Procedure that push the accumulator value to the top of the stack.
#define SHIFT_LEFT_absolute(processor, addr)
Procedure that performs a bitshift to the left (ASL operation) at the address addr and place the 7th ...
#define SBC_indexed_indirect(processor, addr, offset)
Procedure that perform a SBC with the carry flag (A,Z,C,N=A-M-C) with indexed indirect addressing mod...
#define INC_Y(processor)
Procedure that increments the Y register.
#define XOR_absolute(processor, addr)
Procedure that performs a bitwise logic XOR (A,Z,N = A&M) using absolute addressing mode.
#define LD_absolute_Y(processor, addr)
Procedure that loads a value from memory at the address addr to the Y register.
#define JUMP_absolute(processor, addr)
Procedure that sets the program counter to a certain address (JMP instruction)
#define PULL_ACC(processor)
Procedure that pop the top value of the stack and return it to the accumulator.
#define SBC_offset(processor, addr, offset)
Procedure that perform a SBC with the carry flag (A,Z,C,N=A-M-C) with offset addressing mode.
#define SBC_absolute(processor, addr)
Procedure that perform a SBC with the carry flag (A,Z,C,N=A-M-C) with absolute addressing mode.
#define OR_offset(processor, addr, offset)
Procedure that performs a bitwise logic OR (A,Z,N = A&M) using offset addressing mode.
#define SBC_immediate(processor, data)
Procedure that perform a substract with the carry flag (A,Z,C,N=A-data-C) with an immediate.
#define BRANCH_Equal(processor, offset)
Procedure that performs a BEQ (branch if positive, if the N flag is clear)
#define TR_SP_X(processor)
Procedure that store the stack pointer in the X register.
#define LD_indexed_indirect_ACC(processor, addr, offset)
Procedure that loads to the accumulator using Indexed Indirect.
#define LD_offset_ACC(processor, addr, offset)
Procedure that loads a value from memory at address addr+offset to the X register.
#define RETURN_Interrupt(processor)
Procedure that performs a return from interrupt (RTI instruction) by pulling the flags from the top o...
#define LD_absolute_ACC(processor, addr)
Procedure that loads a value from memory at the address addr to the accumulator.
#define COMPARE_Immediate_Y(processor, value)
Procedure that performs a CMP operation (Z, C, N = Y - M) with a value addressing mode.
#define DEC_absolute(processor, addr)
Procedure that decrement a specific memory location.
#define XOR_offset(processor, addr, offset)
Procedure that performs a bitwise logic XOR (A,Z,N = A&M) using offset addressing mode.
#define INC_absolute(processor, addr)
Procedure that increment a specific memory location.
#define AND_offset(processor, addr, offset)
Procedure that performs a bitwise logic AND (A,Z,N = A&M) using offset addressing mode.
#define TR_X_ACC(processor)
Procedure that store the value in the X register in the accumulator.
#define SHIFT_RIGHT_ACC(processor)
Procedure that performs a bitshift to the right (LSR operation) on the accumulator and place the 0th ...
#define OR_indirect_indexed(processor, addr, offset)
Procedure that perform a OR with the carry flag (A,Z,C,N=A+M+C) with indirect indexed.
#define XOR_indirect_indexed(processor, addr, offset)
Procedure that perform a XOR with the carry flag (A,Z,C,N=A+M+C) with indirect indexed.
#define ROTATION_LEFT_offset(processor, addr, offset)
Procedure that performs a bit shift with rotation to the left (ROL operation) at the memory address (...
#define TR_Y_ACC(processor)
Procedure that store the value in the Y register in the accumulator.
#define COMPARE_absolute_X(processor, addr)
Procedure that performs a CMP operation (Z, C, N = X - M) with an indirect indexed addressing mode.
#define SBC_indirect_indexed(processor, addr, offset)
Procedure that perform a SBC with the carry flag (A,Z,C,N=A-M-C) with indirect indexed addressing mod...
#define JUMP_Subroutine(processor, addr)
Procedure that performs a Jump to a subroutine (JSR instruction) located at the address addr.
#define SHIFT_RIGHT_offset(processor, addr, offset)
Procedure that performs a bitshift to the right (LSR operation) at the address (addr + offset) and pl...
#define LD_immediate_Y(processor, d)
Procedure that loads an immediate (const value) in the Y register.
#define JUMP_indirect(processor, addr)
Procedure that sets the program counter to a certain indirect address (JMP instruction)
#define COMPARE_absolute_ACC(processor, addr)
Procedure that performs a CMP operation (Z, C, N = A - M) with an absolute addressing mode.
#define INC_X(processor)
Procedure that increments the X register.
#define ADD_absolute(processor, addr)
Procedure that perform a ADD with the carry flag (A,Z,C,N=A+M+C) with absolute addressing mode.
#define BRANCH_Overflow_S(processor, offset)
Procedure that performs a BVS (branch if positive, if the N flag is clear)
#define BRANCH_Overflow_C(processor, offset)
Procedure that performs a BVC (branch if overflow clear, if the V flag is clear)
#define ROTATION_LEFT_absolute(processor, addr)
Procedure that performs a bit shift with rotation to the left (ROL operation) at the memory address a...
#define PUSH_FLAGS(processor)
Procedure that push the processor flags to the top of the stack.
#define LD_offset_X(processor, addr, offset)
Procedure that loads a value from memory at address addr+offset to the X register.
#define AND_immediate(processor, data)
Procedure that performs a bitwise logic AND (A,Z,N = A & data)
#define BRANCH_Carry_C(processor, offset)
Procedure that performs a BCC (if the C flag is clear)
#define STR_absolute_Y(processor, addr)
Procedure that store the Y register value to a memory address.
#define ROTATION_LEFT_ACC(processor)
Procedure that performs a bit shift with rotation to the left (ROL operation) on the accumulator....
#define SHIFT_LEFT_offset(processor, addr, offset)
Procedure that performs a bitshift to the left (ASL operation) at the address (addr + offset) and pla...
#define STR_indexed_indirect_ACC(processor, addr, offset)
Procedure that store the accumulator value to a memory address using indexes indirect addressing mode...
#define LD_offset_Y(processor, addr, offset)
Procedure that loads a value from memory at address addr+offset to the Y register.
@ LSR_ZX
LSR Zero Page, X.
@ RTI
Return from the current interrupt.
@ CMP_IdX
CMP (Indirect, X)
@ ROL_ZX
ROL Zero Page, X.
@ CMP_IdY
CMP (Indirect), Y.
@ ASL_ZX
ASL Zero Page, X.
@ ORA_ZX
ORA Zero Page, X.
@ SBC_ZX
SBC Zero Page, X.
@ LDX_ZY
LDX Zero Page, Y.
@ ADC_IdX
ADC (Indirect, X)
@ LDY_ZX
LDY Zero Page, X.
@ AND_ZX
AND Zero Page, X.
@ INC_ZX
INC Zero Page, X.
@ PLP
flags = pull(); sp = sp + 1;
@ ADC_ZX
ADC Zero Page, X.
@ AND_IdX
AND (Indirect, X)
@ CMP_ZX
CMP Zero Page, X.
@ PHP
push(flags); sp = sp - 1;
@ EOR_ZX
EOR Zero Page, X.
@ LDA_ZX
LDA Zero Page, X.
@ AND_IdY
AND (Indirect), Y.
@ SBC_IdY
SBC (Indirect), Y.
@ ADC_IdY
ADC (Indirect), Y.
@ ROR_ZX
ROR Zero Page, X.
@ STA_IdY
STA (Indirect), Y.
@ SBC_IdX
SBC (Indirect, X)
@ STY_ZX
STY Zero Page, X.
@ ORA_IdY
ORA (Indirect), Y.
@ STA_IdX
STA (Indirect, X)
@ STX_ZY
STX Zero Page, Y.
@ PLA
ACC = pull(); sp = sp + 1;.
@ STA_ZX
STA Zero Page, X.
@ EOR_IdX
EOR (Indirect, X)
@ DEC_ZX
DEC Zero Page, X.
@ EOR_IdY
EOR (Indirect), Y.
@ LDA_IdX
LDA (Indirect, X)
@ LDA_IdY
LDA (Indirect), Y.
@ PHA
push(ACC); sp = sp - 1;
@ ORA_IdX
ORA (Indirect, X)
@ RTS
Return from the current subroutine.
@ JSR
Jump to the subroutine.
data register_y
A 8 bit register. Commonly used to hold offset and counters.
address program_counter
An address pointing to the next instruction to be executed.
memory mem
A direct access to the Emulator Memory.
data register_x
A 8 bit register. Commonly used to hold offset and counters.