EASy68K
http://www.easy68k.com/EASy68Kforum/

Seperating the upper byte of a word
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1071
Page 1 of 1

Author:  assemlbey_dude [ Mon Dec 19, 2011 4:00 am ]
Post subject:  Seperating the upper byte of a word

Hello everyone. I was wondering if someone could explain the most efficient way to separate the upper part of a word and store it somewhere. For example we take the word $F9AB we copy the four bits of F into one memory,ex.$2000, location and the four bits 9 just after it,ex.$2001.

Author:  lee [ Mon Dec 19, 2011 9:56 am ]
Post subject: 

Code:
      MOVE.w    #$F9AB,d1   * set the word
      LSR.w     #4,d1       * makes d1 $0F9A
      LSR.b     #4,d1       * makes d1 $0F09
      MOVE.w    d1,$2000    * saves d1 at $2000 and $2001

Lee.

Author:  assemlbey_dude [ Tue Jan 03, 2012 1:47 pm ]
Post subject: 

lee wrote:
Code:
      MOVE.w    #$F9AB,d1   * set the word
      LSR.w     #4,d1       * makes d1 $0F9A
      LSR.b     #4,d1       * makes d1 $0F09
      MOVE.w    d1,$2000    * saves d1 at $2000 and $2001

Lee.


Very clear. Thank you.

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