I have that question of how it works if
in low level programming.
If so, it checks the RAM by going through all the addresses that contain it.
I have that question of how it works if
in low level programming.
If so, it checks the RAM by going through all the addresses that contain it.
Good.
High-level ifs are not the same as low-level ifs. An if is not compared in ram, the processor loads the data from Ram memory to registers (EAX, EDX, etc. These are like "variables" that the processor has physically by means of transistors and electronic elements) Then it compares these registers with CMP instruction and flow control instructions like JNZ, JG, JL, JO. These instructions are symbolic names of binary values, this is so that the programmer can understand the program, but an assembler development environment usually looks like this:
Where you see a structure like:
[ memory address ] [ instruction code ] [ mnemonic code ][ ; and sometimes comments ]
Then the CMP instruction compares two registers and sets the corresponding [FLAGS] flags . Then a jump instruction such as JE (jump if equal) determines where the program flow continues according to the corresponding flag by moving the EIP pointer (Instruction pointer register). After this, the corresponding instruction blocks are executed.
You can see the full high-level vs. low-level code example in this question I answered a long time ago. This is a part of the code, they both do the same thing:
asm
Java