MᏫᎻᎯᎷᎷᎬᎠ
That probably will be the first time he knew that function don't change the original value
Talula
In assembly everything works with pointers... EAX is a pointer that points to any part of memory. ECS is pointer to Code Space ESS is pointer to Stack Space
MᏫᎻᎯᎷᎷᎬᎠ
CPU registers has pointers?
MᏫᎻᎯᎷᎷᎬᎠ
First time i know that
Talula
CPU registers are pointers.
Talula
not "has" pointers.
MᏫᎻᎯᎷᎷᎬᎠ
CPU registers are pointers.
To what? To memory (RAM) location?
S.
pointers and integers have no difference in asm
Anonymous
Asm
Anonymous
Kya
Anonymous
Yep
MᏫᎻᎯᎷᎷᎬᎠ
Asm
Yeah
▅▆▇█۩۩ąmãňî۩۩█▇▆▅
#include <iostream> using namespace std; // Utility function to find int factorial(int n) { int res = 1; for (int i=2; i<=n; i++) res *= i; return res; } // A Simple Function to return value of 1/1! + 1/2! + .. + 1/n! double sum(int n) { double sum = 0; for (int i = 1; i <= n; i++) sum += 1.0/factorial(i); return sum; } // Driver program to test above functions int main() { int n = 5; cout << sum(n); return 0; }
MᏫᎻᎯᎷᎷᎬᎠ
Kya
Kya = what!!!!
Dima
format your code please
Talula
To what? To memory (RAM) location?
Whatever you want to point to, Memory or even a port, they are just numbers.
Anonymous
Yeah
MᏫᎻᎯᎷᎷᎬᎠ
Whatever you want to point to, Memory or even a port, they are just numbers.
How can the cpu differentiate between numbers and pointers?!
Anonymous
Special
Anonymous
Symbles
MᏫᎻᎯᎷᎷᎬᎠ
How
MᏫᎻᎯᎷᎷᎬᎠ
If I want to sum 1 + 1
MᏫᎻᎯᎷᎷᎬᎠ
1 is a pointer or a number
S.
it may store 1 in EAX, and then inc
S.
it doesn't care
Talula
Like you could say MOV AX,9 MOV BX,[Location_Of_String] INT 21H This will print whatever BX is point at in (8086)
MᏫᎻᎯᎷᎷᎬᎠ
it may store 1 in EAX, and then inc
Let's say it was an ordinary addition operation
Neon
After that fight for Ur pointers
MᏫᎻᎯᎷᎷᎬᎠ
Talula
Here AX, 9 means you're moving number 9 in AX MOV BX,[Pointer_to_Memory] You're moving a pointer to memory that means a number again
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
Is there any kind of symbol to help the cpu differentiate between both of them
Talula
EAX is a general purpose register, not a pointer...
When did I say it's pointer, it's a number.
Talula
And that location is a number too.
S.
EAX is a general purpose register, not a pointer...
It can save a "pointer" though
Talula
". EAX is a pointer"
Yes and pointer is nothing but a number.
olli
Yes and pointer is nothing but a number.
true, but EAX is neither a number it is a register
Talula
You could use it like a pointer (which is a number) or have a number which is a number.
Talula
true, but EAX is neither a number it is a register
Yes a register that stores a number...
S.
Talula
Pointer simply means a number that points to be memory location where a certain thing is stored.
Talula
What?!!
Pointer simply means a number that points to be memory location where a certain thing is stored.
olli
But then again, I would not consider a pointer part of assembly. A pointer is part of programming language to store a memory address
MᏫᎻᎯᎷᎷᎬᎠ
But in the cpu
MᏫᎻᎯᎷᎷᎬᎠ
Eax for example
MᏫᎻᎯᎷᎷᎬᎠ
It only stores pointers?
olli
no, "any" value
Talula
But then again, I would not consider a pointer part of assembly. A pointer is part of programming language to store a memory address
It is something that you have to know to work with Assembly and you don't have to know if you're programming Java, Python and to a limit C#
olli
a pointer is just anothre value
MᏫᎻᎯᎷᎷᎬᎠ
Talula
CPU has these pointers that are special memory area inside the CPU with a very fast memory access, I think there is EAX, EBX, ECX, EDX... I think they removed CS because in 8 bit register the memory is access using Segments... but it's not needed anymore.
MᏫᎻᎯᎷᎷᎬᎠ
It's better to have these kind of conversation in this group
Talula
registers
Sorry registers... my mistake.
Anonymous
..
Anonymous
Hi
itsmanjeet
Hey If i make a pointer Then that cause memory leak ??
itsmanjeet
I totally don't know about memory leak Please guide me
itsmanjeet
Google what a memory leak is
I am asking after searching I read about gnome that its memory leaking a lot Then i search on google what it memory leak Gogle say that if pointer is not deleted than it is called as memory leak
Mat
A memory leak occures when there's something using memory without the need of it
Mat
Like having something you don't need
itsmanjeet
If i create a pointer in my programm and my program end The pointer area clean automatically ??
itsmanjeet
Anonymous
oof, GNOME developer
AngryMethane
Hi, guys. I have a problem about exception of std::ofstream. I wrote the piece of code. It has no access to folder /var/log, but the code didn’t throw the exception.
AngryMethane