News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

LARGE_INTEGER Divide

Started by msmith, January 21, 2006, 04:15:14 AM

Previous topic - Next topic

raymond

Mike,

Based on your past experience, you certainly have noticed that each programming language has its own syntax. MASM is no different. However, with your great background, you should be able to learn that MASM syntax much quicker than most people.

The Intel manuals are a great source of information. It's simply a matter of getting your hands on those manuals and "digging" into them. You have thus learned that the imul instruction has several variants depending on the number of operands used. It does say that the one-operand form puts the result in the 64-bit EDX:EAX register pair when a 32-bit operand is used. With the two- and three-operand forms, the product is then stored in the destination operand which would be only 32 bits long. Sometimes, it may be easier to write short snippets and check with a debugger to visualize the results of the instruction(s).

If you intend to use the Windows APIs, you should also get the Win32 Programmer's Reference.

If you ever need later to perform high precision math operations using floating point instructions, you could have a look at my tutorial
http://www.ray.masmcode.com/index.html#fputut

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

msmith

Hi Raymond,

I'm not complaining about syntax of MASM at all, but rather the poor explanations provided in the Intel docs. It was with your help that I was able to take care of things.

I intend to study your floating point article thoroughly, and at first glance it appears to be very well written.

Regards,

Mike

farrier

msmith,

In the Example8 folder of the MASM32 folder there is a folder named jacts.  This contains the second or third program I wrote in asm.  I still use a variant of it everyday to time service phone calls for billing.

At the bottom of the jacts.asm file is a proc named recalc that calculates msec or sec based on the difference between two FileTimes.  It uses the FPU just cause I wanted to.  I never tried to time the routine to see is cpu div are much slower or faster.

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

msmith

Hi  farrier

I am using my timediff and timeadd functions for purposes similar to yours, for example to see how long a production run lasted based on starting and ending times, and also, to record the number of seconds since Jan 1, 2002 as a means of getting short form of time to save the time of each machine event. I thought I would need to use quad words in this process but Raymond showed me that I don't. It all works now and I thank all of you for your help.