testFFh.s 389 B

12345678910111213141516171819202122232425262728
  1. .define TestFFh
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine tests if the value on top of the stack is <= 256.
  8. ! It is used if the istruction argument is on top of the stack.
  9. ! The value is saved in Y.
  10. TestFFh:
  11. cmp #2
  12. bpl 1f ! value > 256
  13. cmp #0
  14. beq 2f
  15. cpx #0
  16. bne 1f ! value is zero
  17. 2: dex
  18. txa
  19. tay
  20. rts
  21. 1: ldx #Eoddz
  22. lda #0
  23. jsr Trap