24.3.4 Casting Offsets

The right-associative unary operator cast as can be used to derive a new offset value having a different type from an existing value.

For example, this is how we would create a signed 12-bit offset in units bytes:

(poke) 1024#b as offset<int<12>,B>
128 as int<12>#B

The same rules governing conversion of integers apply for the magnitude part. Depending on the unit, there can be truncation, like in:

(poke) 9#b as offset<int,B>
1#B