EASy68K
http://easy68k.com/EASy68Kforum/

CCR bits not set correctly after MOVE.L imm, Ax
http://easy68k.com/EASy68Kforum/viewtopic.php?f=8&t=1543
Page 1 of 1

Author:  float [ Mon Mar 14, 2016 2:36 pm ]
Post subject:  CCR bits not set correctly after MOVE.L imm, Ax

Hi,

I think I've found an 'undocumented feature'. When you perform a MOVE.L #imm, Ax the status bits are not set correctly. If you execute the following code:
Code:
*-----------------------------------------------------------
* Title      :
* Written by :
* Date       :
* Description:
*-----------------------------------------------------------
    ORG    $1000
START:                  ; first instruction of program

* Put program code here
    MOVE.L #$00000000, A0

    SIMHALT             ; halt simulator

* Put variables and constants here

    END    START        ; last line of source


The Z bit in the CCR is not set. IMO the Z bit should be set though, because the value moved to A0 is zero.

Author:  profkelly [ Mon Mar 14, 2016 5:21 pm ]
Post subject:  Re: CCR bits not set correctly after MOVE.L imm, Ax

Code:
MOVE.L #$00000000, A0
is assembled as
Code:
MOVEA.L #$00000000, A0
. The MOVEA instruction does not alter the CCR bits. There is no MOVE.L #$nn,A0 instruction so most assemblers automatically treat it as MOVEA.

Author:  float [ Mon Mar 14, 2016 7:39 pm ]
Post subject:  Re: CCR bits not set correctly after MOVE.L imm, Ax

Ahh of course! Sorry about that :)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/