1 / 9

Compare Two Numbers and Activate Pins - Lab Assignment

This program compares two numbers stored in registers A and B. If A is greater than B, PA6 is activated; if they are equal, PA5 is activated; if A is less than B, PA4 is activated.

lucine
Download Presentation

Compare Two Numbers and Activate Pins - Lab Assignment

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