Index wersja polska wersja polska

Elektronika MK-90 - data formats

All numbers on this page are hexadecimal, unless stated otherwise.


Character set

Characters are encoded according to the KOI-7 standard.

Character codes 20-3F

characters

Latin characters (set N0), codes 40-7F

Latin characters

Cyrillic characters (set N1), codes 40-7F

Cyrillic characters

These drawings were machine generated from the ROM image.


Representation of floating point numbers

A floating point number occupies three 16-bit words. First two words contain the 32-bit mantissa in two's complement form. The third word contains the 16-bit exponent with a bias of 0x8000. Examples:

Number Encoding
0
1
10
100
255
1000
65535
0.5
0.125
0.1
0.001
-1
-10
-0.1
0000 0000 0000
0000 4000 8001
0000 5000 8004
0000 6400 8007
0000 7F80 8008
0000 7D00 800A
8000 7FFF 8010
0000 4000 8000
0000 4000 7FFE
6666 6666 7FFD
374B 4189 7FF7
0000 C000 8001
0000 B000 8004
999A 9999 7FFD

Workspace objects

Variable or array

    1 word      bits 15-13: identifier 000
                bits 11-6:  first character of the name ('A'=00, 'B'=01, ...)
                bits 5-0:   second character of the name (digit in ASCII)
    1 word      maximal first subscript in the upper byte,
                maximal second subscript in the lower byte,
                zero in case of a simple variable
    3 words     first value
    3 words     second value
    ...
    3 words     last value

Examples:

    0600 0000           simple variable X
    0000 6400 8007      value=100

    0675 0000           simple variable Y5
    0000 6400 8008      value=200

    0440 0300           one-dimensional array DIM Q(3)
    3333 B333 7FFF      value Q(0)=-0.3
    6666 6666 7FFC      value Q(1)=0.05
    0000 7FFC 800D      value Q(2)=8191
    0000 8004 800D      value Q(3)=-8191

    06B1 0102           two-dimensional array DIM Z1(1,2)
    9400 7735 801E      value Z1(0,0)=1E9
    2F9E 44B8 7FE3      value Z1(0,1)=1E-9
    6C00 88CA 801E      value Z1(0,2)=-1E9
    D062 BB47 7FE3      value Z1(1,0)=-1E-9
    0000 4000 8010      value Z1(1,1)=32768
    0000 C000 8010      value Z1(1,2)=-32768

GOSUB entry

    1 word      bits 15-13: identifier 001
                bits 12-0:  number of the line with the GOSUB statement

FOR entry

    1 word      bits 15-13: identifier 010 
                bits 11-0:  name of the control variable
    1 word      address after the '=' character in the FOR statement
    3 words     TO value
    3 words     STEP value

User-defined function

    1 word      bits 15-13: identifier 011
                bits 7-0:   third letter of the function name (ASCII)
    1 word      bits 11-0:  name of the function variable
    1 word      address of the expression