News:

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

Main Menu

ML errors

Started by tda0626, July 12, 2024, 08:11:40 AM

Previous topic - Next topic

zedd151

Quote from: NoCforMe on July 14, 2024, 04:03:06 AMLooks OK.
You can get rid of the following:
Was only getting the random number generation out of WM_PAINT. Will leave the other fixes to tda0626.
:azn:

daydreamer

Could as well show workaround for one ml error i found out in my program
Its about to compare 4 bytes with one single .if eax==01010101h

.data
Hand1 db 0,0,0,0,0
lea esi,[hand1+ebx*2] ;workaround below error
;mov eax,[hand1+ebx*2];error A2070
mov eax,[esi]
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

NoCforMe

#17
Well, if this threw an error:
mov eax,[hand1+ebx*2];error A2070

then how about
mov eax,DWORD PTR [hand1+ebx*2]

That should fix it.
Assembly language programming should be fun. That's why I do it.

jj2007

David's solution is correct.

.data
Hand1 db 0,0,0,0,0
.code
mov eax, dword ptr [hand1+ebx*2]

What happens here is that you try to a BYTE variable into a DWORD size register. That is technically possible but Masm throws an error, thus warning you that you are trying to do unorthodox things.

Now, if you are convinced that you really want to do that, you can override the error using dword ptr [whatever].

TimoVJL

Quote from: NoCforMe on July 14, 2024, 04:03:06 AMLooks OK.
You can get rid of the following:

; Totally unnecessary: CreateWindowEx() will take care of this:
    invoke ShowWindow, hwnd, SW_SHOWNORMAL
    invoke UpdateWindow, hwnd

; but add this style when you create the window:
    WS_OVERLAPPEDWINDOW or WS_VISIBLE,\

Without startup code ShowWindow isn't important.

Example of startup code in C
    GetStartupInfo(&si);
    ExitProcess(WinMain(GetModuleHandle(NULL), NULL, szCmdLine,
        (si.dwFlags & STARTF_USESHOWWINDOW) ? si.wShowWindow : SW_SHOWDEFAULT));


May the source be with you

daydreamer

Thanks david
.data
Ace2 db 0 ;copy of ace here
Twos db 0,0,0,0,0,0,0,0,0,0,0,0
Ace db 0
.code
...previous code checks statistics on number of twos to aces and write to twos db to aces db
Mov ebx,0
M2m ace2,ace
L1:
Mov eax, dword ptr [ace2+ebx]
Mov dl,[ace2+5+ebx]
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

jj2007


zedd151

Tim, did you mean to add something? All I see in your post is an oddly  truncated quote from myself, and nothing from you.  :tongue:
:azn:

daydreamer

Quote from: jj2007 on July 15, 2024, 05:36:20 PM
Quote from: daydreamer on July 15, 2024, 02:23:16 AMM2m ace2,ace

No error? Which macro is that?
sorry forgot m2m memory is made out of push/pop,means it doesnt work with bytes
 
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

tda0626

Quote from: zedd151 on July 14, 2024, 01:30:27 AMFirst, I put the rand routines in WM_CREATE for the initial random number.
Then I also put it in WM_CHAR using the space bar to initiate next random number(s)... all of that plus commented out the random routine from WM_PAINT.

I did not change the positioning of the text, I'll leave it for you.  :biggrin:

There are most likely other ways to do the same. I just offer one example here.  :tongue:  It is not perfect, but should give you some ideas.

Sorry for the long delay, Tim. Real life interferes and I had forgotten about this til just now.
Btw, no ml errors here nor any Defender issues (I'm running Windows 7).  :cool:

This gives me some good ideas. I appreciate this. Thank you.


Tim

tda0626

Quote from: zedd151 on July 16, 2024, 06:53:36 AMTim, did you mean to add something? All I see in your post is an oddly  truncated quote from myself, and nothing from you.  :tongue:

Not sure how that happened but asked for deletion.

NoCforMe

Quote from: tda0626 on July 16, 2024, 10:18:42 PMNot sure how that happened but asked for deletion.
In the future, you can simply edit your posts, at any time after you make them.
Assembly language programming should be fun. That's why I do it.

stoo23

Quote
Quote from: tda0626 on July 16, 2024, 10:18:42 PMNot sure how that happened but asked for deletion.
In the future, you can simply edit your posts, at any time after you make them.
Yes, in fact I'd have thought you may already have been aware of that ??  :smiley:

From the choices (which should be visible in the Lower Right of you Post, (shown below), you can choose either "Quick Edit" or "More", which will allow you to choose 'Modify' to give you Full access to the Post Editor available when you initially wrote your post  :smiley:

You cannot view this attachment.

NoCforMe

Assembly language programming should be fun. That's why I do it.

stoo23

Beat me to it,  :smiley: ... I was on the phone. ... Thanks  :thumbsup: