
Basic Data Operation

This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:


Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses


Get two integers from the user.

Then,   display a message if the first integer is:

   less than, 
   equal to,   or 
   greater than
the second integer.



Test the condition   for each case separately,   so that   all three comparison operators are used   in the code.



Related task

   String comparison


Compare		PHA			;push Accumulator onto stack
		JSR GetUserInput	;routine not implemented
		;integers to compare now in memory locations A and B
		LDA A
		CMP B			;sets flags as if a subtraction (a - b) had been carried out
		BCC A_less_than_B	;branch if carry clear
		BEQ A_equals_B		;branch if equal
		;else A greater than B
		JSR DisplayAGreaterThanB;routine not implemented
		JMP Done
A_less_than_B:	JSR DisplayALessThanB	;routine not implemented
		JMP Done
A_equals_B:	JSR DisplayAEqualsB	;routine not implemented
Done:		PLA			;restore Accumulator from stack
		RTS			;return from subroutine