Yes, I can not find anything how to set the ptr-bit of an instruction in nasm.
Because there are none. What is a 'ptr-bit'?
it is so frustrating, loading the value of the address in a register to access the address that is pointing to the value I need.
That how it works.
And sorry, fredericopissarra, your code does not do what ptr does !!!
read exactly what the problem is.
It helps if you were able to explain the problem coherently. As I undestand
now, what you are trying to do is to call a virtual function through an entry in a virtual table which pointer is at the begining of an instance of a object, pointed by 'ptr_address'. But even now, I'm not sure...
If I understand correctly, you have something like this:
class X {
public:
virtual void f( void );
virtual void g( void );
};
...
X *p = new X;
p->g();
delete p;
...
Assuming the pointer to the virtual table is at the begining of the object structure and then you must do:
...
call newX
mov ebx,eax ; EBX is preserved between calls.
...
mov eax,[ebx] ; Get the pointer of the vtable.
push ebx ; push the 'this' pointer.
call [eax+4] ; Call the function g() via its pointer.
...
push ebx
call delete
...
There is no way to do a double indirection in x86 assembly.
With a assembler directive (USE 32) you don't need the "dword", eax only defines the length of the last value!
You waste CPU zycles without ptr. And if you have a special task you get extremely slow.
I know about the default size of addresses accordingly to the model in use. And there is no way you can spare this cycles due to the double indirection AND, possibly, a penalty from the dynamic branch prediction algorithm.