flat assembler
Message board for the users of flat assembler.
Index
> Windows > A problem with numbers... |
Author |
|
edfed 26 Oct 2007, 02:12
in fasm must write
push dword 3.2 the op code 66 68 CD CC 4C 40 is: push dword (66 68 ) 3.2 (404CCCCD) see the floating point format to understand the encoding! |
|||
26 Oct 2007, 02:12 |
|
vid 26 Oct 2007, 02:19
Quote: in fasm must write that is not true, and not what he was asking about necromancer: FASM accepts floating point value in place of dword, and encodes it as single precision floating point number. "3.2" corresponds to 404CCCCD in single precision format. |
|||
26 Oct 2007, 02:19 |
|
edfed 26 Oct 2007, 02:34
it was what i was saying
push dword ( 66 68 ) push ( 68 ) dword, 32 bits (66 prefix) 3.2 ( 404CCCCD ) single precision format bit 31 = sign bits 0 to 22 = mantissa bits 23 to 30 = exponent |
|||
26 Oct 2007, 02:34 |
|
vid 26 Oct 2007, 02:55
1. why do you mention 66h prefix? that has nothing to do with problem. He didn't understood why FASM accepts floating point at place of dword.
2. you was talking about 16 bit code. In 32bit code you don'y have to use "dword", and no "66" prefix is generated. We are in "WINDOWS" section... why do you mix 66h prefix and 16 bit code here? 3. When describing format of number, you shouldn't forget about normalization, and about format of exponenet. Otherwise this info isn't very useful. |
|||
26 Oct 2007, 02:55 |
|
edfed 26 Oct 2007, 07:06
because for me it was very late
very tired sorry Last edited by edfed on 26 Oct 2007, 07:10; edited 1 time in total |
|||
26 Oct 2007, 07:06 |
|
edfed 26 Oct 2007, 07:07
ok
|
|||
26 Oct 2007, 07:07 |
|
Necromancer13 26 Oct 2007, 14:16
ok... Thanks:)
I think I must read about floating point format... |
|||
26 Oct 2007, 14:16 |
|
vid 26 Oct 2007, 15:32
Necromancer: why? you don't need to understand how are floating point numbers encoded to work with them using FPU
|
|||
26 Oct 2007, 15:32 |
|
edfed 26 Oct 2007, 15:35
a good technician need to know the more possible about his tools and techniques
don't you better use the FPU and SSEx instructions since you know how it is encoded?? |
|||
26 Oct 2007, 15:35 |
|
vid 26 Oct 2007, 15:47
Yeah, understanding how it works is good, but NOT for someone who wants to learn how to use it.
Quote: don't you better use the FPU and SSEx instructions since you know how it is encoded?? i doubt understanding encoding of FP would affect how you write FPU code |
|||
26 Oct 2007, 15:47 |
|
Necromancer13 26 Oct 2007, 15:49
No, I need to know how are they encoded.... I want to know it:(
|
|||
26 Oct 2007, 15:49 |
|
edfed 26 Oct 2007, 16:02
yes, encoding is not important to write good code
but with binary ( integer ) it is very usefull to know the different values of bits to make xor eax,eax you need to know the encoding of dwords as to make fpn manipulation well, you need to know that exists NANs QNANs etc and knowing the fp encoding is good to manipulate the exponents, the sign, the mantissa no? PS: i never code in fp because it's too hard for me but a young beginer can probably use that really good by learning these kind of things! |
|||
26 Oct 2007, 16:02 |
|
vid 26 Oct 2007, 16:09
Quote: as to make fpn manipulation well, you need to know that exists NANs QNANs etc first of all: why would you need to manipulate other way than by using FPU? If you use FPU, you don't need to know encoding. Encoding of floating point numbers is quite complicated. Of course you need to know there is NAN, etc. |
|||
26 Oct 2007, 16:09 |
|
Necromancer13 26 Oct 2007, 17:14
I'll try to find some information about it on the Net...
|
|||
26 Oct 2007, 17:14 |
|
vid 27 Oct 2007, 01:36
Necro: my advice: forget about how are FPs encoded, and learn how to work with them
|
|||
27 Oct 2007, 01:36 |
|
edfed 27 Oct 2007, 01:45
necro: listen to vid, first learn how to use the fpu
vid: maybe one day he will want to know fp encoding? |
|||
27 Oct 2007, 01:45 |
|
Xorpd! 27 Oct 2007, 03:08
Let's see: SSE doesn't have FABS, FCHS, FSCALE, nor FXTRACT instructions so to synthesize them you have to know the format of floating point numbers in XMM registers, whether single or double, and slice and dice them via logical and shift operations.
Knowing IEEE 754 formats is essential for SSE and one of the fundamental pieces of knowledge one should have if one wants to write x87 code competently. Just think about how any introductory book on assembly language has a chapter on binary, octal, 2's complement arithmetic and the like. Introductory treatises on the x87 FPU similarly have a discussion on IEEE 754 formats. Look in 253665.pdf, for example in section 4.8 Real Numbers and Floating-Point Formats. |
|||
27 Oct 2007, 03:08 |
|
Necromancer13 11 Nov 2007, 21:19
I've already understood the encoding:)
|
|||
11 Nov 2007, 21:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.