store register in pb variable?!

Everything else that doesn't fall into one of the other PB categories.
Kendrel
User
User
Posts: 58
Joined: Fri Apr 25, 2003 7:00 pm

store register in pb variable?!

Post by Kendrel »

i wonder if there is an easy way to store register values (eax etc) into "normal" purebasic variables... i have some complex functions in mind for that, and just wanted to make sure that there isnt an easy way to do this... :)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

Code: Select all

a=0 ;Initialize the value!
MOV a,eax
Debug a
:D

easy to forget that you need to initialize the value.
Kendrel
User
User
Posts: 58
Joined: Fri Apr 25, 2003 7:00 pm

...

Post by Kendrel »

ahhh... thx again... seems you are my hero tonight ;)
thefool
Always Here
Always Here
Posts: 5875
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Post by thefool »

hehe i would suggest you to look more carefully in your helpfile :)
- The used variables or pointers must be declared before to use them in an assembler keyword
but of course its easy to miss. Ow if you want a nice helpfile & !optimization tips! for assembler there is a nice link in the helpfile under the
Inline x86 ASM
topic too!

it have description and syntax for all the commands, jump table & more.!

the optimizing is also nice to look through when one learns a bit more!
Post Reply