[comp.sys.atari.st.tech] The movep instruction & a strange display

mlake@irscscm.UUCP (Marshall Lake) (10/31/90)

Greetings everyone.

I am having a problem with a 68000 program where the screen goes
kaflooey at a certain point.  I'm not fooling with the screen in my
code, only the MFP and the sound chip.  The program works ok except for
the fact that it screws the display.  I've traced the cause of the
problem down to a movep instruction that occurs during a timer A
interrupt.  The movep is a weird instruction where it moves every other
segment (depending upon the mode) of the source to the destination.  Is
it possible that my assemblers (the only ones I have are MADMAC and the
MWC assembler, the latter being a real trip of an assembler) do not
handle the movep instruction correctly?  The same thing happens with
both of the assemblers.  I've seen the same code in other programs that
work properly.

I'm open to any and all explanations and/or suggestions.  Thanks.

-- 
Marshall Lake
mlake@irscscm.UUCP
...!uunet!media!ka3ovk!irscscm!mlake

hyc@math.lsa.umich.edu (Howard Chu) (11/01/90)

In article <1990Oct31.155603.4066@irscscm.UUCP> mlake@irscscm.UUCP (Marshall Lake) writes:
>Greetings everyone.

>I am having a problem with a 68000 program where the screen goes
>kaflooey at a certain point.  I'm not fooling with the screen in my
>code, only the MFP and the sound chip.  The program works ok except for
>the fact that it screws the display.  I've traced the cause of the
>problem down to a movep instruction that occurs during a timer A
>interrupt.  The movep is a weird instruction where it moves every other
>segment (depending upon the mode) of the source to the destination.  Is
>it possible that my assemblers (the only ones I have are MADMAC and the
>MWC assembler, the latter being a real trip of an assembler) do not
>handle the movep instruction correctly?  The same thing happens with
>both of the assemblers.  I've seen the same code in other programs that
>work properly.

I know that incorrect code is generated for movep by both the 2.0 and
3.0 MWC assemblers. (Different incorrect code, too!) However, I'm pretty
sure that MADMAC handles movep correctly. (I've used it a number of times
with MADMAC and never had any trouble.) You can verify the correctness
of the MADMAC object code just by looking at it in the Atari debugger.
If it doesn't disassemble to what you're expecting, mebbe you're behind
a rev or two on MADMAC?
--
  -- Howard Chu @ University of Michigan

Mac// - adv., q.v. MacToo, e.g.  McHave a McHappy McDay!
		McThanks, McYou MacToo!

csbrod@medusa.informatik.uni-erlangen.de (Claus Brod ) (11/01/90)

mlake@irscscm.UUCP (Marshall Lake) writes:


>interrupt.  The movep is a weird instruction where it moves every other
>segment (depending upon the mode) of the source to the destination.  Is
>it possible that my assemblers (the only ones I have are MADMAC and the
>MWC assembler, the latter being a real trip of an assembler) do not
>handle the movep instruction correctly?  The same thing happens with

I used MADMAC to implement some screen manipulations a while ago, with
quite a few MOVEPS thrown in for that purpose. No problems.

----------------------------------------------------------------------
Claus Brod, Am Felsenkeller 2,			Things. Take. Time.
D-8772 Marktheidenfeld, West Germany		(Piet Hein)
csbrod@medusa.informatik.uni-erlangen.de
----------------------------------------------------------------------

hojo@cbnewsl.att.com (HC Johnson) (11/03/90)

In article <1990Oct31.155603.4066@irscscm.UUCP>, mlake@irscscm.UUCP (Marshall Lake) writes:
> 
> Greetings everyone.
> 
> [is] it possible that my assemblers (the only ones I have are MADMAC and the
> MWC assembler, the latter being a real trip of an assembler) do not
> handle the movep instruction correctly?  The same thing happens with
> both of the assemblers.  I've seen the same code in other programs that
> work properly.
> 
the MWC assembler gets the reg reversed (my memory) on some movep instructions.

When I disassemble a program using certain movep , when reassembled, the 
code is wrong.  I believe the registers are reversed on movep r1,r2.


Howard Johnson
ATT BELL LABS
att!lzsc!hcj
hcj@lzsc.att.com

darekm@microsoft.UUCP (Darek MIHOCKA) (11/07/90)

In article <1990Nov1.072136.24326@math.lsa.umich.edu> hyc@math.lsa.umich.edu (Howard Chu) writes:
>I know that incorrect code is generated for movep by both the 2.0 and
>3.0 MWC assemblers. (Different incorrect code, too!) However, I'm pretty
>sure that MADMAC handles movep correctly. (I've used it a number of times
>with MADMAC and never had any trouble.) You can verify the correctness
>of the MADMAC object code just by looking at it in the Atari debugger.
>If it doesn't disassemble to what you're expecting, mebbe you're behind
>a rev or two on MADMAC?

The two versions of MadMac that I have both generate correct code for MOVEP.
But all versions of Megamax C and Laser C generate incorrect code for MOVEP.
(That's if youre using the inline assembler). The inline assembler also
generates incorrect code for DC.B and DC.L and some branch instructions.

- Darek

hyc@math.lsa.umich.edu (Howard Chu) (11/07/90)

In article <58845@microsoft.UUCP> darekm@microsoft.UUCP (Darek MIHOCKA) writes:
>In article <1990Nov1.072136.24326@math.lsa.umich.edu> hyc@math.lsa.umich.edu (Howard Chu) writes:
>>I know that incorrect code is generated for movep by both the 2.0 and
>>3.0 MWC assemblers. (Different incorrect code, too!) However, I'm pretty
>>sure that MADMAC handles movep correctly. (I've used it a number of times

>The two versions of MadMac that I have both generate correct code for MOVEP.
>But all versions of Megamax C and Laser C generate incorrect code for MOVEP.
>(That's if youre using the inline assembler). The inline assembler also
>generates incorrect code for DC.B and DC.L and some branch instructions.

Mebbe this explains the phrase in my 68000 book: "the MOVEP instruction
is probably never generated by a compiler..." The compiler writers don't
care about it and then their code can't generate it. Yeehah.
--
  -- Howard Chu @ University of Michigan

Mac// - adv., q.v. MacToo, e.g.  McHave a McHappy McDay!
		McThanks, McYou MacToo!