test2.s 382 B

123456789101112131415161718192021222324
  1. .define Test2
  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 2.
  8. ! It is used if the size is on top of the stack.
  9. ! The word which is to be handled is returned in registerpair AX.
  10. Test2:
  11. tay
  12. bne 1f ! value > 255
  13. cpx #2
  14. bne 1f ! value <> 2
  15. jsr Pop ! get word
  16. rts
  17. 1: ldx #Eoddz
  18. lda #0
  19. jsr Trap