1
0
mirror of https://github.com/KarolS/millfork.git synced 2026-04-26 10:20:51 +00:00
This commit is contained in:
Karol Stasiak
2019-04-16 16:56:23 +02:00
parent 9ea04db566
commit 0a36d83164
13 changed files with 76 additions and 18 deletions
+2
View File
@@ -90,6 +90,8 @@ The following features are defined based on the chosen CPU and compilation optio
* `PAL` 1 if the target is PAL, 0 otherwise
* `NULLPTR` physical value of `nullptr`, default 0
### Built-in preprocessor functions and operators
The `defined` function returns 1 if the feature is defined, 0 otherwise.
+8 -1
View File
@@ -66,6 +66,13 @@ Examples:
p[i] // valid only if the type 't' is of size 1, equivalent to 't(p.raw[i])'
p->x // valid only if the type 't' has a field called 'x', accesses the field 'x' of the pointed element
p->x.y->z // you can stack it
## `nullptr`
There is a 2-byte constant `nullptr` that can be assigned to any 2-byte pointer type.
Its actual value is defined using the feature `NULLPTR`, by default it's 0.
`nullptr` isn't directly assignable to non-pointer types.
## Boolean types
@@ -103,7 +110,7 @@ Assigment between numeric types and enumerations is not possible without an expl
Plain enumerations have their variants equal to `byte(0)` to `byte(<name>.count - 1)`.
Tip: You can use an enumeration with no variants as a strongly checked alternative byte type,
as there are no checks no values when converting bytes to enumeration values and vice versa.
as there are no checks on values when converting bytes to enumeration values and vice versa.
## Structs