Recent Posts

Pages: [1] 2 3 ... 10
1
The Laboratory / Re: Simple floating point macros.
« Last post by RuiLoureiro on Today at 04:01:58 AM »
 :biggrin: 
Hi Hutch
    seems OK, all things are correct and FPU is cleaned at the end and at the end of each step (or case)  :eusa_clap:
2
The Workshop / Multiply matrix MxM by KxK real4 any size
« Last post by RuiLoureiro on Today at 03:44:39 AM »
Hi all,
       Here we have 1 version to multiply any square matrix MxM by
       any square matrix KxK (M=K) using SSE instructions and 1 that uses FPU.

       With this work we may solve all cases as we want:

            invoke      MultiplyMxN_NxK_v6SSE, pMatX, pMatY, pMatXY     ; general case
            invoke      MultiplyMxM_MxM_v1SSE, pMatX, pMatXY              ; particular case Y=X
            invoke      MultiplyMxM_KxK_v1SSE, pMatX, pMatY, pMatXY     ; particular case Y<>X

note: each matrix used has a dimension behind the address and it seems to be the best
         way to test the procedures. If you want modify the procedure and pass the dimensions
         of each matrix. Note also that each procedure doesnt call any other procedure
         inside, so the code is large or very large especially MultiplyMxN_NxK_v6SSE

Quote
      VERSION 1:
                PROCEDURE:  MultiplyMxM_KxK_v1SSE
               
                FILE:           multiplySSEMxM_KxK_v1.inc
               
                MACROS:     multiplyMxN_KxK_v2A.mac
                                  multiplyMxN_KxK_v2B.mac
                                  basicmulMxN_KxK_v1.mac

      VERSION FPU:
                PROCEDURE:  MultiplyMxM_KxK_v1FPU
               
                FILE:              multiplyFPUMxM_KxK_v1.inc


    DOCUMENTATION:          TEXT_ABOUT_MULTIPLY_SSE_REAL4.txt

    MATRIX DEFINITION:      We must define any matrixX as this

                            ALIGN 16
                            dd ?
                            dd ?
                            dd M   ; <<--- number of columns
                            dd M   ; <<--- number of lines
                   matrixX  dd (M*M) dup (?)         

                            If we want to alloc memory, see the file AllocMemory.inc

    VERIFY SSE PROCEDURES:  Use multiplyMxM_KxK_v1.exe/asm

    Please test it in your CPU (i5/i7/AMD).
    Use ExecuteTestmultiplyMxM_KxK_SSEv1.bat and post the file ResultsmultiplyMxM_KxK_v1.txt.

Good luck
RuiLoureiro
3
The Laboratory / Re: Simple floating point macros.
« Last post by hutch-- on Today at 03:42:18 AM »
This is the form for sequential additions. 1 arg macro, manual and 2 arg macro. The versions with fldz is how I would do loop code, for a single addition, the 2 argument macro version has an extra load but 1 less add.

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

    include \masm32\include64\masm64rt.inc

    fpinit MACRO                ;; initialise the x87 co-processor
      fninit
      fldz
    ENDM

    fpadd MACRO arg1, arg2      ;; add a number
      fld arg1
        IFNB <arg2>
          fld arg2
        ENDIF
      faddp
    ENDM

    .code

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

 entry_point proc

    LOCAL buff[32]:BYTE
    LOCAL pbuf  :QWORD
    LOCAL addval:QWORD ; REAL8  ; either will do as a LOCAL
    LOCAL rslt  :QWORD ; REAL8

    mrm addval, FLT8(111.111)   ; get a pseudo immediate
    mov pbuf, ptr$(buff)        ; get buffer pointer

  ; -----------------------------
  ; start macro code
  ; -----------------------------
    fpinit

    fpadd addval                ; sequential additions
    fpadd addval
    fpadd addval
    fpadd addval

    fstp rslt                   ; store result & pop

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

  ; -----------------------------
  ; identical manual mnemonic code
  ; -----------------------------
    fldz                        ; with FLDZ

    fld addval
    faddp
    fld addval
    faddp
    fld addval
    faddp
    fld addval
    faddp

    fstp rslt                   ; store result & pop

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

  ; -----------------------------
  ; alternate macro code - no fldz
  ; -----------------------------
    fpadd addval, addval        ; sequential additions
    fpadd addval
    fpadd addval

    fstp rslt                   ; pop stack

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

    waitkey
    .exit

 entry_point endp

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

    end
