It is currently Sat Feb 23, 2019 3:47 am

 All times are UTC

 Page 1 of 1 [ 2 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Question on MULU instructionPosted: Tue Nov 08, 2016 9:38 pm

Joined: Tue Nov 08, 2016 9:28 pm
Posts: 1
I have a question regarding the MULU instruction, its something of a weird behavior after doing it on a certain value. Suppose I have 000FFFFF in a data register. Now what I want to do is add another F so that the value is 00FFFFFF. What I do is I first multiply the current value by 16, and and 'F' like so:

Code:
MULU   #16, d4

The problem is that in the state of 000FFFFF, when I go to perform that operation again, I don't get another F, instead I get 000FFFF0. Another thing I've noticed is that if I just add 1 to 000FFFFF, the Extend, Zero, and bits are 1. What can I do remedy this issue?

If instead of multiplying by 16, I multiply by 17, I get that new bit (00XXXXXX).

Top

 Post subject: Re: Question on MULU instructionPosted: Wed Nov 09, 2016 11:35 am

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1089
MULU multiplies two 16bit unsigned numbers yielding a 32bit result. \$0000FFFF x \$00000010 = \$000FFFF0.
Note the first number is \$0000FFFF not \$000FFFFF. The upper word of the value is ignored because it is beyond
the 16bit range of the instruction.

Use the LSL.L instruction to shift in bits.

_________________
Prof. Kelly

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 2 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ EASy68K Forum    FAQ    Latest Features    EASy68K Questions    68000 Programming Questions    Wish List    Wishes Granted    Undocumented Features    Documented Features    General Discussion    EASy68K Projects