|
| void | doformat (void) |
| void | dofloatmode (void) |
| void | printlib_codeinit (void) |
| void | formatchk (void) |
| void | printctrlc (void) |
| void | doprint (UWORD n, const UBYTE *args) |
| | Print Expression[,Expression...] - output the values to the current output (inputoutputlib, dooutstring1 $5208).
|
| void | donprint (UWORD n, const UBYTE *args) |
| | NPrint Expression[,Expression...] - Print, then a newline (dooutsingle $5207 with 10).
|
| ULONG | dostrstr (ULONG v, const UBYTE *args) |
| | Str$(Expression) - the value as Print would output it, as a string.
|
| ULONG | doustrstr (ULONG v, const UBYTE *args) |
| | UStr$(Expression) - Str$ without Format (the Format string is switched off meanwhile).
|
| BL_ALWAYS_INLINE ULONG | output (const UBYTE *s, ULONG len) |
| static int | ezchar (struct ez *z) |
| static const UBYTE * | fmtround (UBYTE *buf, UWORD size, const UBYTE *num, UWORD *len, UWORD places) |
| static ULONG | prtype1 (const UBYTE *numtext, ULONG len) |
| BL_ALWAYS_INLINE ULONG | prtype2 (const UBYTE *buf) |
| static void | doformat_c (const UBYTE *s, const UBYTE *args) |
| | Format FormatString - the format of numbers for Print, NPrint and Str$ ("" = none).
|
| | BLITZ_ALIAS (doformat, doformat_c) |
| static void | dofloatmode_c (UWORD m) |
| | FloatMode Mode - how floats are printed: -1 = always fixed point ("standard"), 0 = guess (fixed point for 1E-9 <= |x| < 1E+7, else exponent form), 1 = always exponent form.
|
| | BLITZ_ALIAS (dofloatmode, dofloatmode_c) |
| static void | codeinit_c (void) |
| | Library init - no Format, FloatMode 0. Keeps all registers.
|
| static UBYTE * | makeval3 (UBYTE *dst, ULONG *value, UWORD n) |
| static UBYTE * | makeval2 (UBYTE *dst, ULONG value, UWORD n) |
| static UBYTE * | makeval (ULONG value, UWORD n) |
| static void | makelong (ULONG value) |
| static UBYTE * | plong2 (ULONG value) |
| static UBYTE * | pbyte2 (ULONG value) |
| static UBYTE * | pword2 (ULONG value) |
| static UBYTE * | quick3 (ULONG value) |
| static UBYTE * | pquick2 (ULONG value) |
| static UBYTE * | ffptoascii (ULONG value, UWORD mode) |
| static UBYTE * | pfloat2 (ULONG value) |
| BL_ALWAYS_INLINE UBYTE * | numtext (UWORD type, ULONG value) |
| BL_ALWAYS_INLINE ULONG | ptype (UWORD type, const UBYTE **sp) |
| void | strprint (void) |
| BL_ALWAYS_INLINE ULONG | wstr (ULONG value, const UBYTE *args) |
| static void | formatchk_c (const ULONG *lens) |
| | BLITZ_ERRCHK_ASM (printctrlc, " .globl _printctrlc\n" "_printctrlc:\n" " jmp _blitz_tok+" BL_ASMTOK(LIB_inputoutputlib, 12)) |
| void dofloatmode_c |
( |
UWORD | m | ) |
|
|
static |
FloatMode Mode - how floats are printed: -1 = always fixed point ("standard"), 0 = guess (fixed point for 1E-9 <= |x| < 1E+7, else exponent form), 1 = always exponent form.
Keeps all registers like the original.
Fixed (#241): fixed point with FloatMode -1 (or a Format string) and |x| < 1E-17 wrote past the 50 byte buffer into the table of powers of ten; the buffer has 52 bytes.
- Parameters
-
| void doformat_c |
( |
const UBYTE * | s, |
|
|
const UBYTE * | args ) |
|
static |
Format FormatString - the format of numbers for Print, NPrint and Str$ ("" = none).
doformat - copy the string to form, count the digit places before and after the point. "#" = digit or space, "0" = digit or zero, "." decimal point, "-" = "-" if negative else space, "+" = "+"/"-", "," = "," (space in the leading pad), other characters literally. With a Format string floats are always fixed point. The original keeps d0 (MOVE.l d0,a0).
By design (#240): a Format string longer than 32 characters (no check without the debugger) runs over formlen/formlead/formtrail/decpos and further into the conversion buffers. (The bugs of the formatting itself, #235-#238, are fixed.)
Errors (debugger only, formatchk): "Format String too long" (> 32).
- Parameters
-
| s | d0: the characters. |
| args | a2: the argument stack: the length is popped with MOVE.l -(a2),d1, only its low word is used. |
| void doprint |
( |
UWORD | n, |
|
|
const UBYTE * | args ) |
Print Expression[,Expression...] - output the values to the current output (inputoutputlib, dooutstring1 $5208).
The arguments are of unknown type: for each the type word and then the value are popped from the a2 stack (MOVE.l for long/quick/float, MOVE for byte/word, length then address for a string). Number formats (see the top): byte/word/long decimal, quick with up to 4 decimals, float as FloatMode says; with a Format string all numbers formatted. DIFF: a2 is left unchanged (the original returns it decremented by everything it popped).
- Parameters
-
| n | d7: the number of arguments (move.w numreps,d7). |
| args | a2: the argument stack. |
| ULONG dostrstr |
( |
ULONG | v, |
|
|
const UBYTE * | args ) |
Str$(Expression) - the value as Print would output it, as a string.
Redirects the output to strprint (inputoutputlib dosetout), prints, restores: with Format active, Str$ formats like Print. The characters go to a3. Not a bug (no effect): dosetout is called twice, so every Str$ pushes two entries on inputoutputlib's output stack (a ring of 16).
Fixed (#242): Str$ of a string is the string itself (the original printed it as a byte, the low byte of the address).
- Parameters
-
| v | d0: the value (for a string: its address). |
| args | a2: the argument stack: the type word is popped (for a string then its length). |
- Returns
- d0: the length of the string.