Author Topic: ObjAsm: boring notes  (Read 7834 times)

HSE

  • Member
  • *****
  • Posts: 2491
  • AMD 7-32 / i3 10-64
Re: ObjAsm: boring notes
« Reply #15 on: February 14, 2019, 01:28:02 AM »
Are you sure?

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

jj2007

  • Member
  • *****
  • Posts: 13932
  • Assembly is fun ;-)
    • MasmBasic
Re: ObjAsm: boring notes
« Reply #16 on: February 14, 2019, 01:36:31 AM »
I would suggest that you test the snippet I posted above ;)

HSE

  • Member
  • *****
  • Posts: 2491
  • AMD 7-32 / i3 10-64
Re: ObjAsm: boring notes
« Reply #17 on: February 14, 2019, 02:58:52 AM »
Yes JJ, I saw your snippet before to post.

Included in Demo03:
Code: [Select]
% .elseif [xbx].$Obj(XMenuItem).dType == MENU_TYPE_SEPARATOR
is expanded (in this case) to:
Code: [Select]
.elseif [ebx].OA_XMenuItem.dType == MENU_TYPE_SEPARATOR
and resulting code is:
Code: [Select]
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

  • Member
  • *****
  • Posts: 13932
  • Assembly is fun ;-)
    • MasmBasic
Re: ObjAsm: boring notes
« Reply #18 on: February 14, 2019, 03:32:57 AM »
I see. So in
Code: [Select]
Only 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

  • Member
  • *****
  • Posts: 2491
  • AMD 7-32 / i3 10-64
Re: ObjAsm: boring notes
« Reply #19 on: February 14, 2019, 03:45:21 AM »
 :biggrin:   If say macro, it's a macro:
Code: [Select]
: ————————————————————————————————————————————————
; 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