URL
https://opencores.org/ocsvn/t6507lp/t6507lp/trunk
Subversion Repositories t6507lp
Compare Revisions
- This comparison shows the changes necessary to convert path
/t6507lp/trunk
- from Rev 240 to Rev 239
- ↔ Reverse comparison
Rev 240 → Rev 239
/fv/alu_chk.e
187,14 → 187,14
ASL_ABS: { exec_asl_mem(); }; |
ASL_ABX: { exec_asl_mem(); }; |
|
//BCC_REL: {}; // nothing is done. these are all branches. |
//BCS_REL: {}; |
//BEQ_REL: {}; |
//BMI_REL: {}; |
//BNE_REL: {}; |
//BPL_REL: {}; |
//BVC_REL: {}; |
//BVS_REL: {}; |
BCC_REL: {}; // nothing is done. these are all branches. |
BCS_REL: {}; |
BEQ_REL: {}; |
BMI_REL: {}; |
BNE_REL: {}; |
BPL_REL: {}; |
BVC_REL: {}; |
BVS_REL: {}; |
|
BIT_ZPG: { exec_bit(); }; // Z = A & M, N = M7, V = M6 |
BIT_ABS: { exec_bit(); }; |
248,9 → 248,9
INX_IMP: { exec_inc(reg_x, FALSE); }; |
INY_IMP: { exec_inc(reg_y, FALSE); }; |
|
//JMP_ABS: {}; |
//JMP_IND: {}; |
//JSR_ABS: {}; |
JMP_ABS: {}; |
JMP_IND: {}; |
JSR_ABS: {}; |
|
LDA_IMM: { exec_load(reg_a, TRUE); }; // A,Z,N = M |
LDA_ZPG: { exec_load(reg_a, TRUE); }; |
279,7 → 279,7
LSR_ABS: { exec_lsr(inst.alu_a); }; |
LSR_ABX: { exec_lsr(inst.alu_a); }; |
|
//NOP_IMP: {}; |
NOP_IMP: {}; |
|
ORA_IMM: { exec_or(); }; // A,Z,N = A|M |
ORA_ZPG: { exec_or(); }; |
291,7 → 291,7
ORA_IDY: { exec_or(); }; |
|
PHA_IMP: { reg_result = reg_a; }; |
//PHP_IMP: {}; // P is always connected and the result is not updated |
PHP_IMP: {}; // P is always connected and the result is not updated |
PLA_IMP: { |
reg_a = inst.alu_a; |
reg_result = inst.alu_a; |
315,7 → 315,7
ROR_ABX: { exec_rot(FALSE, inst.alu_a); }; |
|
RTI_IMP: { reg_status = inst.alu_a; reg_status[5:5] = 1; }; |
//RTS_IMP: { }; |
RTS_IMP: { }; |
|
SBC_IMM: { exec_sub(); }; // A,Z,C,N = A-M-(1-C) |
SBC_ZPG: { exec_sub(); }; |
372,8 → 372,10
reg_result = reg_a - inst.alu_a - 1 + reg_status[0:0]; |
|
reg_status[7:7] = temp[7:7]; // N |
//print (reg_a ^ inst.alu_a) & (reg_a ^ temp) & 0x80; |
reg_status[6:6] = (reg_a[7:7] ^ inst.alu_a[7:7]) & (reg_a[7:7] ^ temp[7:7]); // V |
|
print reg_result; |
if (reg_result == 0) { |
reg_status[1:1] = 1; // Z |
} else { |
385,16 → 387,21
var op2 : int; |
|
op1 = (reg_a & 0x0f ) - (inst.alu_a & 0x0f) - ( (reg_status[0:0] == 1) ? 0 : 1); |
print op1; |
op2 = (reg_a & 0xf0) - (inst.alu_a & 0xf0); |
print op2; |
|
if (op1[4:4] == 1) { |
op1 -= 6; |
op2 = op2 - 1; |
}; |
print op1; |
print op2; |
|
if(op2[8:8] == 1) { |
op2 -= 0x60; |
}; |
print op2; |
|
reg_a = (op1 & 0x0f) | (op2 & 0xf0); |
reg_result = reg_a; |
/fv/alu_opcodes.e
3,36 → 3,24
type valid_opcodes : [ |
ADC_IMM = 8'h69, ADC_ZPG = 8'h65, ADC_ZPX = 8'h75, ADC_ABS = 8'h6D, ADC_ABX = 8'h7D, ADC_ABY = 8'h79, ADC_IDX = 8'h61, ADC_IDY = 8'h71, |
AND_IMM = 8'h29, AND_ZPG = 8'h25, AND_ZPX = 8'h35, AND_ABS = 8'h2D, AND_ABX = 8'h3D, AND_ABY = 8'h39, AND_IDX = 8'h21, AND_IDY = 8'h31, |
ASL_ACC = 8'h0A, ASL_ZPG = 8'h06, ASL_ZPX = 8'h16, ASL_ABS = 8'h0E, ASL_ABX = 8'h1E, |
BIT_ZPG = 8'h24, BIT_ABS = 8'h2C, BRK_IMP = 8'h00, |
ASL_ACC = 8'h0A, ASL_ZPG = 8'h06, ASL_ZPX = 8'h16, ASL_ABS = 8'h0E, ASL_ABX = 8'h1E, BCC_REL = 8'h90, BCS_REL = 8'hB0, BEQ_REL = 8'hF0, |
BIT_ZPG = 8'h24, BIT_ABS = 8'h2C, BMI_REL = 8'h30, BNE_REL = 8'hD0, BPL_REL = 8'h10, BRK_IMP = 8'h00, BVC_REL = 8'h50, BVS_REL = 8'h70, |
CLC_IMP = 8'h18, CLD_IMP = 8'hD8, CLI_IMP = 8'h58, CLV_IMP = 8'hB8, CMP_IMM = 8'hC9, CMP_ZPG = 8'hC5, CMP_ZPX = 8'hD5, CMP_ABS = 8'hCD, |
CMP_ABX = 8'hDD, CMP_ABY = 8'hD9, CMP_IDX = 8'hC1, CMP_IDY = 8'hD1, CPX_IMM = 8'hE0, CPX_ZPG = 8'hE4, CPX_ABS = 8'hEC, CPY_IMM = 8'hC0, |
CPY_ZPG = 8'hC4, CPY_ABS = 8'hCC, DEC_ZPG = 8'hC6, DEC_ZPX = 8'hD6, DEC_ABS = 8'hCE, DEC_ABX = 8'hDE, DEX_IMP = 8'hCA, DEY_IMP = 8'h88, |
EOR_IMM = 8'h49, EOR_ZPG = 8'h45, EOR_ZPX = 8'h55, EOR_ABS = 8'h4D, EOR_ABX = 8'h5D, EOR_ABY = 8'h59, EOR_IDX = 8'h41, EOR_IDY = 8'h51, |
INC_ZPG = 8'hE6, INC_ZPX = 8'hF6, INC_ABS = 8'hEE, INC_ABX = 8'hFE, INX_IMP = 8'hE8, INY_IMP = 8'hC8, |
LDA_IMM = 8'hA9, LDA_ZPG = 8'hA5, LDA_ZPX = 8'hB5, LDA_ABS = 8'hAD, LDA_ABX = 8'hBD, LDA_ABY = 8'hB9, LDA_IDX = 8'hA1, |
INC_ZPG = 8'hE6, INC_ZPX = 8'hF6, INC_ABS = 8'hEE, INC_ABX = 8'hFE, INX_IMP = 8'hE8, INY_IMP = 8'hC8, JMP_ABS = 8'h4C, JMP_IND = 8'h6C, |
JSR_ABS = 8'h20, LDA_IMM = 8'hA9, LDA_ZPG = 8'hA5, LDA_ZPX = 8'hB5, LDA_ABS = 8'hAD, LDA_ABX = 8'hBD, LDA_ABY = 8'hB9, LDA_IDX = 8'hA1, |
LDA_IDY = 8'hB1, LDX_IMM = 8'hA2, LDX_ZPG = 8'hA6, LDX_ZPY = 8'hB6, LDX_ABS = 8'hAE, LDX_ABY = 8'hBE, LDY_IMM = 8'hA0, LDY_ZPG = 8'hA4, |
LDY_ZPX = 8'hB4, LDY_ABS = 8'hAC, LDY_ABX = 8'hBC, LSR_ACC = 8'h4A, LSR_ZPG = 8'h46, LSR_ZPX = 8'h56, LSR_ABS = 8'h4E, LSR_ABX = 8'h5E, |
ORA_IMM = 8'h09, ORA_ZPG = 8'h05, ORA_ZPX = 8'h15, ORA_ABS = 8'h0D, ORA_ABX = 8'h1D, ORA_ABY = 8'h19, ORA_IDX = 8'h01, |
ORA_IDY = 8'h11, PHA_IMP = 8'h48, PLA_IMP = 8'h68, PLP_IMP = 8'h28, ROL_ACC = 8'h2A, ROL_ZPG = 8'h26, ROL_ZPX = 8'h36, |
NOP_IMP = 8'hEA, ORA_IMM = 8'h09, ORA_ZPG = 8'h05, ORA_ZPX = 8'h15, ORA_ABS = 8'h0D, ORA_ABX = 8'h1D, ORA_ABY = 8'h19, ORA_IDX = 8'h01, |
ORA_IDY = 8'h11, PHA_IMP = 8'h48, PHP_IMP = 8'h08, PLA_IMP = 8'h68, PLP_IMP = 8'h28, ROL_ACC = 8'h2A, ROL_ZPG = 8'h26, ROL_ZPX = 8'h36, |
ROL_ABS = 8'h2E, ROL_ABX = 8'h3E, ROR_ACC = 8'h6A, ROR_ZPG = 8'h66, ROR_ZPX = 8'h76, ROR_ABS = 8'h6E, ROR_ABX = 8'h7E, RTI_IMP = 8'h40, |
SBC_IMM = 8'hE9, SBC_ZPG = 8'hE5, SBC_ZPX = 8'hF5, SBC_ABS = 8'hED, SBC_ABX = 8'hFD, SBC_ABY = 8'hF9, SBC_IDX = 8'hE1, |
RTS_IMP = 8'h60, SBC_IMM = 8'hE9, SBC_ZPG = 8'hE5, SBC_ZPX = 8'hF5, SBC_ABS = 8'hED, SBC_ABX = 8'hFD, SBC_ABY = 8'hF9, SBC_IDX = 8'hE1, |
SBC_IDY = 8'hF1, SEC_IMP = 8'h38, SED_IMP = 8'hF8, SEI_IMP = 8'h78, STA_ZPG = 8'h85, STA_ZPX = 8'h95, STA_ABS = 8'h8D, STA_ABX = 8'h9D, |
STA_ABY = 8'h99, STA_IDX = 8'h81, STA_IDY = 8'h91, STX_ZPG = 8'h86, STX_ZPY = 8'h96, STX_ABS = 8'h8E, STY_ZPG = 8'h84, STY_ZPX = 8'h94, |
STY_ABS = 8'h8C, TAX_IMP = 8'hAA, TAY_IMP = 8'hA8, TSX_IMP = 8'hBA, TXA_IMP = 8'h8A, TXS_IMP = 8'h9A, TYA_IMP = 8'h98 ]; |
'> |
|
JMP_IND = 8'h6C REMOVED FROM TEST SINCE THESE DO NOT GO TO THE ALU |
JMP_ABS = 8'h4C |
PHP_IMP = 8'h08 |
BCC_REL = 8'h90, |
BCS_REL = 8'hB0, |
BEQ_REL = 8'hF0, |
BMI_REL = 8'h30, |
BNE_REL = 8'hD0, |
BPL_REL = 8'h10, |
BVC_REL = 8'h50, |
BVS_REL = 8'h70, |
JSR_ABS = 8'h20, |
NOP_IMP = 8'hEA, |
RTS_IMP = 8'h60, |
|
|