Can someone check if this is correct please

  • Thread starter chelsea9947
  • Start date
In summary, these instructions will compare the content of d0 with a given value or address and then branch to a specified label based on the result of the comparison.
  • #1
chelsea9947
8
0

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
 
Physics news on Phys.org
  • #2
d. cmpa.l d2,d0bmi dana) cmpi #$30,d0 beq dan = [compare the immediate value $30] [with the content of d0] [if d0 is equal to $30] [go to label dan] b) cmp.l unknown,d0 bne dan = [compare the content of the long word unknown] [with the content of d0] [if d0 is not equal to unknown] [go to label dan] c) cmp.w d1,d0 bgt dan = [compare the content of the word d1] [with the content of d0] [if d0 is greater than d1] [go to label dan] d) cmpa.l d2,d0 bmi dan = [compare the content of the long address d2] [with the content of d0] [if d0 is minus d2] [go to label dan]
 
  • #3


d. cmp.b unknown,d0
blt dan

a. This instruction pair will compare the value in d0 to the hexadecimal value $30. If they are equal, the program will jump to the label "dan".
b. This instruction pair will compare the value in d0 to the value stored in the memory location "unknown". If they are not equal, the program will jump to the label "dan".
c. This instruction pair will compare the word value in d0 to the word value in d1. If the value in d0 is greater than the value in d1, the program will jump to the label "dan".
d. This instruction pair will compare the byte value in d0 to the value stored in the memory location "unknown". If the value in d0 is less than the value in the memory location, the program will jump to the label "dan".
 

1. Can someone check if this is correct please?

As a scientist, I am happy to help you with this question. Can you please provide more context and information about what you would like checked? Without more specific details, it is difficult for me to determine if something is correct or not.

2. How do I know if my information or data is accurate?

In order to determine if your information or data is accurate, it is important to have a thorough understanding of the topic and to use reliable sources. It is also helpful to double check your data and calculations with other scientists or experts in the field.

3. What steps can I take to ensure the validity of my research?

To ensure the validity of your research, it is important to follow the scientific method and use reliable and accurate data. It is also helpful to have your research reviewed and critiqued by other scientists in the field.

4. How can I check if my experimental design is sound?

To check if your experimental design is sound, it is important to consider the variables involved and to have a control group for comparison. It is also helpful to consult with other scientists and experts in the field to get their input and feedback.

5. What should I do if I find errors in my research?

If you find errors in your research, it is important to reevaluate your methods and data to determine where the errors occurred. It may also be helpful to seek the advice and input of other scientists or experts in the field to help identify and correct any errors.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
6K
  • General Engineering
Replies
1
Views
12K
  • Introductory Physics Homework Help
Replies
17
Views
9K
  • General Math
Replies
3
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
Back
Top