• Support PF! Buy your school textbooks, materials and every day products Here!

Can someone check if this is correct please

  • #1

Homework Statement



If the content of d0 is $30 state in words what each of the following numbered instructions will do when placed immediately after the test instruction below
tst d0


Homework Equations



a) bne fred
b) beq fred
c) bpl fred
d) bmi fred


The Attempt at a Solution



a) bne fred = [go to label fred] [if d0] [not equal to $30]
b) beq fred = [go to label fred] [if d0] [equal to $30]
c) bpl fred = [go to label fred] [if d0] [ plus $30]
d) bmi fred = [go to label fred] [if d0] [minus $30]

example

TST or tst direct against zero instruction.

This is really the same as compare with zero

tst <effective address>

it subtracts 0 from a copy of the location specified and sets the condition flags accordingly.
If the value to be tested is positive then +N –0 = +N or if negative –N –0= -N or if 0 then 0-0 =0

tst d0 is d0 equal to 0, greater than zero or less than zero
beq joe go to label joe if d0 equal to 0
bgt dan go to label dan if d0 greater than 0
blt ben go to label ben if d0 less than 0


iam confused can someone help

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

a. cmpi #$30,d0
beq dan

b. cmp.l unknown,d0
bne dan

c. cmp.w d1,d0
bgt dan
 

Answers and Replies

Related Threads on Can someone check if this is correct please

Replies
5
Views
1K
  • Last Post
Replies
1
Views
1K
Replies
10
Views
4K
  • Last Post
Replies
3
Views
1K
Replies
3
Views
1K
Replies
1
Views
928
Replies
1
Views
663
Top