News:

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

Main Menu

ObjAsm: boring notes

Started by HSE, February 09, 2019, 02:03:27 AM

Previous topic - Next topic

HSE

Quote from: jj2007 on February 14, 2019, 01:06:12 AM
Are you sure?

Yes, what is expanded is a variable name, not a function. :t
Equations in Assembly: SmplMath

jj2007

I would suggest that you test the snippet I posted above ;)

HSE

Yes JJ, I saw your snippet before to post.

Included in Demo03:
% .elseif [xbx].$Obj(XMenuItem).dType == MENU_TYPE_SEPARATOR

is expanded (in this case) to:
.elseif [ebx].OA_XMenuItem.dType == MENU_TYPE_SEPARATOR

and resulting code is:
CPU Disasm
Address   Hex dump          Command
004033CE  |> \837B 18 05    |CMP DWORD PTR DS:[EBX+18],5
004033D2  |. /0F85 82000000 |JNE 0040345A  ; almost forget this

Equations in Assembly: SmplMath

jj2007

I see. So inOnly problem I see using AsmC are 2 or 3 ".elseif macro something" that I changed to ".elseif OA_something" the OA_something is not a macro but just an equate. That is indeed different from macro expansion :t

HSE

 :biggrin:   If say macro, it's a macro:: ————————————————————————————————————————————————
; Macro:      $Obj
; Purpose:    Return the mangled object name.
; Arguments:  Arg1: Object Expression: [Namespace:]ObjectName.

$Obj macro ObjExpr:req
  PreParseExpr ObjExpr
  if $ParseObjExpr(ObjExpr) eq FALSE
    .err <$Obj - syntax error: ObjExpr>
    exitm <>
  else
    %exitm <??ObjExpr>
  endif
endm

and if say textequ or equ .. mmmh
Equations in Assembly: SmplMath