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

#1
Hi dannycoh,

In your example, you don't need to align the stack with and rsp,-16 :

EXTERN MessageBoxA:PROC

MessageBox TEXTEQU <MessageBoxA>

EXTERN ExitProcess:PROC

.data

text    db 'Hello world', 0
caption db '64-bit test', 0

.code

main PROC

    push    rbp         ; This push
    mov     rbp,rsp     ; aligns
    sub     rsp,20h     ; the stack.
    xor     r9d,r9d
    lea     r8,caption
    lea     rdx,text
    xor     rcx,rcx
    call    MessageBox

    xor     ecx,ecx
    call    ExitProcess

main ENDP

END
#2
Hi
You can use this snippet to get the assembler and version at compile time.
The result is stored in the ASSEMBLER symbol.

ifdef __UASM__
  ASSEMBLER CatStr <U>, %__UASM__
elseifdef __JWASM__
  ASSEMBLER CatStr <J>, %__JWASM__
elseifdef __ASMC__
  ASSEMBLER CatStr <A>, %__ASMC__
else
  ASSEMBLER CatStr <M>, @Version
endif

Adapt this snippet to the assemblers you use.

Regards, Biterider
#3
I want to detect during assembler time which assembler is being used: MASM or UASM.
I need it to use UASM advanced capabilities but still have a fallback to MASM with reduced capabilities.
I know about the compatibility macros and command line options, but that's not what I want.
Here is what was suggested to me by various AI bots:
; x64 Assembly program to detect MASM or UASM.

.DATA
    msgMasm BYTE 'MASM', 0
    msgUasm BYTE 'UASM', 0
    ChessSolver BYTE 'ChessSolver', 0

.CODE

    ; Entry point
    MyMainProc PROC
        ; Checks for the assembler using defined macros.
        ; Checks for MASM.
        IFDEF MASM
            lea rdx, msgMasm
        ; Checks for UASM.
        ELSE
            lea rdx, msgUasm
        ENDIF
        ; Calls MessageBoxA to display the message.
        push rbp
        mov rbp, rsp
        sub rsp, 4 * 8; Allocates space for 4 arguments.
        and rsp, -16; Aligns the stack to 16 bytes.
        mov rcx, 0 ; hWnd = NULL.
        lea r8, ChessSolver ; lpCaption.
        mov r9, 0
        EXTERNDEF __imp_MessageBoxA:QWORD
        call __imp_MessageBoxA

        ; Exits the process.
        xor rcx, rcx ; Sets return value to 0.
        EXTERNDEF __imp_ExitProcess:QWORD
        call __imp_ExitProcess
    MyMainProc ENDP

END
#4
The Laboratory / Re: different compares clock c...
Last post by NoCforMe - February 13, 2025, 12:06:45 PM
We look forward to your test results, hopefully soon.
#5
The Laboratory / Re: different compares clock c...
Last post by zedd151 - February 13, 2025, 09:32:36 AM
Quote from: daydreamer on February 13, 2025, 07:43:34 AMWhat's happened to this forum ?,nobody wants to test run code anymore ? :(
It's usually the OP that supplies the testing method. This will ensure that all testers will use the same testbed (I.e., testing methods), for better comparison between processors where the test is being conducted, and even to test for any differences between OS's etc. that are testing the same function or algorithm.
#6
The Laboratory / Re: different compares clock c...
Last post by sinsi - February 13, 2025, 09:08:55 AM
Quote from: daydreamer on February 13, 2025, 07:43:34 AMWhat's happened to this forum ?,nobody wants to test run code anymore ? :(
I have a comparison that might not been tested yet :
A loop with many scalar compares with conditional jumps vs packed compares ???

The skeleton code I wrote earlier is all you need, just add the code you want to test.
#7
The Laboratory / Re: different compares clock c...
Last post by NoCforMe - February 13, 2025, 08:03:24 AM
Well, go ahead and test it then.
You have access to all the tools you need, including macros if you want to go that route.
Report back to us with your results.
#8
The Laboratory / Re: different compares clock c...
Last post by daydreamer - February 13, 2025, 07:43:34 AM
What's happened to this forum ?,nobody wants to test run code anymore ? :(
I have a comparison that might not been tested yet :
A loop with many scalar compares with conditional jumps vs packed compares ???
#9
UASM Assembler Development / Re: Website is down
Last post by lucho - February 12, 2025, 06:48:18 PM
I don't know why it's down. As for the "403 forbidden" error, have you tried to access it via an anonymizer?
#10
UASM Assembler Development / Re: Website is down
Last post by dannycoh - February 12, 2025, 03:43:08 PM
Thanks lucho
I downloaded everything from the way back machine.
The last link you provided gives me the same 403 forbidden error message.
Why is the main website down?
Is it for maintenance?
Is it down for good?