tle.s 363 B

123456789101112131415161718192021222324252627
  1. .define Tle
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine tests if the value in registerpair AX is
  8. ! less than or equal to zero.
  9. ! The value returned is in AX.
  10. Tle:
  11. tay
  12. bpl 1f ! A >= 0
  13. 3: lda #0 ! AX <= 0
  14. ldx #1
  15. rts
  16. 1: beq 1f ! A = 0
  17. 2: lda #0 ! AX > 0
  18. tax
  19. rts
  20. 1: txa
  21. bne 2b ! X > 0
  22. beq 3b ! x = 0