hey everyone, im in my first semester of assembly, i had a quick quesiton, im working with the coproccessor now for the first time and i would like to know if The coprocessor stack holds all values as 80-bit reals then what is the largest integer data type that can be returned from the coprocessor to a memory variable and what is the largest real number data type that can be returned from the coprocessor to a memory variable? im working in visual studios and im stuck at the moment

thanks a ton

        fld     [z]
        ...
z       dt ? ;10 bytes variable

@stompjkrz400 - This is not as simple a question as you might at first think, at least not if you approach it without having first mastered the ieee storage format used by the co-processor. I do think that it is safe to assume that all numbers are handled as 80-bit reals internal to the coprocessor. The other formats are simply for memory storage convenience, nothing else. Now, I'm not going to answer your question outright, but I will tell you how to find out and perhaps give a hint or 2.

If you are serious about assembly, then you should try to get a copy of the Intel programmer's reference manual, even if it's an older one (for the 386 for eample) which will not have info on the newer instructions, but you will probably never need these and the 64-bit forms are essentially the same anyway. You still need the manual for your assembler, but having the technical data straight from Intel is really useful sometimes. My favorite example of this is the claim in the MS MASM book that you cannot have large segments in real mode. This is plain and simple a bald faced lie. Reading the Intel literature will tell you how to have full, direct pointer access to ALL memory on a multi-megabyte machine in real mode. I know this because I always ran my DOS machines in a 32 MB flat architecture using this technique: Change to protected mode; change segment limits to 32 bits; return to real mode WITHOUT resetting the segment limits; done. The palaver in the MS manual that implies that the segment limits will reset to 16 bits when you return to real mode is simply horse do-do (you do have to sidestep some MS code that tries to reset them for you, but that's not too hard).

Now, back to your problem. 1) Learn the storage format. What is the exponent, how many bits is it? What is the mantissa and how many bits does it have? Where are the sign bits? What is the value of the most significant bit in the mantissa (hint ;)- it's 1/2). What are the values of the rest of the bits? 2) What does Normalization mean? What I can tell you now is that it simply means shifting the mantissa over (to the left) until the most significant bit is "1" while simultaneously increasing the exponent by 1 for each shift. You need to really understant what this means in exact detail. 3)Will the Exponent hold a large enough INTEGER value to accomodate as many as 78 shifts? The answer is obviously yes, but there are some possible cases where this may not be true. Part of your assignment is to define these. 4)Consider the case where the Mantissa is all ones, except for the sign bit, and the Exponent is zero. Can you explain why the value of this number is just shy of 1.0000? 5) Finally consider what results if you increase the mantissa until the binary decimal point is just to the right of the least significant bit in the mantissa. What is the value of the number now and how is this related to "DeNormalization"? Hints: Adding one to the Exponent shifts the Binary decimal point to the Right exactly 1 bit. The LSB will have a value of exactly "1" after this process.

If you've gotten this far, you now know the value of the largest integer the coprocessor can hold. Once you know this, you can extend this knowledge using standard storage formats of the coprocessor to answer the question about the largest integer in memory. Follow similar logic to answer your question about the largest real, only use the maximum possible Exponent and a normalized Mantissa. For negative numbers and very small reals, use the same logic, but fold in the effect of the sign bits. There will be no quiz - you will have to test yourself on this one. Good luck.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.