flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Call interface ? |
Author |
|
Roman 22 Jul 2020, 15:30
I try this
comcall cb1,cb1_tp\#,AddRef,1 But get error invalid address call[eax+coi#.AddRef] |
|||
22 Jul 2020, 15:30 |
|
revolution 22 Jul 2020, 22:44
Roman wrote:
comcall cb1,cb1_tp.AddRef,1 |
|||
22 Jul 2020, 22:44 |
|
Roman 23 Jul 2020, 05:12
I try this:
comcall cb1,cb1_tp.AddRef,1 But get error: undefined symbol call[eax+cb1_tp.AddRef.1] |
|||
23 Jul 2020, 05:12 |
|
revolution 23 Jul 2020, 05:37
You need a comma. The dot makes it part of the same argument.
|
|||
23 Jul 2020, 05:37 |
|
Roman 23 Jul 2020, 05:48
Quote: You need a comma. The dot makes it part of the same argument. In comcall ? I don't understand what you mean. Last edited by Roman on 23 Jul 2020, 05:51; edited 1 time in total |
|||
23 Jul 2020, 05:48 |
|
revolution 23 Jul 2020, 05:51
Oh, I didn't see you EQU in there. Just remove the EQU part. Or try replacing it with FIX.
|
|||
23 Jul 2020, 05:51 |
|
Roman 23 Jul 2020, 05:54
How use FIX ?
Code: macro VarCom chN,chTp { chN EQU Intrfc_offs chN#_tp EQU chTp ;mov eax,chTp Intrfc_offs EQU Intrfc_offs+SzComBits } Code: In code: VarCom cb1,coi comcall cb1,cb1_tp,AddRef,1 |
|||
23 Jul 2020, 05:54 |
|
ProMiNick 23 Jul 2020, 07:13
Code: interface coi,\ QueryInterface,AddRef,Release interface cb1_tp,\ QueryInterface,AddRef,Release section '.bss' readable writeable cb1 rd 1 section '.code' code readable writeable executable comcall cb1,coi,AddRef,1 ;compile fine comcall cb1,cb1_tp,AddRef,1 ;compile fine too without Code: interface cb1_tp,\ QueryInterface,AddRef,Release could be Code: cb1_tp.com.interface = 12 cb1_tp.QueryInterface = 0 cb1_tp.AddRef = 4 cb1_tp.Release = 8 as thou see equation of symbol cb1_tp to coi is not enought because needed 4 more equations (in current case, with other interface needance could be bigger) -------------------------- And it is bad practice to place macros that not produce data to one of PE sections. good style - when thou place them among other includes before 1st PE section. |
|||
23 Jul 2020, 07:13 |
|
Roman 23 Jul 2020, 07:51
If write macros mEQUInterface with match ?
mEQUInterface coi,QueryInterface,AddRef,Release macro mEQUInterface do: coi.QueryInterface EQU 0 coi.AddRef EQU 4 coi.Release EQU 8 |
|||
23 Jul 2020, 07:51 |
|
revolution 23 Jul 2020, 08:10
I suggest to not use EQU. This is the cause of problems. Use = instead
|
|||
23 Jul 2020, 08:10 |
|
Roman 23 Jul 2020, 09:08
if i write cb1_tp = coi
Fasm get error undefined symbol coi |
|||
23 Jul 2020, 09:08 |
|
revolution 23 Jul 2020, 09:33
coi is not a simple number.
Did you try FIX? |
|||
23 Jul 2020, 09:33 |
|
Roman 23 Jul 2020, 09:40
How use FIX in macro com2 ?
Code: macro com2 handle,interface,proc,[arg] { common if ~ arg eq reverse pushd arg common end if ; assert defined interface#.com.interface ; must be a COM interface if handle eqtype eax | handle eqtype 0 push handle local ..handle label ..handle at handle mov eax,[..handle] else mov eax,handle push eax mov eax,[eax] end if ;elccc = interface call [eax+interface#.#proc] } |
|||
23 Jul 2020, 09:40 |
|
revolution 23 Jul 2020, 09:44
cb1_tp fix coi
|
|||
23 Jul 2020, 09:44 |
|
Roman 23 Jul 2020, 09:53
cb1_tp fix coi
comcall cb1,cb1_tp,AddRef Work. But i need do fix in macro. macro VarCom chN,chTp { chN EQU Intrfc_offs chN#_tp EQU chTp Intrfc_offs EQU Intrfc_offs+SzComBits } If i write macro VarCom chN,chTp { chN EQU Intrfc_offs chN#_tp EQU chTp chN#_tp FIX chTp Intrfc_offs EQU Intrfc_offs+SzComBits } I get fasm error coi fix coi |
|||
23 Jul 2020, 09:53 |
|
ProMiNick 23 Jul 2020, 10:47
Roman, existing macros successfully calls interface.
Thou want provide smthing thour own. What for? What syntax thou want? What in current syntax is problematic for thou? inheritance of interfaces? |
|||
23 Jul 2020, 10:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.