cii.s 349 B

1234567891011121314151617181920212223
  1. .sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
  2. .sect .text
  3. .define cii~
  4. ! $Id$
  5. !convert int to int
  6. ! 1 byte -> ? : sign extension
  7. cii~:
  8. mov (sp)+,r3
  9. mov (sp)+,r0
  10. sub (sp)+,r0
  11. ble 1f
  12. asr r0
  13. bcc 2f
  14. movb (sp),r1
  15. mov r1,(sp)
  16. 2: tst r0
  17. beq 3f
  18. tst (sp)
  19. 4: sxt -(sp)
  20. sob r0,4b
  21. 1: sub r0,sp ! if out of sob loop r0==0
  22. 3: jmp (r3)