A89: Re: TIOS functions disobey register conventions!


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

A89: Re: TIOS functions disobey register conventions!




Hi!

> I have just discovered that some TIOS functions don't obey
> they standard register conventions (allowing changes only to
> D0/D1/D2/A0/A1). In particular, OSContrastUp trashes the
> upper word of the D4 register. I only actually verified this
> under AMS version 1.05 and 2.04, though I have a bad feeling
> the same thing will happen on other versions as well.

What I concluded so far, it seems that TIOS functions are OK. It
seems that the problem is in VTI, or I don't know something about
the processor. The OSContrastUp is quite clean, it does not use
high word of d4 at all (you can see it, take AMS 2.xx, because
AMS 1.00 uses d0 and d1). But, while single steping I noticed
something very very strange: high word of d4 becomes trashed
after execution of movem.w (sp)+,d3-d4 !!!??? It seems that after
popping two words d3.w and d4.w from the stack, popped values
are sign-extended into the high word????? I don't think that
Motorola 68000 does so; tell me if I am wrong!??

> I uncovered this while working on a program in TIGCC which
> contained a contrast changer.  It crashed for no apparent
> reason, but after examining further, I discovered the TIOS
> was the problem (since only the upper words are trashed, if
> the registers were only keeping integers, the problem might
> be unnoticed).

Please, can you check Patrik's test program on real TI with
AMS 2.xx (my TI is with AMS 1.00, and I don't want to reflash
it now)? Anyway, I will change these functions (contrast) 
in TIGCCLIB independently whether this is a bug in VTI or
caveat of the MC68000...
 
> I'm not exaclty sure how many TIOS functions do stuff like
> this, but it is certainly an annoying problem for only one
> function.

Obviously, all of them which uses poping words using movem.w!??

Zeljko Juric