Divide number in Compiler

14 views
Skip to first unread message

Ryan Gonzalez

unread,
Dec 8, 2013, 8:27:06 PM12/8/13
to asmji...@googlegroups.com
In the docs, it says that, to divide to numbers in compiler, one of them must be stored in a register. But I can't access a specific register? How does it work?

Or, to be precise...HOW DO YOU DIVIDE TWO NUMBERS???

--
Ryan
When your hammer is C++, everything begins to look like a thumb.

Petr Kobalíček

unread,
Dec 9, 2013, 4:42:37 AM12/9/13
to asmjit-dev
Hi Ryan,

If you are using compiler it will allocate specific registers automatically.

The code would look like:

GpVar a;
GpVar b;
GpVar r;

...

// R = A % B
// A = A / B
compiler.div(r, a, b);

Hope that helps.

Best,
Petr


--
 
---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Ryan Gonzalez

unread,
Dec 9, 2013, 5:01:51 PM12/9/13
to asmji...@googlegroups.com
Ohhh...thanks a lot!
Reply all
Reply to author
Forward
0 new messages