A89: Re: Re: TIOS functions disobey register conventions!


[Prev][Next][Index][Thread]

A89: Re: Re: TIOS functions disobey register conventions!




Hi!

> | I am replying to my own answer...
> 
> Which answer?

Oops. I should tell "to my own message...".

> 
> | move.w performs SIGN EXTENDING into the high word!!! I checked this
> | on real Motorola!!! VTI works correctly!!! So, all TIOS routines
> | which uses movem.w for saving registers may cause trashing of high
> | word of these registers!!!
> 
> Sorry about the lack of technical understanding, but do you have any
> idea about how many there are, and if this applies only to d0-d4?

1) I have not any idea. But searching for them is terrible. Simply
   speaking, "problematic" routines starts and ends with movem.w.
2) Not only to d0-d4, but to ALL regs. Anyway, nobody use movem.w with
   address regs, so the problem is with d0-d6.

> Maybe we should tell TI.

What we will get if we tell this to them (anyway, I believe that someone
from TI reads these messages too). They may correct this in say AMS 2.06,
but what with existing AMSs?

> I suppose they don't know; otherwise they wouldn't be using these
> instructions.

I think that they know this (I found just now that this behaviour is
documented in official Motorola manual), but that they made a "bug":
they forgot the exact interpretation.

> If I understand you correctly, only one bit is trashed, right?

No :(( The whole high word! More precise:

if low_word<0x7FFF then set high word to 0
else set high word to 0xFFFF

Zeljko