Line 165... |
Line 165... |
begin
|
begin
|
alu_status[Z] <= STATUS[Z];
|
alu_status[Z] <= STATUS[Z];
|
alu_status[V] <= alu_a[6];
|
alu_status[V] <= alu_a[6];
|
alu_status[N] <= alu_a[7];
|
alu_status[N] <= alu_a[7];
|
end
|
end
|
INC_ZPG, INC_ZPX, INC_ABS, INC_ABX, DEC_ZPG, DEC_ZPX, DEC_ABS, DEC_ABX :
|
INC_ZPG, INC_ZPX, INC_ABS, INC_ABX, DEC_ZPG, DEC_ZPX, DEC_ABS, DEC_ABX, ASL_ZPG, ASL_ZPX, ASL_ABS, ASL_ABX :
|
begin
|
begin
|
alu_result <= result;
|
alu_result <= result;
|
alu_status <= STATUS;
|
alu_status <= STATUS;
|
|
|
end
|
end
|
default : begin
|
default : begin
|
//$display("ERROR");
|
//$display("ERROR");
|
end
|
end
|
endcase
|
endcase
|
Line 389... |
Line 388... |
STATUS[V] = 0;
|
STATUS[V] = 0;
|
end
|
end
|
|
|
// ASL - Arithmetic Shift Left
|
// ASL - Arithmetic Shift Left
|
ASL_ACC : begin
|
ASL_ACC : begin
|
{STATUS[C],result} = A << 1;
|
//{STATUS[C],result} = A << 1;
|
|
{STATUS[C],result} = {A,1'b0};
|
end
|
end
|
ASL_ZPG, ASL_ZPX, ASL_ABS, ASL_ABX : begin
|
ASL_ZPG, ASL_ZPX, ASL_ABS, ASL_ABX : begin
|
{STATUS[C],result} = alu_a << 1;
|
//{STATUS[C],result} = alu_a << 1;
|
|
{STATUS[C],result} = {alu_a,1'b0};
|
end
|
end
|
|
|
// LSR - Logical Shift Right
|
// LSR - Logical Shift Right
|
LSR_ACC: begin
|
LSR_ACC: begin
|
{result, STATUS[C]} = A >> 1;
|
//{result, STATUS[C]} = A >> 1;
|
|
{result,STATUS[C]} = {1'b0,A};
|
end
|
end
|
LSR_ZPG, LSR_ZPX, LSR_ABS, LSR_ABX : begin
|
LSR_ZPG, LSR_ZPX, LSR_ABS, LSR_ABX : begin
|
{result, STATUS[C]} = alu_a >> 1;
|
//{result, STATUS[C]} = alu_a >> 1;
|
|
{result,STATUS[C]} = {1'b0,alu_a};
|
end
|
end
|
|
|
// ROL - Rotate Left
|
// ROL - Rotate Left
|
ROL_ACC : begin
|
ROL_ACC : begin
|
{STATUS[C],result} = {A,alu_status[C]}; //TODO: does it really work?
|
{STATUS[C],result} = {A,alu_status[C]}; //TODO: does it really work?
|