sts.s 385 B

123456789101112131415161718192021222324252627282930313233
  1. .define .sts
  2. .define .sts4
  3. .sect .text
  4. .sect .rom
  5. .sect .data
  6. .sect .bss
  7. ! d0 : # bytes
  8. ! a0 : destination address
  9. .sect .text
  10. .sts:
  11. move.l (sp)+,a1
  12. move.w (sp)+,d0
  13. ext.l d0
  14. 9:
  15. move.l (sp)+,a0
  16. cmp.l #1,d0
  17. bne 1f
  18. move.w (sp)+,d0
  19. move.b d0,(a0)
  20. bra 3f
  21. 1:
  22. asr.l #1,d0
  23. 2:
  24. move.w (sp)+,(a0)+
  25. sub.l #1,d0
  26. bgt 2b
  27. 3:
  28. jmp (a1)
  29. .sts4:
  30. move.l (sp)+,a1
  31. move.l (sp)+,d0
  32. bra 9b