News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Tamagotchi. Finite-state machine

Started by Mikl__, December 19, 2015, 01:50:02 PM

Previous topic - Next topic

avcaballero

Maybe not every one can understand the quote from Descartes. What it says is that what I know is very little compared to what I don't know. It's a way to say "I assume my ignorance, may anyone light a bit please?"

Mikl__

Hi, avcaballero!
to whom you direct quote from Descartes? Please decrypt the name of the interlocutor...
"ἓν οἶδα ὅτι οὐδὲν οἶδα"or "scio me nihil scire" or "scio me nescire" these are the words of Socrates

avcaballero

Why do you give the hint, Mikl? I talked to qWord, beginning for assuming my own ignorance and requesting information.

avcaballero

Todo este malentendido es muy gracioso, y sólo por usar una referencia a Descartes  :biggrin:

Contaba un pasaje que había dos sabios hablando.

El primero afirmó levantando el dedo índice que, en efecto, había un sólo Dios.

El segundo al ver tal gesto pensó que sin duda el primer sabio quería sacarle un ojo con el dedo, por lo que contesta levantando el puño que le daría con él en la cabeza

El primero, al verlo, piensa que quiere decirle que no hay sólo uno sino muchos, y vuelve a insistirle levantando el dedo índice que sólo puede haber uno.

Etc.

hutch--

No, its pointed at everyone, write risky code and you might be lucky, write reliable code and you will always be lucky.  :P


qWord

Quote from: avcaballero on December 23, 2015, 08:06:41 PM
Quote from: René DescartesI would give everything I know by the half of what I don't know
Any reference to this info? Maybe only affect adversely to the program running in some cases? Many times don't seem to affect
actual jj's and hutch's posts did exlpain it very well...

MREAL macros - when you need floating point arithmetic while assembling!

avcaballero

Quote from: qWord on December 22, 2015, 11:12:39 PM
- the WndProc must preserve EBX, ESI, EDI and EBP due to the calling convention stdcall.
Hmmmm. It was a misunderstanding because I didn't see Mikl__ code. I already know about different kind of calling conventions, what I understood is that it is necessary to save ebx, esi and edi (ebp is saved automatically becuase you have used local variables) on WndProc, ie, something like this:

proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam
  [...]
endp

Of course you can't assume any value of them inside WindowProc, what I didn't know is that it is necessary to save them there.

Regards

avcaballero

What have may happen (the origin of the misundertunded error)?

It seems that in 64 bits many things go in registers instead of the stack in 32 bits, for example the code attached. The hWnd comes in the rcx register

avcaballero

... the fu..ing attacked file ...  :icon_mrgreen:

TWell

x64/WIN64 use __fastcall only ?
Less things to worry about :t

qWord

For x86-64 the calling convention fastcall is used, which has different register and stack usage than stdcall or cdecl. Lately (probably with VS2015) MS also introduce vectorcall, which is a extension of fastcall.
MREAL macros - when you need floating point arithmetic while assembling!

avcaballero

And it seems that FPU instructions don't work well, instead it is best to use SSE for example. I have tried (many times) FPU till I realized that.

I've read in msdn.Microsoft that "All floating point operations are done using the 16 XMM registers"

qWord

Quote from: avcaballero on December 24, 2015, 02:03:40 AM
And it seems that FPU instructions don't work well, instead it is best to use SSE for example. I have tried (many times) FPU till I realized that.

I've read in msdn.Microsoft that "All floating point operations are done using the 16 XMM registers"
you can use the FPU also for x64 in user mode, but the registers are not part of the calling convention (except the control word). Otheriwse the same rules as for x86-32 applies.

EDIT: confusing statments about the FPU stack removed ...
MREAL macros - when you need floating point arithmetic while assembling!