Anti-
debugging is how we can stop somebody from debugging our system and getting all
the information out of your subsystem.
Anti-
debugging is how we can stop somebody from debugging our system and getting all
the information out of your subsystem.
#define SWAP_NIBBLE(num) (((num & 0xF0F0F0F0) >>4) | ((num & 0x0F0F0F0F) << 4)))
Explanation
if num = 0x12345678 the output should be 0x21436587
Extract the alternate nibbles and shit by 4
((num & 0xF0F0F0F0) >>4) = 0x01030507
((num & 0x0F0F0F0F) << 4) = 0x20406080
ANDing both we get
0x21436587
No continue statements can be used only with loops line for and while
atoi() - converts a string to an internet
itoa() - converts an integer to string
gcvt() - converts a floating point number to a string
Scope of a variable means the area of code in which the variable has effect.
The four different kinds of scopes are
There are three different types of linkages
5,8
Explanation
strlen returns the size of the string i.e. "Hello" takes 5bytes
sizeof gives the size allocated for the datatype, In our case a pointer is allocated 8bytes
Static variables are stored in the data segment.
The data segment also contains function call frames and dynamically allocated memory.
The ISR does not return any value and hence the type returned is void
Explanation
Lets take the input as 10
10 = 0x1010 in hex
So,
0x1010 << 2 = 0x101000 = 40
0x1010 >>1 = 0x0101 = 5
hence
result = 40 - 5 =35 = 10*3.5
You can try with other numbers as well.
During the linker stage, the system has multiple object files to combine and it may be a possibility that some functions might have the same addresses so relocation or changing these addressing during combining the object file is called Static reallocation.
If a program accesses a memory beyond the available limit then a stack overflow occurs and the program gets terminated
#include <stdio.h>
#define concat(a, b) a##b
int main(void)
{
int yx =7;
printf("%d\n", concat(y, x));
printf("%d\n", concat(3, 2));
return 0;
}
OUTPUT
7
32
EXPLAINATION
the ## operator will concatinate the parameters passed to the macro
In the first case
concat(y, x) - the macro will output yx and pass its value to printf as yx is treated as a variable by printf
In the second case
concat(3, 2) - the macro will output 32 and printf will print 32 as its treated as an integer
Anti- debugging is how we can stop somebody from debugging our system and getting all the information out of your subsystem.