Skip to content
ruifig edited this page Jan 2, 2020 · 1 revision

SCR0 - Text Screen

[TOC]

Screen Buffer

This device is a text screen, with an horizontal resolution of 80 characters and vertical resolution of 25 characters. The screen buffer can be mapped to any address. At the moment, the code page used is Code Page 850, although that might change in the future.

One possibility might be allowing the programmer to overwrite the existing code page. At the moment, there is only one screen mode supported (80x25). But that might change in the future.

Each character takes 2 bytes:

:::text
7 6 5 4 3 2 1 0   7 6 5 4 3 2 1 0 
B [bkg] I [for]   [ code point  ]
|   |   |    |              !---- Character
|   |   |    !------------------- Foreground colour (Text colour)
|   |   !------------------------ Foreground Intensity (see below)
|   !---------------------------- Background colour
!-------------------------------- Blink (1-blink, 0-no blink)

Blinking is not yet supported in the Simulator. It will come in time.

The available colours are as follow:

Value Colour
0x0 Black
0x1 Blue
0x2 Green
0x3 Cyan
0x4 Red
0x5 Magenta
0x6 Brown
0x7 White

For the foreground colour an extra bit (Foreground intensity) is available. It allows the foreground colour to be a brighter version of the colours in the above table.

Functions

Function 0 - Screen Information

Register Meaning
Input
ip Bus and function
Output
ip Error code
r0 Address of the screen buffer
r1 Horizontal resolution (in characters)
r2 Vertical resolution (in characters)
r3 Bytes per character

Function 1 - Map screen buffer

This function allows mapping the screen buffer to a different address.

Register Meaning
Input
ip Bus and function
r0 Screen buffer address
Output
ip Error code

Interrupts

This device doesn't generate any interrupts

Clone this wiki locally