what is the term for a integer variable containing bit fields

If I have a variable that is intended to to be used with bitmasks, to retrieve values, i.e. bit fields and flags, what is the academic term for such a variable? If the (bit) fields are a analogous to fields in a struct, then the variable is analogues to the struct itself. Therefore I am not sure if calling the variable a bit field or bit flags, is correct, for example. I think there must be an "official" term for it, but I cannot find anything. Except for hardware, the term register,comes up, which makes sense. For example. var register uint32 // what is this called? const ( flagmask = 1

Apr 27, 2025 - 22:17
 0
what is the term for a integer variable containing bit fields

If I have a variable that is intended to to be used with bitmasks, to retrieve values, i.e. bit fields and flags, what is the academic term for such a variable?

If the (bit) fields are a analogous to fields in a struct, then the variable is analogues to the struct itself. Therefore I am not sure if calling the variable a bit field or bit flags, is correct, for example. I think there must be an "official" term for it, but I cannot find anything. Except for hardware, the term register,comes up, which makes sense.

For example.

var register uint32 // what is this called?

const (
    flagmask  = 1 << 2
    fieldmask = 3 << 4
)

register |= flagmask|fieldmask