Made the processor actually little-endian

This commit is contained in:
(Tim) Efthimis Kritikos 2023-02-10 14:08:39 +00:00
parent 19fcf11f63
commit 6561018206
2 changed files with 8 additions and 7 deletions

View File

@ -1,4 +1,4 @@
ADD AX,#0x55AA ADD AX,#0xDEAD
ADD CX,#0xEFBE ADD CX,#0xBEEF
ADD CX,#0x1141 ADD CX,#0x4111
ADD AX,#0x1111 ADD AX,#0x2200

View File

@ -219,17 +219,18 @@ always @(posedge clock) begin
end end
`PROC_DE_LOAD_16_PARAM:begin `PROC_DE_LOAD_16_PARAM:begin
if(unaligned_access==1)begin if(unaligned_access==1)begin
PARAM1[15:8] = external_data_bus[7:0]; PARAM1[7:0] = external_data_bus[7:0];
ProgCount=ProgCount+1; ProgCount=ProgCount+1;
state=`PROC_DE_LOAD_16_EXTRA_FETCH_SET; state=`PROC_DE_LOAD_16_EXTRA_FETCH_SET;
end else begin end else begin
PARAM1 <= external_data_bus; PARAM1[7:0] = external_data_bus[15:8];
PARAM1[15:8] = external_data_bus[7:0];
ProgCount=ProgCount+1; ProgCount=ProgCount+1;
state=`PROC_EX_STATE_ENTRY; state=`PROC_EX_STATE_ENTRY;
end end
end end
`PROC_DE_LOAD_16_EXTRA_FETCH:begin `PROC_DE_LOAD_16_EXTRA_FETCH:begin
PARAM1[7:0] = external_data_bus[15:8]; PARAM1[15:8] = external_data_bus[15:8];
state=`PROC_EX_STATE_ENTRY; state=`PROC_EX_STATE_ENTRY;
end end
`PROC_EX_STATE_ENTRY:begin `PROC_EX_STATE_ENTRY:begin