News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

A New Testbed for MASM32 Forum

Started by frktons, September 21, 2010, 05:25:26 PM

Previous topic - Next topic

Antariy

Quote from: jj2007 on November 09, 2010, 10:48:32 PM
Works fine on my machine, Win XP SP2 with Celeron M.

Which version of ML did you use?

Antariy

Frank, the culprit is:

you are entangle the DWORDs and WORDs:

    INVOKE DisplayAt, WORD PTR AlgoColDesc, WORD PTR AlgoRow, ADDR AlgoDesc,
                      DWORD PTR AlgoDescSize


Fix this.

Addeded later:

I found 24 times of that mistypeing. After fixing them - results is showed. But color of CPU string - is not :P
Needed to much deeper search.

ML 10 push them as DWORD - other MLs - as WORD.

frktons

Quote from: Antariy on November 09, 2010, 10:58:05 PM
Frank, the culprit is:

you are entangle the DWORDs and WORDs:

    INVOKE DisplayAt, WORD PTR AlgoColDesc, WORD PTR AlgoRow, ADDR AlgoDesc,
                      DWORD PTR AlgoDescSize


Fix this.


Did you try it? Does it work? Why it is working with ML 10 if it is an error?

Frank
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 09, 2010, 11:02:44 PM
Quote from: Antariy on November 09, 2010, 10:58:05 PM
Frank, the culprit is:

you are entangle the DWORDs and WORDs:

    INVOKE DisplayAt, WORD PTR AlgoColDesc, WORD PTR AlgoRow, ADDR AlgoDesc,
                      DWORD PTR AlgoDescSize


Fix this.


Did you try it? Does it work? Why it is working with ML 10 if it is an error?

Re-read previous post carefully :P

frktons

Quote from: Antariy on November 09, 2010, 11:06:33 PM
Re-read previous post carefully :P

Again:
QuoteDid you try it? Does it work? Why is it working with ML 10 if it is an error?

I see the DWORD and WORD are mixed, but you did not answer my questions.

Frank
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Quote from: frktons on November 09, 2010, 11:09:19 PM
Quote from: Antariy on November 09, 2010, 11:06:33 PM
Re-read previous post carefully :P
I see the DWORD and WORD are mixed, but you did not answer my questions.

That is general rule: you should use machine-word sized params at least. Even if you use WORD - proc will assume that DWORD is placed into stack, and will free 4 bytes, not 2.
You should not use constructions like "push word ptr [xxx]" "invoke XXX, word ptr [xxx]" etc.

Stall stand misaligned with any further surprices...

QuoteDid you try it?

Of course, I test it.

Yes, I tried it, it works. If you re-read previous-previous :) post, then you will see, that founded 24 times of this stuff, after fixing to DWORD - tests runs and timings showed. But color of the outputted string is not changed.

Try to use DWORDs instead of BYTEs and WORDs params/args.

QuoteWhy is it working with ML 10 if it is an error?

ML 10 push them as DWORD - other MLs - as WORD.




Alex

jj2007

Quote from: Antariy on November 09, 2010, 10:54:17 PM
Quote from: jj2007 on November 09, 2010, 10:48:32 PM
Works fine on my machine, Win XP SP2 with Celeron M.

Which version of ML did you use?


ML 6.15 and 9.0 assemble, Jwasm throws 6*Error A2071: Label is expected
ML 6.15 shows an empty display, 9.0 fills it with timings

Antariy

Quote from: jj2007 on November 09, 2010, 11:19:47 PM
ML 6.15 and 9.0 assemble, Jwasm throws 6*Error A2071: Label is expected
ML 6.15 shows an empty display, 9.0 fills it with timings

So, Frank can see, what I not joked or tried to confuse him. I just tried to help...

Jochen, ML 9.0. is change colors of the strings (OS, CPU etc) to yellow, too?

frktons

Quote from: Antariy on November 09, 2010, 11:14:40 PM
That is general rule: you should use machine-word sized params at least. Even if you use WORD - proc will assume that DWORD is placed into stack, and will free 4 bytes, not 2.
You should not use constructions like "push word ptr [xxx]" "invoke XXX, word ptr [xxx]" etc.

Stall stand misaligned with any further surprices...

QuoteDid you try it?

Of course, I test it.

Yes, I tried it, it works. If you re-read previous-previous :) post, then you will see, that founded 24 times of this stuff, after fixing to DWORD - tests runs and timings showed. But color of the outputted string is not changed.

Try to use DWORDs instead of BYTEs and WORDs params/args.

QuoteWhy is it working with ML 10 if it is an error?

ML 10 push them as DWORD - other MLs - as WORD.

Alex

As I guessed you found the problem and the solution yourself.  :P

Well, I'll change all the WORD into DWORD  :U so people using previous versions
can compile it without errors.

Frank
Mind is like a parachute. You know what to do in order to use it :-)

frktons

Fixed version.  :bg

Mind is like a parachute. You know what to do in order to use it :-)

Antariy


   LOCAL sysinfo:SYSTEM_INFO
   LOCAL szBuild[N16]:BYTE <----- THIS
   LOCAL szBuf[128]:BYTE


size of szBuild buffer should be enlarged to 24 bytes. That is not case, but for future.

Antariy

The new one is print timings, but still don't change color of the text - all text is printed as white.

frktons

Quote from: Antariy on November 09, 2010, 11:30:14 PM

   LOCAL sysinfo:SYSTEM_INFO
   LOCAL szBuild[N16]:BYTE <----- THIS
   LOCAL szBuf[128]:BYTE


size of szBuild buffer should be enlarged to 24 bytes. That is not case, but for future.


Well, that is not code that I have written, it should be inside some MACRO I use probably.

Quote from: Antariy on November 09, 2010, 11:32:57 PM
The new one is print timings, but still don't change color of the text - all text is printed as white.

The routine for changing the colors is quite simple, maybe it uses the same BYTE or WORD stuff.
Yes:

SetColorTo     PROTO ForeGroundColor:BYTE, BackGroundColor:BYTE



Frank
Mind is like a parachute. You know what to do in order to use it :-)

Antariy

Frank, change these variables to:

    ChosenColor   dd   ?
    ActualColor   dd   ?


Antariy

And make SetColorTo that:


SetColorTo PROC Fore:BYTE, Back:BYTE

    xor  eax, eax

    mov  al, Back
    shl  al, 4
    add  al, Fore
    mov  ChosenColor, eax

    invoke SetConsoleTextAttribute, wHnd, ChosenColor

    ret

SetColorTo ENDP


After that (previous post and this post changements) all works fine with ML 8.0 and 6.15

And try to use all variables as DWORDs at least. There is not economy in resources, especially under Windows, but many drawbacks if you use not DWORDs...



Alex