in linux kernel :
we use "int 0x80" for calling interrupt (in this case system_call)
how can you explain that ?
why didn't the compiler declared it as integer instead it called an interrupt ??
int 0x80; is not valid C++. It will give you an error in any C++ compiler. Variables cannot be in "hexadecimal form". hexadecimal/decimal/octal/binary forms are merely different textual representations of the same number. They do not change how that number is stored in the computer.
int x; creates a variable of type 'int' which is named 'x'.
x = 0x80; assigns the hexadecimal value $80 to the variable 'x'. In this case it is basically the same as saying this: x = 128;
mIXpRo wrote:
in linux kernel :
The Linux kernel has absolutely nothing to do with C++. It can (and apparently does) mean something entirely different in that context and trying to compare the two is pointless.