90 likes | 181 Views
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.
E N D
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 EQUAL: do equal code here BRA ENDIF NEGATIVE: do negative code here (A-B is neg, so B>A) ENDIF:
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