1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-29 04:41:30 +00:00
millfork/docs/stdlib/stdio.md

38 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2019-07-15 12:21:50 +00:00
[< back to index](../doc_index.md)
2019-06-05 09:46:06 +00:00
## stdio
The `stdio` module automatically imports the `string` and `err` modules.
2020-03-31 17:07:35 +00:00
It requires an implementation of `void putchar(byte a)` and therefore works only on targets with console output
(see [the frequently provided definitions](./frequent.md) for details).
On targets with idiosyncratic behaviour of `putchar`, functions in this module inherit that behaviour.
2019-06-05 09:46:06 +00:00
2020-04-05 22:42:52 +00:00
All strings are assumed to be in the default encoding.
2019-06-05 09:46:06 +00:00
#### `void putstr(pointer str, byte len)`
Prints a string of length `len` located at address `str`.
#### `void putstrz(pointer str)`
Prints a null-terminated string located at address `str`.
If the string is longer than 255 bytes, then the behaviour is undefined (might even crash).
2020-04-05 22:42:52 +00:00
#### `void putpstr(pointer pstr)`
Prints a length-prefixed string located at address `str`.
2019-06-05 09:46:06 +00:00
#### `void putword(word w)`
Prints the decimal representation of the 16-bit unsigned integer `w`.
2020-04-05 22:42:52 +00:00
#### `void putsigned16(signed16 x)`
2020-03-31 17:07:35 +00:00
2020-04-05 22:42:52 +00:00
Prints the decimal representation of the 16-bit signed integer `x`.
2020-03-31 17:07:35 +00:00
2019-06-05 09:46:06 +00:00
#### `void ensure_mixedcase()`
2020-04-05 22:42:52 +00:00
On targets that have separate all-caps and mixed-case modes (like most Commodore machines), switches to the mixed-case mode.
On the remaining platforms, does nothing.
2019-06-05 09:46:06 +00:00