From 9f5a5233eac2dc2392c09bbf558706623ebf4d89 Mon Sep 17 00:00:00 2001
From: Guy Perfect
Floats, like words, are represented as sequences of character digits. They
- are differentiated from words by the presence of a dot .
+ are distinguished from words by the presence of a dot .
character somewhere within the sequence. Only one dot may be present in a
float literal, and dots cannot be used in hexadecimal literals. If the given
value cannot be represented in the float data type, a parsing error occurs.
- Float values in the expression evaluator are subjected to the same
- restrictions as on the Virtual Boy's CPU: if the result of any float
+ Float values in the expression evaluator are subjected to the following
+ restrictions: if the value of any float literal or the result of any float
operation is NaN, an infinity, a denormal number or negative zero, it will be
changed to positive zero.
0
if false or the value 1
if true. Boolean
literals are specified with the named values true
and
- false
within the expression. In a boolean operation, any result
+ false
within the expression. In a boolean operation, any value
that is zero is considered false, and any non-zero value is considered true.
@@ -298,13 +298,13 @@
Operators may apply to one (unary) or two (binary) values. All unary operators appear to the left of the value they modify (or another unary - operator). Binary operators appear between the values they modify. Each - operator considers the types of its operands in order to produce a new value - of the appropriate type. + operator). Binary operators appear between the values they modify.
- If the operands of a binary operator have different types, one of the values - will be converted to the other type before performing the operation. The - conversion depends on the "greater" of the two types, in the following order - (higher is "greater"): + Each operator considers the types of its operands in order to produce a new + value of the appropriate type. If the operands of a binary operator have + different types, one of the values will be converted to the other type before + performing the operation. The conversion selects the "greater" of the two + types, in the following order (higher is "greater"):
↑ | Float |
For example, if an operation contains both a signed word and a float, the - signed word value is first converted to float. + signed word value is converted to float before performing the operation.
Operators have assigned precedence that specifies the order of operations. @@ -467,12 +466,14 @@
The following operators may be used in expressions. Groups listed higher have higher precedence and happen before groups listed lower. Operators within - groups have the same precedence and are processed in the order they appear in - the expression from left to right. + groups have the same precedence and are processed according to the order in + which they appear in the expression: right-to-left for unary operators, + left-to-right for binary operators.
~ | +Unary | +~ | Not Bitwise | Cannot be used with a float value. | The binary value is not modified. |
/ | +Binary | +/ | Divide | Zero divisor yields zero as result. |
<< | Shift Left | -Cannot be used with a float value. | +Cannot be used with float values. | |
>> | Shift Right Arithmetic | -Cannot be used with a float value. | +Cannot be used with float values. | |
>>> | Shift Right Logical | -Cannot be used with a float value. | +Cannot be used with float values. | |
> | @@ -634,17 +636,17 @@||||
& | And Bitwise | -Cannot be used with a float value. | +Cannot be used with float values. | |
^ | Exclusive Or Bitwise | -Cannot be used with a float value. | +Cannot be used with float values. | |
| | Or Bitwise | -Cannot be used with a float value. | +Cannot be used with float values. | |
&& | @@ -691,6 +693,13 @@Performs a halfword read of the specified signedness. |
+ Reads are subjected to the alginment restrictions of the Virtual Boy's CPU: + the lowest bit of the address is ignored for halfword reads, and the lowest + two bits of the address are ignored for word reads. +
+ +