3.7. Encoding

The .text directive outputs bytes to the memory that represents the given textstring. The default encoding is 'screencode_mixed', which maps to the screencode representations of the charset with both uppercase and lowercase letters. To change the encoding, use the .encoding directive:

// How to use encoding
.encoding "screencode_upper"
.text "THIS IS WRITTEN IN THE UPPERCASE SINCE LOWERCASE CHARS ARE USE FOR GFX SIGNS"

.encoding "screencode_mixed"
.text "In this ENCODING we have both UPPER and lower case chars."
.text "Remember to swith to a charset that fits the encoding."


The encoding affects every operation that converts characters in the sourcecode to byte values, for instance the '.import text' directive is also affected.

The supported encodings are:

Table 3.6. Encodings

Name Description
petscii_mixed The petscii representation of the charset with both upper and lower case characters.
petscii_upper The petscii representation of the charset with upper case and graphics characters.
screencode_mixed The screencode representation of petscii_mixed
screencode_upper The screencode representation of petscii_upper