Tags: asm, cant, code, doubt, microsoft, msdn, offtopic, project, section, software, vc6, visual, x86
x86 asm code doubt
I know this is an offtopic topic, But i cant see a section i the forum to post this kind of questions.
I have a vc6 project in which i uses some assemly code. I am not an expert in assembly programming.
The problem is with the DIV instruction. when ever i try to call DIV an integer overflow occurs.
Here is a sample code
mov ebx, 1
mov eax, 5
div ebx //integer overflow error
Please help to solve the issue
Leave a comment...
- 2 Comments
- To divide two 32bit integers you need to zero-extend the eax register into edx. Add a mov edx, 0, and you'll be ready to go.#1; Tue, 02 Oct 2007 22:42:00 GMT
it worked#2; Tue, 02 Oct 2007 22:43:00 GMT