Data types
There is no size of the machine word concept in NoSense. Almost every
instruction has several kinds that allow to do the operation on different
data types. This page describes data types that are used in NoSense,
their symbols and all the other symbol convention that is used in this
documentation, especially in instruction and input-output messages
description.
Bit (b) is the least, elementary information unit that can contain
one of two values: 0 or 1. Byte (B) is the fundamental information unit
that groups 8 bits. Remembering that, it will be more comfortable to talk
about number of bytes, not number of bits.
1B = 8b
2B = 16b
4B = 32b
8B = 64b
Bytes are stored in the little endian convention, like in Intel processors.
Data types
Natural numbers (unsigned integer) stored in normal binary code:
1u
- Unsigned integer, size: 1B
Range: 0 ... 255
2u
- Unsigned integer, size: 2B
Range: 0 ... 65`535
4u
- Unsigned integer, size: 4B
Range: 0 ... 4`294`967`295
8u
- Unsigned integer, size: 8B
Range: 0 ... 18`446`744`073`709`551`615
Signed integer numbers stored in U2 code:
1i
- Unsigned integer, size: 1B.
Range: -128 ... 127
2i
- Unsigned integer, size: 2B.
Range: -32`768 ... 32`767
4i
- Unsigned integer, size: 4B.
Range: -2`147`483`648 ... 2`147`483`647
8i
- Unsigned integer, size: 8B.
Range: -9`223`372`036`854`775`808 ... 9`223`372`036`854`775`807
Real numbers (floating point) stored in FP2 code:
4f
- Floating point number, size: 4B.
Range: 1.175494351*10-38 ... 3.402823466*1038
Precision: 6-7 digits
8f
- Floating point number, size: 8B.
Range: 2.2250738585072014*10-308 ... 1.7976931348623158*10308
Precision: 15-16 digits
Logical values:
1b
- Logical type, size: 1B
- Value equal 0 means logical false
- Value not equal 0 means logical true
Other symbols
Symbols for different ways of storing character strings:
0s
- String, which end is marked by the character with code 0.
Limitation: There cannot be character with code 0 inside the string
1s
- 1B
[1u] for string size and next string characters.
Limitation: Maximum string length is 255 characters
2s
- 2B
[2u] for string size and next string characters.
Limitation: Maximum string length is 65`535 characters
4s
- 4B
[4u] for string size and next string characters.
Limitation: Maximum string length is 4`294`967`295 characters
ns
- Only string characters. You must store string length separately.
1u(char)
- 1-byte unsigned integer that represents a single ASCII character
4i(addr)
- 4-byte signed integer that represents the address of a memory cell
4u(XRGB)
- 4-byte unsigned integer that represents a color
[1] Unused byte - should be 0
[1u] Red component
[1u] Green component
[1u] Blue component
Xi
- Means signed integer value in any size
4
- Means a 4-byte value of any type
N
- Fixed length data (length is usually given in separate parameter of instruction)
1248uif
- Means any allowed combination of mentioned size and type
4f[x]
- Array of
x 4B floating point values (size is x*4B)
4i(addr)->1b
- Memory cell address that must point to a value in type
1b
in
- Input value - must be set before call of the instruction
out
- Output value - will be modified during execution of the instruction