com64.inc

来自「一个用纯汇编 写的操作系统 源代码 是用 TASM 编译器写的」· INC 代码 · 共 45 行

INC
45
字号

; Macroinstructions for interfacing the COM (Component Object Model) classes

macro cominvk object,proc,[arg]
 { common
    macro call dummy
    \{ mov rax,[object]
       mov rax,[rax]
       call [rax+object#.#proc] \}
    fastcall proc,[object],arg
    purge call }

macro comcall handle,object,proc,[arg]
 { common
    macro call dummy
    \{ if handle eqtype rax | handle eqtype 0
	push handle
	local ..handle
	label ..handle at handle
	mov rax,[..handle]
       else
	mov rax,handle
	mov rax,[rax]
       end if
       call [rax+object#.#proc] \}
    fastcall proc,handle,arg
    purge call }

macro interface name,[proc]
 { common
    struc name \{
    match any, fields@struct \\{ fields@struct equ fields@struct,.,name, \\}
    match , fields@struct \\{ . dq ?
    virtual at 0
   forward
    .#proc dq ?
   common
    end virtual \\} \}
    virtual at 0
   forward
     name#.#proc dq ?
   common
    end virtual }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?