Hi, I'm looking at calling an ASM routine from some C code. I'd like to pass some parameters into the ASM routine, and have it return a value. I don't believe function arguments are passed on the stack, but am not sure of the general mechanism that is used. Any advice? Thanks David
Variables of type bit and bit fields are not the same thing. bit types have a true or false state and can only have the values 0 or 1. When you assign a value to a bit the compiler determines the TRUTH of the value. In other words non-zero values (whether they are bit, char, int, long, or float) have a bit value of 1. Zero values have a bit value of 0. bit fields are a different animal entirely. A bit field has a value from 0 to (2^(number of bits) - 1). When you assign a value to a bit field, the compiler must determine the AMOUNT of the value. If the value is less than the maximum number that can be represented, there is no problem. If the value is larger than the bit field, the compiler must coerce the larger value into the bit field. This is done using the exact same method that is used if you were to assign a long to a character--the additional bits are lost and the original value is masked down to the number of bits represented by the bitfield. On a slightly different note, bit types may have a memory type associated with them, however, this the hardware limits where bits may be located, only the DATA and IDATA memory types may be used with bit variables. Jon