4
Romper Room / Re: How programming works.....
« Last post by mineiro on Today at 02:25:34 AM »
Can you give me 1 example of scientific contribution to society by religion over say, the last 300 years?
Cmon man, you're talking about science; science and religion can walk together.
Recent examples of war have shown us how science has evolved, and I do not mean science badly.
I'm tired.
5
Romper Room / Re: How programming works.....
« Last post by caballero on Today at 01:01:12 AM »
The more I read, the more sense it takes for me that European atheism is simply the antithesis of Christianity. That is, it is not strictly speaking atheism, so it is not a religion either.

That the current western society, with its lights and shadows is a consequence of Christianity, I think it is evident. Even atheism is also, by what is seen.

It is evident that Christianity committed and commits its atrocities, but it seems that the allegations against are so furious and untimely that they reveal a deep resentment against. But why do you always forget things that are already happening in Europe? I do not understand much of what she says, but I think the content is rough, to say the least. Worse yet, noone can talk about it.

Is there really an unconventional war between atheism and Christianity in Europe to which traditional rival religions have been invited to contend in an attempt to increase their potential?

If we restrict the atrocities of the Crusades to Christianity, I think we deliberately ignore half of the story.



Regarding the Spanish Inquisition, I must confess that I come from my prejudice that I do not believe that it was especially bad compared to the rest of Europe. I transcribe and note some paragraphs from the historian del Junco:

Quote from: del Junco
if in Spain the Inquisition was founded in 1478 in France it existed since 1184.

Quote from: del Junco
In the period from 1559 to 1566 one hundred people were executed by the Inquisition in Spain, in France two hundred and in England three hundred, while historians such as Henry Charles Lea argued that the Spanish prisons of the Inquisition were the least harsh in Europe between the 15th century and XVII, has given as examples Del Junco.

Quote from: del Junco
On the persistence of this negative image for Spain over the centuries, Del Junco has pointed out that "Holland, England and France made a skilful use of the printing press against Spain, which did not know how to defend themselves", issuing "invented" engravings in which It showed torture priests who have successfully circulated until the nineteenth century, as part of the Black Legend encouraged against Spain when it was the world's leading power, since the sixteenth century.

https://www.abc.es/historia/abci-falsa-leyenda-negra-inquisicion-espanola-solo-18-por-ciento-quemado-hoguera-201512040335_noticia.html
6
The Laboratory / Re: Other floating point macros.
« Last post by RuiLoureiro on Today at 12:54:40 AM »

 :biggrin: Hi six_L
             You are right, we get that wrong results you got so the problem is in the converter i guess also because you doesnt do anything else and the code is very simple.
See you
 :t
7
Romper Room / Re: How programming works.....
« Last post by Siekmanski on August 16, 2018, 11:40:25 PM »
The western society we know today has only reached this level because of the Catholic church.

I disagree with you, we could by at a much higher level in society without religious indoctrination.

Knowledge of Greek science deteriorated in Western Europe during the Middle Ages, caused by Christianity.
We lost at least 1000 years of scientific progression. ( Damn, I could be on a spaceship exploring the Universe by now.  :biggrin:)
We slowly picked up science again in the last 300 years. (in the fear not to be killed by religious fanatics.)

I'll keep it by 1 example,

How is it possible we live twice as long as 150 years ago?
Thanks to natural sciences (e.g. biology, chemistry, physics) and not to Christianity.

Can you give me 1 example of scientific contribution to society by religion over say, the last 300 years?
8
16 bit DOS Programming / Re: an old try to generate texturemixedwith terrain tile
« Last post by daydreamer on August 16, 2018, 09:25:51 PM »
star made with code
9
The Laboratory / Re: Simple floating point macros.
« Last post by jj2007 on August 16, 2018, 06:40:54 PM »
Plain Masm32:
Code: [Select]
include \masm32\include\masm32rt.inc

_1byX macro num
  fld1
  if type(num) eq DWORD
fidiv num
  else
fdiv num
  endif
endm

.data
x100 dd 100
result REAL8 ?

.code
start:

  _1byX FP8(0.25)
  fstp result
  printf("1/0.25=%f\n", result)

  _1byX x100
  fstp result
  printf("1/100=%f\n", result)

  exit

end start
(if your IDE doesn't know that the console must be kept open to see the result, insert an inkey before the exit)
10
The Orphanage / Re: Tomorrow is my birthday
« Last post by daydreamer on August 16, 2018, 06:29:24 PM »
In the beginning the pet bear didn't want to enter the room, because he was embarrassed by the guests who played by balalaika and drank vodka. When the bear cub got used to us a little and began to beg the guests for a treat him. When the bear was brought to the table to extinguish the candles on the cake, instead of blowing out the candles, he sucked in air together with the candles and cream of the cake. It was very fun for us and the bear cub too.
:lol:
Pages: [1] 2 3 ... 10