diff --git a/CHANGELOG.md b/CHANGELOG.md index 78e7fa62..29031ae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ * Enabled calling macros with index expression parameters. +* Enabled calling macros from assembly. + * Added optimizer hints: `inline`, `noinline`, `register`. * Added command line flags `--size`, `--fast`, `--blast-processing`. @@ -19,7 +21,7 @@ * Removed command line flag `--detailed-flow`. Detailed flow analysis was slow, broken, hard to maintain, and didn't even help that much. -* Added `*'=` and `nonet` operators. (Also, the `<<<<` operator, but it will be phased out before 0.2 and replaced by `nonet(a << b)`.) +* Added `*'=` and `nonet` operators. * Added support for zeropage pseudoregisters, allowing for some operators work with more types of operands. @@ -31,6 +33,8 @@ Detailed flow analysis was slow, broken, hard to maintain, and didn't even help * Added octal and quaternary literals. +* Fixed several allocation bugs. + * Fixed several optimization bugs. * Fixed several C64 library bugs. diff --git a/doc/lang/operators.md b/doc/lang/operators.md index 43703cbc..00959b48 100644 --- a/doc/lang/operators.md +++ b/doc/lang/operators.md @@ -16,7 +16,7 @@ Millfork has different operator precedence compared to most other languages. Fro * `*`, `*'` -* `+`, `+'`, `-`, `-'`, `|`, `&`, `^`, `>>`, `>>'`, `<<`, `<<'`, `>>>>`, `<<<<` +* `+`, `+'`, `-`, `-'`, `|`, `&`, `^`, `>>`, `>>'`, `<<`, `<<'`, `>>>>` * `:` @@ -42,7 +42,7 @@ In the descriptions below, arguments to the operators are explained as follows: * `word` means any two-byte type, or a byte expanded to a word -* `long` means any type longer than two bytes, or a shorted type expanded to such length to match the other argument +* `long` means any type longer than two bytes, or a shorter type expanded to such length to match the other argument * `constant` means a compile-time constant @@ -92,11 +92,8 @@ There are no division, remainder or modulo operators. `constant word << constant byte` `constant long << constant byte` -* `>>>>`: shifting a 9-bit value and returning a byte; `a >>>> b` is equivalent to `(a & $1FF) >> b`, but the latter doesn't compile yet -`word >>>> constant byte` - -* `<<<<`: shifting a byte and returning a 9-bit value; `a <<<< b` is equivalent to `(a << b) & 0x1ff` if there was no overflow, but the latter doesn't compile yet -`byte <<<< constant byte` +* `>>>>`: shifting a 9-bit value and returning a byte; `a >>>> b` is equivalent to `(a & $1FF) >> b` +`word >>>> constant byte` ## Decimal arithmetic operators @@ -182,4 +179,16 @@ An expression of form `a[i]`, where `i` is an expression of type `byte`, is: Those expressions are of type `byte`. If `a` is any other kind of expression, `a[i]` is invalid. +## Built-in functions + +* `not`: negation of a boolean expression +`not(bool)` + +* `nonet`: expansion of an 8-bit operation to a 9-bit operation +`nonet(byte + byte)` +`nonet(byte +' byte)` +`nonet(byte << constant byte)` +`nonet(byte <<' constant byte)` +Other kinds of expressions than the above (even `nonet(byte + byte + byte)`) will not work as expected. +