This package offers both a portable {py3} module and a command-line
tool.
-WARNING: This version of Normand is 0.5, meaning both the Normand
+WARNING: This version of Normand is 0.6, meaning both the Normand
language and the module/CLI interface aren't stable.
ifdef::env-github[]
The value of a variable assignment is the evaluation of a valid {py3}
expression which may include label and variable names.
-Fixed-length integer with a given length (8{nbsp}bits to 64{nbsp}bits) and byte order::
+Fixed-length number with a given length (8{nbsp}bits to 64{nbsp}bits) and byte order::
+
Input:
+
{strength = 4}
{be} 67 <lbl> 44 $178 {(end - lbl) * 8 + strength : 16} $99 <end>
{le} {-1993 : 32}
+{-3.141593 : 64}
----
+
Output:
+
----
-67 44 b2 00 2c 63 37 f8 ff ff
+67 44 b2 00 2c 63 37 f8 ff ff 7f bd c2 82 fb 21
+09 c0
----
+
-The encoded integer is the evaluation of a valid {py3} expression which
+The encoded number is the evaluation of a valid {py3} expression which
may include label and variable names.
https://en.wikipedia.org/wiki/LEB128[LEB128] integer::
|[[cur-offset]] Current offset
|
The current offset has an effect on the value of <<label,labels>> and of
-the special `ICITTE` name in <<fixed-length-integer,fixed-length
-integer>>, <<leb-128-integer,LEB128 integer>>, and
+the special `ICITTE` name in <<fixed-length-number,fixed-length
+number>>, <<leb-128-integer,LEB128 integer>>, and
<<variable-assignment,variable assignment>> expression evaluation.
Each generated byte increments the current offset.
|[[cur-bo]] Current byte order
|
The current byte order has an effect on the encoding of
-<<fixed-length-integer,fixed-length integers>>.
+<<fixed-length-number,fixed-length numbers>>.
A <<current-byte-order-setting,current byte order setting>> may change
the current byte order.
* A <<current-byte-order-setting,current byte order setting>> (big or
little endian).
-* A <<fixed-length-integer,fixed-length integer>> using the
- <<cur-bo,current byte order>> and of which the value is the result of
- a {py3} expression.
+* A <<fixed-length-number,fixed-length number>> (integer or
+ floating point) using the <<cur-bo,current byte order>> and of which
+ the value is the result of a {py3} expression.
* An <<leb128-integer,LEB128 integer>> of which the value is the result
of a {py3} expression.
``pass:[{be}]``:: Set the current byte order to big endian.
``pass:[{le}]``:: Set the current byte order to little endian.
-=== Fixed-length integer
+=== Fixed-length number
-A _fixed-length integer_ represents a fixed number of bytes encoding an
-unsigned or signed integer which is the result of evaluating a {py3}
-expression using the <<cur-bo,current byte order>>.
+A _fixed-length number_ represents a fixed number of bytes encoding
+either:
+
+* An unsigned or signed integer (two's complement).
++
+The available lengths are 8, 16, 24, 32, 40, 48, 56, and 64.
+
+* A floating point number
+ ([IEEE{nbsp}754-2008[https://standards.ieee.org/standard/754-2008.html]).
++
+The available length are 32 (_binary32_) and 64 (_binary64_).
-A fixed-length integer is:
+The value is the result of evaluating a {py3} expression using the
+<<cur-bo,current byte order>>.
+
+A fixed-length number is:
. The ``pass:[{]`` prefix.
. A valid {py3} expression.
+
-For a fixed-length integer at some source location{nbsp}__**L**__, this
+For a fixed-length number at some source location{nbsp}__**L**__, this
expression may contain the name of any accessible <<label,label>> (not
within a nested group), including the name of a label defined
after{nbsp}__**L**__, as well as the name of any
<<variable-assignment,variable>> known at{nbsp}__**L**__.
+
-The value of the special name `ICITTE` in this expression is the
-<<cur-offset,current offset>> (before encoding the integer).
+The value of the special name `ICITTE` (`int` type) in this expression
+is the <<cur-offset,current offset>> (before encoding the number).
. The `:` character.
-. An encoding length in bits amongst `8`, `16`, `24`, `32`, `40`,
- `48`, `56`, and `64`.
+. An encoding length in bits amongst:
++
+--
+The expression evaluates to an `int` value::
+ `8`, `16`, `24`, `32`, `40`, `48`, `56`, and `64`.
+
+The expression evaluates to a `float` value::
+ `32` and `64`.
+--
. The `}` suffix.
----
====
+====
+Input:
+
+----
+{le}
+{2 * 0.0529 : 32}
+----
+
+Output:
+
+----
+ac ad d8 3d
+----
+====
+
=== LEB128 integer
An _LEB128 integer_ represents a variable number of bytes encoding an
defined after{nbsp}__**L**__.
--
+
-The value of the special name `ICITTE` in this expression is the
-<<cur-offset,current offset>> (before encoding the integer).
+The value of the special name `ICITTE` (`int` type) in this expression
+is the <<cur-offset,current offset>> (before encoding the integer).
. The `:` character.
. The `<` prefix.
. A valid {py3} name which is not `ICITTE` (see
- <<fixed-length-integer>>, <<leb128-integer>>, and
+ <<fixed-length-number>>, <<leb128-integer>>, and
<<variable-assignment>> to learn more).
. The `>` suffix.
. The ``pass:[{]`` prefix.
. A valid {py3} name which is not `ICITTE` (see
- <<fixed-length-integer>>, <<leb128-integer>>, and
+ <<fixed-length-number>>, <<leb128-integer>>, and
<<variable-assignment>> to learn more).
. The `=` character.
after{nbsp}__**L**__, as well as the name of any
<<variable-assignment,variable>> known at{nbsp}__**L**__.
+
-The value of the special name `ICITTE` in this expression is the
-<<cur-offset,current offset>>.
+The value of the special name `ICITTE` (`int` type) in this expression
+is the <<cur-offset,current offset>>.
. The `}` suffix.