1 / 9

Selection – If statement

Selection – If statement. Sum of two negative numbers is positive?. AND. Page 93. CBA. CMPA, CMPB. Compare two numbers in A&B: CBA ;compare B to A (sub A-B) BEQ EQUAL ;label for code BMI NEGATIVE ;label for code do positive code here (A>B) BRA ENDIF

lucine
Download Presentation

Selection – If statement

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Selection – If statement

  2. Sum of two negative numbers is positive?

  3. AND

  4. Page 93

  5. CBA CMPA, CMPB

  6. Compare two numbers in A&B: CBA ;compare B to A (sub A-B) BEQ EQUAL ;label for code BMI NEGATIVE ;label for code do positive code here (A>B) BRA ENDIF EQUAL: do equal code here BRA ENDIF NEGATIVE: do negative code here (A-B is neg, so B>A) ENDIF:

  7. Lab Assignment • Write a program that will • Store two numbers register A and B • Compare A and B, if • A>B turn on PA6 • A=B turn on PA5 • A<B turn on PA4

More Related