News:

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

Main Menu

Recent posts

#91
The Campus / Re: ML errors
Last post by NoCforMe - July 12, 2024, 09:34:30 AM
1. As others have pointed out, you have a PROC with no matching ENDP.
2. There's no END directive at the end of the code.
3. You need a message loop in the program.
4. You need a window procedure for your window (which is where your WM_PAINT handler would go).
5. You don't need any of this stuff, which is already in masm32rt.inc:
option    casemap:none
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib

6. Please don't do this (push-push-call):
    push SW_SHOWDEFAULT
    push commandline
    push 0
    push hinst
    call WinMain

Do this instead:
    INVOKE  WinMain, hInst, 0, commandLine, SW_SHOWDEFAULT

Seems like you meant to post more code than this but it somehow got left out ...
#92
The Campus / Re: ML errors
Last post by zedd151 - July 12, 2024, 08:25:09 AM
Is your source code truncated somehow, it seems incomplete???

If not, try...
.386

option    casemap:none

include \masm32\include\masm32rt.inc

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\gdi32.lib

WinMain proto :DWORD,:DWORD,:DWORD,:DWORD

.data
    szAppName db "Die Roller",0
    hinst HINSTANCE ?
    reg_failed db "Registration failed",0
    win_caption db "Die Roller",0
    commandline    LPSTR ?
   


.code

start:
    invoke GetModuleHandle,0
    mov hinst, eax
   
    invoke GetCommandLine
    mov commandline, eax
   
    push SW_SHOWDEFAULT
    push commandline
    push 0
    push hinst
    call WinMain

    invoke ExitProcess, eax
   
WinMain proc hinstance:HINSTANCE, hprevinstance:HINSTANCE, szCmdLine:LPSTR, CmdShow:DWORD
   
    local hwnd:HWND
    local msg:MSG
    local wndclass:WNDCLASSEXA
   
    mov wndclass.cbSize, sizeof wndclass
    mov wndclass.style, CS_HREDRAW or CS_VREDRAW
    mov wndclass.lpfnWndProc, offset WndProc
    mov wndclass.cbClsExtra, 0
    push 0
    pop wndclass.cbWndExtra
    push hinst
    pop wndclass.hInstance
    invoke LoadIcon, NULL, IDI_APPLICATION
    mov wndclass.hIcon, eax
    mov wndclass.hIconSm, eax
    invoke LoadCursor, NULL, IDC_ARROW
    mov wndclass.hCursor, eax
    invoke GetStockObject, WHITE_BRUSH
    mov wndclass.hbrBackground, eax
    mov wndclass.lpszMenuName, 0
    mov wndclass.lpszClassName, offset szAppName
   
    invoke RegisterClassExA, addr wndclass
    ; <---  possibly some missing code here???
    ret
Winmain endp

end start
I see fearless beat me to the draw...

I would think your source code had gotten corrupt somehow, there is no WndProc...
#93
The Campus / Re: ML errors
Last post by fearless - July 12, 2024, 08:23:01 AM
WinMain isn't properly defined as a procedure, as it has no ret and ENDP

WinMain proc hinstance:HINSTANCE, hprevinstance:HINSTANCE, szCmdLine:LPSTR, CmdShow:DWORD

; ... some code

   ret
WinMain endp


Also there is no WndProc procedure either, so no WM_PAINT message to even look at.

And no end statement at the end of the file pointing to the entry, like:

END start
#94
The Campus / ML errors
Last post by tda0626 - July 12, 2024, 08:11:40 AM
I am getting these errors when I try to assemble the code:

attribute roller.asm(63) : error A2088: END directive required at end of file
attribute roller.asm(63) : fatal error A1010: unmatched block nesting : WinMain

Everything looks correct in the code with end statements so not sure why it is doing it since most of it was copied from a previous working program. Source is attached.

Also, please look at my WM_Paint code to see if everything looks ok there too.Thanks!

