Recent Posts

Pages: [1] 2 3 ... 10
1
The Laboratory / Re: Simple floating point macros.
« Last post by hutch-- on Today at 01:46:20 PM »
Now as far as the use of fldz, I can't find a test that shows any problem unless its the 2 bytes that it takes up. Here is the code from a 64 bit MASM test piece that tests with the fldz in or out and I can find no difference apart from the 2 bytes which I don't lose any sleep over.

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

 entry_point proc

    LOCAL fvar1 :REAL8
    LOCAL fvar2 :REAL8
    LOCAL pbuf  :QWORD
    LOCAL buff[32]:BYTE
    LOCAL rslt  :REAL8

    mov pbuf, ptr$(buff)

    fninit
    fldz ; 2 bytes

    mrm fvar1, FLT8(100.0)
    mrm fvar2, FLT8(100.0)

    fld fvar2
    fmul fvar1
    fstp rslt

    invoke fptoa,rslt,pbuf      ; convert rslt to string
    conout pbuf,lf              ; display at console

    waitkey
    .exit

 entry_point endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
2
The Laboratory / Re: Simple floating point macros.
« Last post by hutch-- on Today at 12:30:14 PM »
The reason why I have used "fldz" is due to testing. when I have a simple test piece that I know works correctly, you then place another calculation before it and test if the second calculation gets the same result. You can simply turn this on and off with "fldz" between them.

calculation
  fldz          ; effect the following calculation here by commenting in or out
calculation

If the first calculation is sound, the second does not change, if it does change by commenting fldz in or out, then the first calculation has a stack error.

RE: The finit macro, I am yet to see what the problem is using fldz. If I comment out fldz I get incorrect results.
3
Romper Room / Re: How programming works.....
« Last post by felipe on Today at 12:11:23 PM »
Nice pic Aw.  :icon_cool:
4
The Campus / Re: Student in technikal college
« Last post by Mikl__ on Today at 10:31:45 AM »
Hi, K_F!
Thank you for perfectly matched material! (http://www.allsyllabus.com/)
5
The Laboratory / Re: Other floating point macros.
« Last post by six_L on Today at 10:09:14 AM »
Hi,Rui
I guess the error maybe in FpuFLtoA64.
Do you have the 64 bit ConvertoDF?
6
The Campus / Re: Student in technikal college
« Last post by K_F on Today at 07:46:34 AM »
Are you using a google translater ?
The i-86 does not physically have ports, but has the ability to read/write ports with IN/OUT instructions.

Some reading material..  :t

https://8051-microcontrollers.blogspot.com/2014/12/8086-io-ports-important-points-to-be.html

http://www.allsyllabus.com/aj/note/ECE/8086%20Microprocessor%20&%20Peripherals/unit%205/I%20O%20Interfacing%20Techniques.php

7
The Laboratory / Re: Simple floating point macros.
« Last post by RuiLoureiro on Today at 07:32:03 AM »
Hi HSE !
            There is no problem with you. We may kid with this things. It is fun !
Have a good work  :t
8
Romper Room / Re: How programming works.....
« Last post by Siekmanski on Today at 07:20:13 AM »
Did you just quoted the holy book?

Other historical examples of violent and unjust acts supported by biblical teachings include:
the Inquisition; the Crusades; the burning of witches; religious wars; pogroms against Jews; persecution of homosexuals; forceful conversions of heathens; slavery; beatings of children; brutal treatment of the mentally ill; suppression of scientists; and whippings, mutilations, and violent executions of persons convicted of crimes.
Those acts were a regular part of the Christian world for centuries.

Q: Is religion evil ?

Some Cruelties and Contradictions in the Bible.

The list is so long I had to zip it.
9
The Laboratory / Re: Simple floating point macros.Silpe
« Last post by HSE on Today at 07:15:51 AM »
Hi Rui!

         I guess that HSE is kidding with your idea of fpinit.

Just trying to guess what Hutch is making.

 fldz in fpinit is a problem if you don't need it.

There is two types of macros:

1) Don't need a non-empty st(0) and left an additional non-empty st()

    fpmul MACRO arg1,arg2       ;; multiply arg1 and arg2 together
      fld arg1
      fld arg2
      fmulp
    ENDM

2) Need a non-empty st(0) and don't modify number of non-empty st()

    fpadd MACRO arg             ;; add a number
      fld arg
      faddp
    ENDM

To make two set of macros is a posible solution, mmm

Meanwhile I'm trying to solve some problems calculating adaptation value of vectors for a Genetic Algorithm, really slow with so many debugging messages.    :(
10
The Laboratory / Re: Other floating point macros.
« Last post by RuiLoureiro on Today at 07:05:08 AM »
where is the error?
the result is ok when _LoopFrequency=1,2,3
error:
_LoopFrequency=4, result=1.0   <<<<<<<<<< ???????
_LoopFrequency=5, result=6.0
_LoopFrequency=6, result=1.0   <<<<<<<<<< ???????
_LoopFrequency=7, result=6.0
...
Code: [Select]
_floating_pointAdd Proc uses rbx _LoopFrequency:QWORD
   
   fninit                      ;; clear FPU registers and flags
   fldz                        ;; zero st(0)

   mov   rbx,_LoopFrequency

   fld   _One_real8
   fld   _One_real8
   faddp
@@:
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   fld   _One_real8
   faddp
   
   sub   rbx,1
   jnz   @B
   
   fld   _One_real8
   fsubp

   fstp   result
   
     invoke   RtlZeroMemory,ADDR szBuffer, sizeof szBuffer
   invoke   FpuFLtoA64, ADDR result,40,ADDR szBuffer,SRC1_REAL Or SRC2_DIMM       
   invoke   SetWindowText,hEdithWnd,addr szBuffer
   
   ret
   
_floating_pointAdd Endp
Hi all,
        Did you test this prog ? Is it true that we get

                _LoopFrequency=4, result=1.0   <<<<<<<<<< ???????                                                          _LoopFrequency=5, result=6.0               
             _LoopFrequency=6, result=1.0   <<<<<<<<<< ???????               
              _LoopFrequency=7, result=6.0

I am not able to run it but i wrote the same code for console and the result is nothing of this and the result seems to be correct only looking at it. So, where is the problem ? Do you know ?

Ths file is in reply #1
Thanks  :t

My results (given by my ConverterDF):

 FloatingPointAdd - 1

          6.0              2 + 5 - 1
  FloatingPointAdd - 2
          11.0         2 + 10 -1
  FloatingPointAdd - 3
          16.0             2 + 15 -1
  FloatingPointAdd - 4
          21.0             2 + 20 -1
  FloatingPointAdd - 5
          26.0             2 + 25 -1
  FloatingPointAdd - 6                <<<<<--- _LoopFrequency
          31.0             2 + 30 -1
  FloatingPointAdd - 7
          36.0             2 + 35 -1

          ************** END *****************
Pages: [1] 2 3 ... 10