zer.s 302 B

12345678910111213141516171819202122232425
  1. .define Zer
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine puts n (n <=256) zero bytes on top of
  8. ! the stack.
  9. ! The number of bytes minus one is in Y.
  10. Zer:
  11. tya
  12. lsr a ! number of bytes div 2
  13. tay
  14. iny
  15. lda #0
  16. tax
  17. 2: jsr Push ! push two bytes
  18. dey
  19. bne 2b
  20. rts