cbprintf.s 779 B

12345678910111213141516171819202122232425
  1. |cbprintf() (non-virtual vcbprintf()) implementation for TIGCCLIB
  2. |Copyright (C) Kevin Kofler, 2003
  3. | Warning: This routine has the attribute __ATTR_TIOS__!
  4. .xdef cbprintf
  5. cbprintf:
  6. |Copy the arguments for vcbprintf(). We have to copy them because of the stack
  7. |parameter convention of AMS. Register parameters wouldn't need a copy.
  8. pea.l 16(%a7) | arglist: do NOT copy this one, pass a pointer to it
  9. move.l 16(%a7),-(%a7) | copy format
  10. move.l 16(%a7),-(%a7) | copy param
  11. move.l 16(%a7),-(%a7) | copy callback
  12. |Now call vcbprintf using the usual hack.
  13. |Copied from Zeljko Juric's printf.
  14. movea.l 0xC8,%a0
  15. movea.l (%a0,0x14C),%a0 /* vcbprintf */
  16. lea (%a0,32),%a0
  17. movea.w (%a0),%a1
  18. jsr (%a0.l,%a1)
  19. |Pop the arguments from the stack and return.
  20. lea.l 16(%a7),%a7
  21. rts