27 lines
523 B
Plaintext
27 lines
523 B
Plaintext
Compare:
|
|
;integers to compare are in D0 and D1
|
|
CMP.L D1,D0
|
|
BCS .less ;D1 < D0
|
|
;else, carry clear, which implies greater than or equal to.
|
|
BNE .greater ;D1 > D0
|
|
;else, d1 = d0
|
|
LEA Equal,A0
|
|
JMP PrintString ;and use its RTS to return
|
|
.greater:
|
|
LEA GreaterThan,A0
|
|
JMP PrintString ;and use its RTS to return
|
|
.less:
|
|
LEA LessThan,A0
|
|
JMP PrintString ;and use its RTS to return
|
|
|
|
|
|
LessThan:
|
|
dc.b "second integer less than first",0
|
|
even
|
|
GreaterThan:
|
|
dc.b "second integer greater than first",0
|
|
even
|
|
Equal:
|
|
dc.b "both are equal",0
|
|
even
|