A89: Re: Re: Few Code Questions Plz.


[Prev][Next][Index][Thread]

A89: Re: Re: Few Code Questions Plz.




void sprintf(char *destinationtext, char *printfstring, [value1, [value2...]]);

An example in asm:

---------- BEGIN CODE ------------
...
  move.w  d0,-(sp)  ;Your value
  pea  dstruct(pc)     ; Your printf string
  pea  dstr(pc)
  jsr    doorsos::sprintf
  lea   10(sp),sp
...
  Code that prints/uses dstr.
...
  dstr ds.b 100
  dstruct  dc.b "The number is %d!",0;
...
---------- END CODE ------------

In this example I use an "int" type by putting a "%d" in the printf string.
Check any good C page on the net for a secription of printf and you'll get it.

 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92+ at http://prosit.ticalc.org
Random PQF Quote follows:

- "Do you know, humans think the world was made by a sort of big human?"
- "Get away?"
- "It took a week."
- "I expect it had some help, then,' said Dorcas.
        -- The Nomes discuss religion
           (Terry Pratchett, Diggers)




References: