Recent content by chelsea9947

  1. C

    Comp Sci C++ Question: Display Element1 Contents

    #include <iostream> #include <iostream> #include <string> using namespace std; struct ElementType { string Element; int AtomicNumber; float AtomicMass; float Density; }; int main() { ElementType element1, element2; element1.Element = "Boron"; element1.AtomicNumber =...
  2. C

    Check Homework: Compare & Set Flags

    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...
  3. C

    Check Homework: Compare & Set Flags

    Homework Statement If the content of d0 is $30 state in words what each of the following numbered instruction pairs will do. Homework Equations a. cmpi #$30,d0 beq dan b. cmp.l unknown, d0 bne dan c. cmp.w d1,d0 bgt dan The Attempt at a Solution a. cmpi #$30,d0 = Z flag gets...
  4. C

    What Do These Assembly Instructions Do with $30 in Register d0?

    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 d0Homework Equations a) bne fred b) beq fred c) bpl fred d) bmi fredThe Attempt at a Solution a) bne fred =...
  5. C

    Can someone check if this is correct please

    please can you check this if this is correct cmpi.w #10,d5 What will the states of the N and Z flags would be if a. d5 = 12 = No flags gets set. b. d5 = -10 = Z flag gets set. c. d5 = 5 = N would be set
  6. C

    Can someone check if this is correct please

    i think is zero Decision Making: In high level languages we use instructions of the form If A< B then P else Q Now what actually happens deep down in the machine is a subtraction of the form (A – B) and we look at the sign of the result. If B is greater than A then the result...
  7. C

    Can someone check if this is correct please

    [b]1. Given that the instruction cmp.l d0,d1 subtracts d0 from d1 without changing either and then sets the flags accordingly. What will be the state of the N and Z flags if Homework Equations a. d0 < d1 = b. d0 > d1 =...
Back
Top