Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin Aristote
Microprocessor
Commits
e817cdf8
Commit
e817cdf8
authored
Jan 22, 2019
by
Quentin Aristote
Browse files
partially corrected addressing
parent
875c4b81
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
microprocesseur.mj
View file @
e817cdf8
...
...
@@ -176,7 +176,8 @@ bne(s:[16], t:[16], imm:[16], PC:[16]) = new_PC:[16] where
end where
j(label:[26], PC:[32]) = new_PC:[32] where
new_PC = PC[0..3].label.00
(* le compilateur assembleur rajoute 0x00400024 par défaut *)
new_PC = sub<32>(PC[0..3].label.00, 0x00400024)
end where
type_i(opcode:[6],
...
...
@@ -309,10 +310,12 @@ execute_command(command:[32], old_PC:[32]) = (t0:[16],
(PC, c) = add<32>(old_PC, 0b00000000000000000000000000000100, 0) ;
(* la valeur ajoutée à PC dans les branchements est divisée par 4 dans le code
assembleur compilé pour gagner 2 bits *)
(write_enable_I,
write_address_I,
write_value_I,
new_PC_I) = type_i(opcode, rs, rs_val, rt, rt_val, imm, PC[1
6
..]) ;
new_PC_I) = type_i(opcode, rs, rs_val, rt, rt_val, imm, PC[1
4
..
29
]) ;
write_value_R = type_r(rs_val, rt_val, shamt, funct) ;
new_PC_J = j(pseudo_address, PC) ;
...
...
@@ -324,7 +327,7 @@ execute_command(command:[32], old_PC:[32]) = (t0:[16],
write_address = multi_mux<5>(I, write_address_I, rd) ;
write_value = multi_mux<16>(I, write_value_I, write_value_R) ;
new_PC = multi_mux<32>(J + I,
multi_mux<32>(J, new_PC_J, PC[..1
5
].new_PC_I),
multi_mux<32>(J, new_PC_J, PC[..1
3
].new_PC_I
.00
),
PC)
end where
...
...
microprocesseur.net
View file @
e817cdf8
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment