Document fait avec Nvu Document made with Nvu




Emulator matric displays driver

Instructions
Use
Example

Principle

If the matric displays of the emulator are addressable registers in the extension registers area of the FORTH core described as follows:

290 (0x122) column 0 (in left side)
291 (0x123) column 1
...
299 (0x12B) column 9 (in right side)

read/write:
bits[15..8] = 0x00
bits[7..0] = 0, dot in bottom side, ..., dot in top side

lit dot if 1


The driver will allow to facilitate the use of these registers while making use of the real-time kernel. The principle consists in making i possible the developer to have only to manage a simple 2 characters string in ASCII coded.


Instructions

- CW_MATRICE 290

Numero of the extension register of the first of the 10 columns of the 2 displays.

adr_chr MATRICE -

Displaying of the 2 ASCII characters.
adr_chr is the address of the first of the 2 ASCII coded characters (8 bits by character).

Use

The driver not being integrated into the kernel, it is initially necessary to compile the source file matriciels.txt before being able to use it.

The following sequence is corresponding to the displaying of "12":

" 12" STRING S_NUMBER

S_NUMBER 1+ MATRICE


The driver uses a table allowing to transform each of the 2 ASCII coded to a displaying character (0 to 127).

Example

The following program installs a task which display all the possible characters:

DECIMAL

"   " STRING S_MATRICE ( ! spaces )

TACHE: T_MATRICIELS
 S_MATRICE 1+ DUP MATRICE DUP C@
 IF
  (
Left characters shifting )
  DUP >R 1+ C@ DUP R@ C! DUP 127 = OVER 0= OR
  IF
   ( Progressive clearing of the string when the character 127 was displayed )
   DUP XOR
  ELSE
   1+
  THEN
  R> 1+ C!
 ELSE
  ( Initialization of the string and task removing )
  2 32 FILL T_MATRICIELS T_RETIRE
 THEN
;

Here is a video: