dup.s 477 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .define _dup
  2. .define _dup2
  3. .sect .text
  4. .sect .rom
  5. .sect .data
  6. .sect .bss
  7. .sect .text
  8. .extern _dup
  9. .sect .text
  10. _dup:
  11. tst.b -40(sp)
  12. link a6,#-0
  13. move.w 8(a6), d2
  14. ext.l d2
  15. move.l d2,-(sp)
  16. jsr __Sdup
  17. add.l #4,sp
  18. unlk a6
  19. rts
  20. .extern _dup2
  21. _dup2:
  22. tst.b -40(sp)
  23. link a6,#-0
  24. move.w 10(a6), d2
  25. ext.l d2
  26. move.w 8(a6), d1
  27. ext.l d1
  28. move.l d2,-(sp)
  29. move.l d1,-(sp)
  30. jsr __Sdup2
  31. add.l #8,sp
  32. unlk a6
  33. rts
  34. __Sdup2: or.l #64,4(sp)
  35. __Sdup: trap #0
  36. .data2 0x29
  37. bcc 1f
  38. jmp cerror
  39. 1:
  40. rts