Instruction w/ prefix
Dmitry Eremin-Solenikov
dbaryshkov@gmail.com
Mon Oct 19 13:29:00 GMT 2009
Hello,
Doug Evans wrote:
> Dmitry Eremin-Solenikov wrote:
>> Hello,
>>
>> I'm using cgen to create binutils port for the CISC architecture
>> (M68HC(S)08 if somebody cares). I've stumbled upon one problem: the is
>> an instruction prefix which can change meaning
>> of the next instruction (basically it then uses SP register instead of
>> IX one).
>>
>> What is the most clean way to do this w/ cgen? I can of course
>> duplicate instruction fields, counting another byte in the beginning,
>> instructions, etc.. This will permit me to catch illegal combinations.
>> OTOH it doesn' look like completely clean idea.
>>
>> What would you suggest?
>>
>>
>
> Hi. Sorry for the slow reply.
>
> I think the right solution (which I wouldn't wait for) is to extend cgen
> to handle instruction prefixes.
Do you have any ideas how to implement (or at least design) this?
As for me, the prefix just changes the addressing (prefixed instruction
just uses SP as a base instead of IX register).
> In the meantime, I would treat the prefix as its own instruction.
Yep, I've tried this approach. However I've stumbled upon the fact that
cgen just sums all specified values, thus leading me into problems.
I'm currently looking into how to overcome this. Maybe you can suggest a
sample which I can look upon?
--
With best wishes
Dmitry
More information about the Cgen
mailing list