Hey there! Sign in to join this conversationNew here? Join for free
x Turn on thread page Beta
    • Thread Starter
    Offline

    5
    ReputationRep:
    I don't understand the answer to this question : https://gyazo.com/22171f59cd73ddc9b08424fcdea1c325

    The answer : https://gyazo.com/dca42a4a7ef6e02c237ea9d3c379cf86

    Why does it have two end ifs... why does it have end ifs at all if this is assembly?
    Offline

    2
    ReputationRep:
    (Original post by brbrbrh)
    I don't understand the answer to this question : https://gyazo.com/22171f59cd73ddc9b08424fcdea1c325

    The answer : https://gyazo.com/dca42a4a7ef6e02c237ea9d3c379cf86

    Why does it have two end ifs... why does it have end ifs at all if this is assembly?
    The end ifs are just what they write instead of for example HALT, which tells the program to stop. Instead of using the two if statements you could label each statement in the order it should be carried out in. This might be easier.

    1. CMP R1, #5
    2. BNE 4
    3. MOV R2, #10
    4. HALT

    this is what I would have done, so if the number 2 is true then the program will locate number 4 and stop the procedure
 
 
 
Reply
Submit reply
Turn on thread page Beta
Updated: June 13, 2016
Poll
Do you like carrot cake?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.