Tom said:
unsigned char x;
int ix;
x = 4;
ix = x;
What am I missing?
totally legal conversion provided you keep the values in x to the
portable range.
I may be mistaken here, but...
extern void foo(unsigned char c);
extern void bar(int i);
void foobar()
{
unsigned char c = 'x';
foo(c);
bar(c);
}
Here, the call to foo() can push the single byte of c (if the system
allows one to push a byte), or load the byte into a register and then
push the register. However, the call to bar() requires that the byte
be loaded into a register, while zero-filling the register prior to
pushing it on the stack.
Perhaps something like:
load al,[c]
push eax
call foo
xor eax,eax
load al,[c]
push eax
call bar
(Yes, this example assumes the concept of registers and a stack.)
--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody |
www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net |
www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:
[email protected]>