Add tools to the Workbench Tools menu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sprintf.asm 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ; ToolsMenu - Add tools to the Workbench Tools menu
  2. ;
  3. ; Copyright (C) 2015, 2018 Kim Fastrup Larsen
  4. ;
  5. ; This program is free software: you can redistribute it and/or
  6. ; modify it under the terms of the GNU General Public License
  7. ; as published by the Free Software Foundation, either ver-
  8. ; sion 3 of the License, or (at your option) any later version.
  9. ;
  10. ; This program is distributed in the hope that it will be use-
  11. ; ful, but WITHOUT ANY WARRANTY; without even the implied war-
  12. ; ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. ; See the GNU General Public License for more details.
  14. ;
  15. ; You should have received a copy of the GNU General Public Li-
  16. ; cense along with this program. If not, see
  17. ; <http://www.gnu.org/licenses/>.
  18. ;
  19. ; The author can be contacted on <kimflarsen@hotmail.com>
  20. ;
  21. ; Simple version of the C "sprintf" function. Assumes C-style
  22. ; stack-based function conventions.
  23. XDEF _sprintf
  24. XREF _AbsExecBase
  25. XREF _LVORawDoFmt
  26. _sprintf:
  27. movem.l a2/a3/a6,-(sp)
  28. move.l 4*4(sp),a3 ; Get the output string pointer
  29. move.l 5*4(sp),a0 ; Get the FormatString pointer
  30. lea.l 6*4(sp),a1 ; Get the pointer to the DataStream
  31. lea.l stuffChar(pc),a2
  32. move.l _AbsExecBase,a6
  33. jsr _LVORawDoFmt(a6)
  34. movem.l (sp)+,a2/a3/a6
  35. rts
  36. ; PutChProc used by RawDoFmt
  37. stuffChar:
  38. move.b d0,(a3)+
  39. rts