Quantcast

Results 1 to 8 of 8

Thread: Moveq Memonic Question

  1. #1
    Hedgehog-in-Training Hedgehog-in-TrainingWildside Expert
    Join Date
    Oct 2015
    Posts
    174
    Rep Power
    5

    Question Moveq Memonic Question

    I have a question about the moveq instruction. Is
    Code:
       move.b #0x7, d3
    The same as:
    Code:
       moveq #0x7, d3
    I read that moveq is sign extended. Is it the same when move.b is used?

    Signed,

    Scorpion Illuminati
    Scorpion Illuminati - An Open Source Rhythm Game For The Sega Genesis
    https://www.scorpionilluminati.tk

  2. #2
    WCPO Agent
    Join Date
    Aug 2014
    Location
    France
    Posts
    800
    Rep Power
    35

    Default

    No, they aren't the same, and move.b is not sign extented.

  3. #3
    Road Rasher
    Join Date
    Apr 2013
    Location
    SF Bay Area, California
    Posts
    301
    Rep Power
    20

    Default

    moveq is more or less equivalent to a move.b followed by an ext.w and an ext.l except much faster.

  4. #4
    Raging in the Streets Sik's Avatar
    Join Date
    Jan 2011
    Posts
    3,238
    Rep Power
    61

    Default

    More useful explanation: it's the same as
    Code:
    move.l #7, d0
    except the number can only go from -128 to 127 (and executes as fast as move.b d1, d0 would).

  5. #5
    Hedgehog-in-Training Hedgehog-in-TrainingWildside Expert OmegaMax's Avatar
    Join Date
    Dec 2015
    Location
    Canada
    Age
    43
    Posts
    223
    Rep Power
    9

    Default

    http://mrjester.hapisan.com/04_MC68/

    Good simulator to view registers and memory

    http://www.easy68k.com/

  6. #6
    Hedgehog-in-Training Hedgehog-in-Training
    Join Date
    May 2016
    Location
    Portugal
    Posts
    14
    Rep Power
    0

    Default

    Not really on topic, but you can use the MOVEQ #0,Dn to zero all 32bit of data register faster than the CLR.L Dn.
    If I'm correct MOVEQ #0,Dn saves 2 cycles compared to CLR.L Dn.

  7. #7
    Hedgehog-in-Training Hedgehog-in-TrainingWildside Expert OmegaMax's Avatar
    Join Date
    Dec 2015
    Location
    Canada
    Age
    43
    Posts
    223
    Rep Power
    9

    Default

    Yeah moveq #0,dn is faster than clr.l dn....if you use the simulator I linked in this thread you can view the cycles.

  8. #8
    Hedgehog-in-Training Hedgehog-in-Training
    Join Date
    May 2016
    Location
    Portugal
    Posts
    14
    Rep Power
    0

    Default

    OmegaMax, I wonder if that simulator works with: MOVE SR,Destination

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •