News:

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

Main Menu

.if macro problem

Started by C3, December 07, 2022, 06:27:05 AM

Previous topic - Next topic

hutch--

Vasily wrote the original win64.inc after borrowing a fair bit of the 32 bit MASM32 windows.inc file. He did a lot of good work and a reasonable amount of it was incorporated into the masm64 SDK.

greenozon

thanks, good to know!
is he still active contributor?

HSE

#17
There is only one .if macro, that is Vasily macro.

Other macros are uppercase: .If and .IF  :biggrin:


(Anyway could be a lot of .if macros, only last one is used by assembler)

Later: Apparently problem is using \masm64\include64\masm64rt.inc.
With \masm32\include64\masm64rt.inc is OK.
I don't found any difference  :rolleyes:

More later: Problem is not vasily.inc.
Equations in Assembly: SmplMath

hutch--

Hector,  :thumbsup:

Some forget that MASM is case sensitive but a combination of the dot prefix and case changes allow you to explore different techniques. Vasily's ".if" notation is reliable and it is the one that most should use.

EesS@70

Greetings!!
I'm coding a message loop for my test program:

      .while ( TRUE )
         .if ( rv( PeekMessage, pMSG, hWnd, 0, 0, PM_REMOVE ) )
            .break .if ( msg.message == WM_QUIT )
            rcall TranslateMessage, pMSG
            rcall DispatchMessage, pMSG
         .else
         ; TODO rendering operations
         .endif
      .endw
 and get this error message when assembling:

 Assembling: msgLoop.asm
msgLoop.asm(21) : error A2006:undefined symbol : reg_ind
 J_ONE_COND(79): Macro Called From
  J_ONE_COND(34): Macro Called From
   J_POLY_COND(9): Macro Called From
    .if(3): Macro Called From
     msgLoop.asm(21): Main Line Code
msgLoop.asm(21) : error A2006:undefined symbol : reg_ind
 J_ONE_COND(86): Macro Called From
  J_ONE_COND(34): Macro Called From
   J_POLY_COND(9): Macro Called From
    .if(3): Macro Called From
     msgLoop.asm(21): Main Line Code
msgLoop.asm(21) : error A2006:undefined symbol : RegIndex
 J_ONE_COND(7): Macro Called From
  J_ONE_COND(4): Macro Called From
   J_POLY_COND(9): Macro Called From
    .if(3): Macro Called From
     msgLoop.asm(21): Main Line Code
msgLoop.asm(21) : error A2006:undefined symbol : RegHigh8Index
 J_ONE_COND(8): Macro Called From
  J_ONE_COND(4): Macro Called From
   J_POLY_COND(9): Macro Called From
    .if(3): Macro Called From
     msgLoop.asm(21): Main Line Code
make: *** [msgLoop.obj] Error 1

I'm using masm64 in Windows 11 & trying to trace the problem, found with that these symbols: RegIndex and RegHigh8Index are undefined neither in \masm64\macros64\vasily.inc nor anywhere else. Anybody found yourself in this situation before??

Thanks for your support here... in advance

C3

Hello,

Maybe you need to break the message loop into smaller pieces for calling. Like

    .while TRUE
        invoke GetMessage,ADDR msg,NULL,0,0
        .break .if (rax==0)
        invoke TranslateAccelerator,hwnd,hAccel,ADDR msg
        .if (rax==0)
            invoke TranslateMessage,ADDR msg
            invoke DispatchMessage,ADDR msg
        .endif
    .endw
    mov rax,msg.wParam

Also show as what do you include from headers?

--
Happy xmas time!

jj2007

Hi EesS@70,

It would dramatically increase your chances to get help if you zipped your complete source and posted it here.

Just a suggestion :cool: