cmp.s 236 B

12345678910111213141516171819202122
  1. .define .cmp
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. .cmp:
  8. move.l (sp)+,d2 ! return address
  9. move.l #1,d1
  10. move.l (sp)+,d0
  11. cmp.l (sp)+,d0
  12. bne 1f
  13. clr.l d1
  14. 1:
  15. bcs 2f
  16. neg.l d1
  17. 2:
  18. move.l d2,-(sp)
  19. rts
  20. .align 2