imabeast
December 11th, 2006, 02:50 AM
Hi, first time poster, Im trying to learn assembly using the
intels x86 processor. Being new to all the instructions, im having a problem coding up this question in the book. Heres the question, i'll leave where im at, at the bottom.
Write a routine to do a fixed point division. The fixed point values are 32 bits wide and have an imaginary decimal point as such 16.16. The numerator will
be passed in EAX, and the denominator will be passed on the stack. The return
value must be placed in EAX. All other registers must be preserved.
Ok so i know that I need to store the low 16 bits into one register, such as the EAX and the high 16 into another such as the EDX. I also must shift before i divide. When i divide, if im reading this right, EAX should contain the value im looking for. Heres the problem, I have no idea how to code any of this. Can anyone help me out? Thanks.
intels x86 processor. Being new to all the instructions, im having a problem coding up this question in the book. Heres the question, i'll leave where im at, at the bottom.
Write a routine to do a fixed point division. The fixed point values are 32 bits wide and have an imaginary decimal point as such 16.16. The numerator will
be passed in EAX, and the denominator will be passed on the stack. The return
value must be placed in EAX. All other registers must be preserved.
Ok so i know that I need to store the low 16 bits into one register, such as the EAX and the high 16 into another such as the EDX. I also must shift before i divide. When i divide, if im reading this right, EAX should contain the value im looking for. Heres the problem, I have no idea how to code any of this. Can anyone help me out? Thanks.