In c, an rvalue is not necessarily a boolean, since boolean True equates to 1, and False equates to 0.
This is important when dealing with mixed C and assembler, because a 'short' (8 bit) 4 = 0000 0100, and if passed to the assembler
will be construed as False if used in the context of a boolean. You can use what C calls 'integral promotions' to create a boolean True from the 4 by assuring that bit zero is set to one.
assume variable z = 4 then z = ! ! z would become 0000 0001 which is now boolean True. and if it started as 0 would remain so, and would satisfy boolean False.
Been a while since I thought C or assembler so hope this makes sense.
This is important when dealing with mixed C and assembler, because a 'short' (8 bit) 4 = 0000 0100, and if passed to the assembler
will be construed as False if used in the context of a boolean. You can use what C calls 'integral promotions' to create a boolean True from the 4 by assuring that bit zero is set to one.
assume variable z = 4 then z = ! ! z would become 0000 0001 which is now boolean True. and if it started as 0 would remain so, and would satisfy boolean False.
Been a while since I thought C or assembler so hope this makes sense.