Since memory is only byte addressable, a single bit would have to be stored in a byte somewhere. Ergo you have to declare at least a byte. If you have multiple bits, you can use the same byte for at most 8 of them, but you must have a byte.
Or just keep it in a register or flag, but that gets a bit more complicated. If you keep it in a flag, you have to avoid intrusions which change that flag (hard to do). If you keep it in a register, you have to essentially dedicate that register to only holding a bit (or be really careful moving things into and out of the register, assuming those things have a predictable bit pattern that allows this to work), which would probably be a net negative to performance.
|