<!-- PDF page 282 -->

## Appendix A – Character Set, Z80N Mnemonics and Control Codes

This is the complete ZX Spectrum Next / *NextZXOS* character set, with codes in decimal and hexadecimal, the character each code represents, as well as the control codes (shaded) together with their corresponding *NextBASIC* tokens, if any. Tokens that are shaded are specific to the ZX Spectrum Next and cannot be found in earlier ZX Spectrum models. As the codes are also Z80N machine code instructions, the right hand columns give the corresponding assembly language mnemonics. As you are probably aware if you understand these things, certain Z80N instructions are compounds starting with **CBh** or **EDh**; the two rightmost columns give you these. Note that **ED** instructions that are shaded, cannot be found in regular Z80 CPUs and are only native to Z80N, the variant of the Z80 CPU, found on the ZX Spectrum Next. Control codes are marked with **UW** if they refer to User Windows and **SW** if they refer to System Windows.

<table>
<thead>
<tr><th>Dec</th><th colspan="2">Character / Control Code / Token</th><th>Hex</th><th>Z80N Assembler</th><th>- after CB</th><th>- after ED</th></tr>
</thead>
<tbody>
<tr><td>0</td><td colspan="2">[colour: pale yellow] <b>Justify off</b> (UW) <b>Increase font</b> (SW)</td><td>00</td><td>nop</td><td>rlc b</td><td></td></tr>
<tr><td>1</td><td colspan="2">[colour: pale yellow] <b>Justify on</b> (UW) <b>Decrease font</b> (SW)</td><td>01</td><td>ld bc,NN</td><td>rlc c</td><td></td></tr>
<tr><td>2</td><td colspan="2">[colour: pale yellow] <b>Save Window</b> (UW) <b>Change font</b> (SW)</td><td>02</td><td>ld (bc),a</td><td>rlc d</td><td></td></tr>
<tr><td>3</td><td colspan="2">[colour: pale yellow] <b>Restore Window</b> (UW)<br><b>Regenerate Small Fonts</b> (SW)</td><td>03</td><td>inc bc</td><td>rlc e</td><td></td></tr>
<tr><td>4</td><td colspan="2">[colour: pale yellow] <b>Cursor to top left</b> (UW)(SW)</td><td>04</td><td>inc b</td><td>rlc h</td><td></td></tr>
<tr><td>5</td><td colspan="2">[colour: pale yellow] <b>Cursor to bottom left</b> (UW)(SW)</td><td>05</td><td>dec b</td><td>rlc l</td><td></td></tr>
<tr><td>6</td><td colspan="2">[colour: pale yellow] <b>PRINT</b> comma</td><td>06</td><td>ld b,N</td><td>rlc (hl)</td><td></td></tr>
<tr><td>7</td><td colspan="2">[colour: pale yellow] EDIT, <b>Scroll</b> (SW)(UW)</td><td>07</td><td>rlca</td><td>rlc a</td><td></td></tr>
<tr><td>8</td><td colspan="2">[colour: pale yellow] ⇦</td><td>08</td><td>ex af,af'</td><td>rrc b</td><td></td></tr>
<tr><td>9</td><td colspan="2">[colour: pale yellow] ⇨</td><td>09</td><td>add hl,bc</td><td>rrc c</td><td></td></tr>
<tr><td>10</td><td colspan="2">[colour: pale yellow] ⇩</td><td>0A</td><td>ld a,(bc)</td><td>rrc d</td><td></td></tr>
<tr><td>11</td><td colspan="2">[colour: pale yellow] ⇧</td><td>0B</td><td>dec bc</td><td>rrc e</td><td></td></tr>
<tr><td>12</td><td colspan="2">[colour: pale yellow] DELETE / <b>Backspace</b></td><td>0C</td><td>inc c</td><td>rrc h</td><td></td></tr>
<tr><td>13</td><td colspan="2">[colour: pale yellow] ENTER / Carriage Return<br><b>PRINT</b> apostrophe</td><td>0D</td><td>dec c</td><td>rrc l</td><td></td></tr>
<tr><td>14</td><td colspan="2">[colour: pale yellow] <b>Clear Window</b> (UW)(SW)</td><td>0E</td><td>ld c,N</td><td>rrc (hl)</td><td></td></tr>
<tr><td>15</td><td colspan="2">[colour: pale yellow] <b>Wash Window</b> (UW)(SW)</td><td>0F</td><td>rrca</td><td>rrc a</td><td></td></tr>
<tr><td>16</td><td colspan="2">[colour: pale yellow] <b>INK</b></td><td>10</td><td>djnz DIS</td><td>rl b</td><td></td></tr>
<tr><td>17</td><td colspan="2">[colour: pale yellow] <b>PAPER</b></td><td>11</td><td>ld de,NN</td><td>rl c</td><td></td></tr>
<tr><td>18</td><td colspan="2">[colour: pale yellow] <b>FLASH</b></td><td>12</td><td>ld (de),a</td><td>rl d</td><td></td></tr>
<tr><td>19</td><td colspan="2">[colour: pale yellow] <b>BRIGHT</b></td><td>13</td><td>inc de</td><td>rl e</td><td></td></tr>
<tr><td>20</td><td colspan="2">[colour: pale yellow] <b>INVERSE</b></td><td>14</td><td>inc d</td><td>rl h</td><td></td></tr>
<tr><td>21</td><td colspan="2">[colour: pale yellow] <b>OVER</b></td><td>15</td><td>dec d</td><td>rl l</td><td></td></tr>
<tr><td>22</td><td colspan="2">[colour: pale yellow] <b>AT</b></td><td>16</td><td>ld d,N</td><td>rl (hl)</td><td></td></tr>
<tr><td>23</td><td colspan="2">[colour: pale yellow] <b>TAB</b></td><td>17</td><td>rla</td><td>rl a</td><td></td></tr>
<tr><td>24</td><td colspan="2">[colour: pale yellow] <b>ATTR</b> (UW)(SW)</td><td>18</td><td>jr DIS</td><td>rr b</td><td></td></tr>
<tr><td>25</td><td colspan="2">[colour: pale yellow] <b>POINT</b> (UW)(SW)</td><td>19</td><td>add hl,de</td><td>rr c</td><td></td></tr>
<tr><td>26</td><td colspan="2">[colour: pale yellow] <b>AUTO PAUSE</b> (UW)(SW)</td><td>1A</td><td>ld a,(de)</td><td>rr d</td><td></td></tr>
<tr><td>27</td><td colspan="2">[colour: pale yellow] <b>Fill window with character</b>(UW)(SW)</td><td>1B</td><td>dec de</td><td>rr e</td><td></td></tr>
<tr><td>28</td><td colspan="2">[colour: pale yellow] <b>Set Double Width</b> (UW)(SW)</td><td>1C</td><td>inc e</td><td>rr h</td><td></td></tr>
<tr><td>29</td><td colspan="2">[colour: pale yellow] <b>Set Font Height</b> (UW)</td><td>1D</td><td>dec e</td><td>rr l</td><td></td></tr>
<tr><td>30</td><td colspan="2">[colour: pale yellow] <b>Justification mode</b> (UW)<br><b>Set Font Width</b> (SW)</td><td>1E</td><td>ld e,N</td><td>rr (hl)</td><td></td></tr>
<tr><td>31</td><td colspan="2">[colour: pale yellow] <b>Permit embed. codes in justif. mode</b><br>(UW)<br><b>Redefine Character Set</b> (SW)</td><td>1F</td><td>rra</td><td>rr a</td><td></td></tr>
<tr><td>32</td><td>Space</td><td></td><td>20</td><td>jr nz, DIS</td><td>sla b</td><td></td></tr>
<tr><td>33</td><td>!</td><td></td><td>21</td><td>ld hl,NN</td><td>sla c</td><td></td></tr>
</tbody>
</table>

