Closed larsbrinkhoff closed 8 years ago
These are the first instructions with one ea operand and one register operand.
Also, if the destination is a data register, there may be 2 or 4 additional cycles. This isn't handled very prettily. The four extra arguments to ea_begin_modify
doesn't help much here.
2 or 4 additional cycles compared to what?
After the last prefetch, when writing a long. See the Yacht table for ADD and SUB.
Should that really be handled through the EA? Isn't that just because the ALU is 16bit and there aren't enough 'n':s to handle a 32bit addition without them?
I'm saying the current solution isn't satisfactory.
In that case, I would suggest moving the additional cycle bits into the ADD/SUB states. This should pop up in several other instructions as well, I'd imagine.
I'm trying to save us some work by having ea_begin_modify
help out. It could handle the extra cycles without having to add explicit states in the instructions.
But those four arguments should go away.
I have a vague idea that the instruction state machines could be replaced with some microcode like the EA calculation. This would probably solve the problem with varying cycle counts for operand writes using ea_begin_modify
.
Yes, I was thinking about this a bit last night.
I'm sort of leaning towards EA not having its own state machine. ucode
should be able to be the state machine, and each instruction is responsible for building the state chain (or modifying it live).
EA is then responsible for being something macro-like that provides part of that state chain, instead of actually running it.
Pretty much all instructions should need only the following:
Pretty much all instructions also do the following (each one could be optional):
Is there any instruction opcode and cpu-register state where it cannot be known upon initial execution of the instruction what the entire state chain would look like?
I wrote a more concise (I think :)) proposal regarding this in https://github.com/nocrew/ostis/issues/143
I had a similar idea today, so I think we basically agree. I'll reply in #143.
Can we merge this now, and fix it later?
Indeed we can.
New
ADD
,SUB
, and fixed flags inNEG
,NEGX
,NOT
.