Display New Text
easy
Shows a new message on a display that reads every byte of the STRING, so nothing of the old one is left.
What it teaches
A STRING is a length, LEN, and 82 bytes of DATA. Copying text writes LEN and that many bytes, and leaves the rest of DATA as it was, so 'ABCD' copied over '12345678' still holds '5678' after it. Instructions read only LEN characters, but many displays and devices read all 82 bytes, so they show 'ABCD5678'. The old characters have to be cleared before the new text goes in. COP copies the whole source, so bytes past the source's own LEN come along too: 'AB' with 'ZZ' left after it shows as 'ABZZ'.
Parameters
| Tag | Direction | Type | Default | Description |
|---|---|---|---|---|
| Ref_Message | InOut | STRING | — | The text to show |
| Ref_Display | InOut | STRING | — | The text the display reads, all 82 bytes of it |
Required behavior
- Every scan, Ref_Display holds the text of Ref_Message.
- The display ignores LEN and shows all 82 bytes of DATA, so every byte of Ref_Display.DATA past its LEN must be 0.
- A copy writes LEN and that many bytes, and leaves the rest of DATA as it was: 'ABCD' copied over '12345678' leaves '5678' in the bytes after it.
- Ref_Message may hold old bytes past its own LEN too. They must not reach the display.
- Never change Ref_Message.