Tim
#95
Game Development / Re: Game of Life
Last post by NoCforMe - July 12, 2024, 05:16:05 AM
Quote from: zedd151 on July 12, 2024, 05:14:25 AMNever. I had already have had a play with 64 bit coding, and will never do it again. I may look at 64 bit code from others though, from time to time. But I'll never write any programs in 64 bit myself ever again.

Totally unnecessary for this application.

(I haven't yet written one (a 64-bit app) myself.)
#96
Game Development / Re: Game of Life
Last post by zedd151 - July 12, 2024, 05:14:25 AM
Quote from: daydreamer on July 12, 2024, 03:50:03 AMToday on PC,you have much more freedom how to code it in 32 bit or 64 bit mode,many more instruction set to solve it with fpu ,sse2,avx,avx2
Really? How exactly would any of that be helpful here? What about 'backwards compatibility'? Would be more useful for any program to be backwards compatible for those that do not have the latest cpus in their computer, or the latest instructions.  :smiley:
QuoteI don't know if pixelshaders can be used ?,but using point list in DX you get hardware acceleration
Why don't you try it, and post an example?  :biggrin:
QuoteWonder if zedd will try 64 bit version ?,mine might be code in SIMD just for fun
Never. I had already have had a play with 64 bit coding, and will never do it again. I may look at 64 bit code from others though, from time to time, and even help with debugging it.  But I'll never write any programs in 64 bit myself ever again.  :eusa_naughty:
#97
Game Development / Re: Game of Life
Last post by NoCforMe - July 12, 2024, 04:53:45 AM
Quote from: daydreamer on July 12, 2024, 03:50:03 AMToday on PC,you have much more freedom how to code it in 32 bit or 64 bit mode,many more instruction set to solve it with fpu ,sse2,avx,avx2
I don't know if pixelshaders can be used ?,but using point list in DX you get hardware acceleration
Wonder if zedd will try 64 bit version ?,mine might be code in SIMD just for fun

Everything you listed is total overkill for this very simple "game".
#98
Game Development / Re: Game of Life
Last post by daydreamer - July 12, 2024, 03:50:03 AM
Quote from: tenkey on July 11, 2024, 04:36:15 AM
QuoteThanks FORTRANS, that is what I had thought. But also thought that it was possible that NoCforMe was working with a single buffer and processing each pixel sequentially...  :smiley:

It's from a "snapshot". I don't expect gliders and glider guns will work properly if you "update in place". Updating in place is hard to do with pencil and paper.

I did the Gosper gun with pencil and graph paper long before I got a "home computer". (Consider that Life is ca. 1970 and the Altair computer was ca. 1975. The Big 3 of 1977 (USA) were Apple II, Commodore PET, and Radio Shack TRS-80.)
Game of life in basic was published in computer magazine around 1980's ,when display was limited to 320*192 pixels and 8 bit CPU
Today on PC,you have much more freedom how to code it in 32 bit or 64 bit mode,many more instruction set to solve it with fpu ,sse2,avx,avx2
I don't know if pixelshaders can be used ?,but using point list in DX you get hardware acceleration
Wonder if zedd will try 64 bit version ?,mine might be code in SIMD just for fun
#99
Tools & Toys / Re: A Teaching Toy: Sine wave ...
Last post by zedd151 - July 11, 2024, 10:18:57 AM
Sounds okay to me too, stoo.
#100
Tools & Toys / Re: A Teaching Toy: Sine wave ...
Last post by stoo23 - July 11, 2024, 10:15:12 AM
Quote"Utilities" could reasonably include "tools", but not "toys".
Agreed
QuoteThat's why I think "projects" is better.
OK

QuoteAnd I think the division between 32- and 64-bit programs is unnecessary,
Agreed
Quoteunless it's for a category which requires that bitness (like something that only runs under a 64-bit OS)
Exactly  :thumbsup: