EASy68K  
It is currently Tue Nov 19, 2019 3:44 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: divu question
PostPosted: Tue May 26, 2009 8:16 am 
Offline

Joined: Tue May 26, 2009 8:06 am
Posts: 6
as i know, when performing divu, the remainder will be stored in front of 4 bits.
for example:
5/2 = 2(ans)
= 1(remainder)
d0 = 00010002

my question is, how do i retrieve only 0001 as remainder~

regards


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 26, 2009 11:17 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1103
In a 68000 the result is always 32 bits where the upper word is the remainder.

d0 = $00010002

The SWAP instruction will swap the two halves of a register so:
Code:
    SWAP  D0

results in

d0 = $00020001

Using word size operations on D0 will manipulate the remainder:
Code:
     CLR.L   D1
     MOVE.W  D0,D1       d1 contains remainder

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group