Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

can someone check if this is correct please

Status
Not open for further replies.

steve98

Newbie level 1
Joined
Dec 31, 2009
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,280
Activity points
1,290
68000 assembler

1. The problem statement

If the content of d0 is $30 state in words what each of the following numbered instruction pairs will do.


2. Relevant QUESTION

a) cmpi #$30,d0
beq dan

b) cmp.l unknown,d0
bne dan

c) cmp.w d1,d0
bgt dan

3. The ANSWER

a)cmpi #$30,d0 = Since d0 is $30, the compare instruction sets the Z flag.
beq dan = [go to label dan] [if d0] [equal to zero]


b) cmp.l unknown,d0 = I don’t know what value stored in unknown. Therefore their will be three cases (unknown > d0 or unknown < d0 and unknown = d0)

Unknown > d0 = N flag gets set.
Unknown < d0 = no flags get set
unknown = d0 = Z flag gets set

bne dan = [go to label dan] [if d0] [not equal to zero]


c)cmp.w d1,d0 = I don’t know what value stored in d1. Therefore their will be three cases (d1 < d0 or d1 > d0 and d1 = d0)

d1 > d0 = N flag gets set.
d1 < d0 = no flags get set
d1 = d0 = Z flag gets set

bgt dan = [go to label dan] [if d0] [greater than zero]
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top